Commit 3f955105 authored by Christian Keuerleber's avatar Christian Keuerleber
Browse files

TASK: add readme

parent b7224fdc
Pipeline #7801 canceled with stage
# Monitoring tests for
## Dependencies
* composer
* chrome/chromium
* chromedriver/chromiumdriver (e.g. `brew cask install chromedriver`)
At the moment (Nov 4th 2019) GeckoDriver and FireFox testing is only possible by using the detour via selenium,
and even then it's not really reliable.
## Setup project
composer install
## Run codeception tests
### Start chromedriver
In one terminal window, start the chromedriver and leave it running. Port 4444 and url-base `/wd/hub` are taken from
old selenium standards and are default in codeception.
chromedriver --url-base=/wd/hub --port=4444
### Run the tests
vendor/bin/codecept --steps run monitoring
With `--steps`, all run steps are outputted to the command line. All errors are reported even if you don't use the
flag. You can also add `--xml` as a flag to get JUnit compatible output.
If you get errors, you can find the output in the directory `Tests/_output`. In there is a list of failed tests and
a screenshot and the html output of the page the moment a test failed.
#### Single feature
To run a single feature just add the path to the feature file to your command, e.g.
vendor/bin/codecept --steps run monitoring Features/Login.feature
You can also run single scenarios by providing line numbers, e.g.
vendor/bin/codecept --steps run monitoring Features/Login.feature:10
## Writing tests
The monitoring tests are put into the directory `Tests/monitoring/Feature`. You can use any folder structure to
group your tests.
To get all the available step definitions just run the command
vendor/bin/codecept gherkin:steps monitoring
which outputs the steps added to the project.
To add new steps, just write the new step in your `.feature` file and run
vendor/bin/codecept gherkin:snippets monitoring
This will output a function stub with the proper step definition phpdoc. Put this in a appropriate `ActorTrait`
and (if needed) add the `ActorTrait` to the `MonitoringTester` (`Tests/_support/MonitoringTester.php`). Example
traits can be found in the directory `Classes/ActorTraits/` of the `punktde/codeception-*` packages.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment