Download the PHP package libresign/nextcloud-behat without Composer
On this page you can find all versions of the php package libresign/nextcloud-behat. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nextcloud-behat
Nextcloud Behat context
Basic Behat steps for a Nextcloud app
Install
Create the file behat.yml
Create the file tests/features/bootstrap/FeatureContext.php
with this content:
Then, now you can see all available steps:
Tips
Value as string
To send a json value as string, prefix the json string with (string)
Example:
Value as array
To send a value as array, you can set a json string and the json string will be converted to array
Example:
Step: fetch field :path from prevous JSON response
If the json response is an array, you can fetch specific values using this step. The fetched values is stored to be used by other steps.
:path
: Path is a selector to retrieves a value from a deeply nested array using "dot" notation:
To the follow json:
path need to be: products.desk.price
You also can prefix the path by an alias inside parenthesis:
(price)products.desk.price
The alias price
could be used in a path or body of a request:
Parse response using jq
You can use jq expression casting to check a value in a json response body of a request. To do this you will need to install the jq command.
Example:
Parse text
If you need to:
- Get values from a request, store and use in other request
- Parse the response of a request
Implement a method parseText
like the follow code and remember to call parent method.
This methods can works together with fetch field :path from prevous JSON response
For more information about parseText, check the scenario Test get field from json response
All versions of nextcloud-behat with dependencies
guzzlehttp/guzzle Version ^7.8
phpunit/phpunit Version *
behat/behat Version ^3.13
libresign/behat-builtin-extension Version ^0.6.2
estahn/json-query-wrapper Version *