Skip to content

Commit

Permalink
Updated running_tests.md
Browse files Browse the repository at this point in the history
  • Loading branch information
barbaragr committed Sep 18, 2024
1 parent 47a0447 commit d946303
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions doc/running_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,40 @@

## Configuration

In order to use BehatBundle you need to use `behat` Symfony environment (which is defined in eZ Platform by default). It is also recommended to run in enabled debug mode, which gives you more detailed browser screenshots in case of failure.
In order to use BehatBundle you need to use `behat` Symfony environment (which is defined in Ibexa by default). It is also recommended to run in enabled debug mode, which gives you more detailed browser screenshots in case of failure.

The standard behat configuration file is [behat.yml.dist](https://github.com/ezsystems/ezplatform/blob/2.5/behat.yml.dist), located in eZ Platform's main directory. There you can:
The standard behat configuration file is [behat_ibexa_oss.yaml](https://github.com/ibexa/behat/blob/4.6/behat_ibexa_oss.yaml), located in ibexa/behat directory. There you can:
- in the `Behat\MinkExtension` section:
- set the URL of your website for browser testing (`base_url` parameter)
- set driver configuration (for example `wd_host` for Selenium Server)
- see [MinkExtension documentation](https://github.com/Behat/MinkExtension/blob/master/doc/index.rst) for more information
- in the `Bex\Behat\ScreenshotExtension` section:
- set your Cloudinary account details (`cloud_name` and `preset` parameter) to specify where the screenshots are uploaded
- see [Cloudinary screenshot driver doc](https://github.com/ezsystems/behat-screenshot-image-driver-cloudinary/blob/master/README.md) for more details about the Cloudinary integration and [elvetemedve/behat-screenshot](https://github.com/elvetemedve/behat-screenshot) for other screenshots configuration options
- in the `Behat\Symfony2Extension` section:
- set Symfony environment (`env` parameter)
- enable Symfony debug (`debug` parameter)
- See [Symfony2Extension documentation](https://github.com/Behat/Symfony2Extension/blob/master/doc/index.rst) for more information

Behat profiles and suites are not defined in this file, but imported from files specified at the bottom.
Behat profiles and suites are not defined in this file, but imported from files specified at the top.

### Running browser tests

If you want to run browser tests you need to have Selenium Server runnning. One way of doing this is running our Docker stack, which has built-in support for it: see [eZ Platform Docker blueprints](https://github.com/ezsystems/ezplatform/blob/master/doc/docker/README.md#behat-and-selenium-use) documentation for more information.
If you want to run browser tests you need to have Selenium Server runnning. One way of doing this is running our Docker stack, which has built-in support for it: see [Ibexa Docker blueprints](https://github.com/ibexa/docker/blob/4.6/README.md#behat-and-selenium-use) documentation for more information.

Another way is to use the Selenium Server Docker container and setting it up manually. Look at [ezplatform's .env file](https://github.com/ezsystems/ezplatform/blob/master/.env#L17) for the currently used version.
Another way is to use the Selenium Server Docker container and setting it up manually. Look at [manifest.json file](https://github.com/ibexa/recipes-dev/blob/master/ibexa/docker/4.6/manifest.json#L23) for the currently used version.

It can be set up using:
`docker run -p 4444:4444 -p 5900:5900 --shm-size=1gb -d --name=containerName selenium/standalone-chrome-debug:3.141.59`

Where:
- 4444 is the port where Selenium Server will be accessible
- 5900 is the port where the VNC client is accessible (to preview running tests)
- shm-size is related to Chrome containers requiring more memory (see [Selenium container configuration](https://github.com/ezsystems/ezplatform/blob/master/doc/docker/selenium.yml#L16))
- shm-size is related to Chrome containers requiring more memory (see [Selenium container configuration](https://github.com/ibexa/docker/blob/4.6/docker/selenium.yml#L19))

After the container is set up correctly you need to adjust the configuration of `selenium2` driver in `behat.yml.dist` file
After the container is set up correctly you need to adjust the configuration of `selenium2` driver in `behat_ibexa_oss.yaml` file

## Running tests

### Running standard Behat tests

BehatBundle comes with a wrapper for the standard Behat runner: [ibexabehat](../bin/ibexabehat.sh) to make running tests in parallel easier.
BehatBundle comes with a wrapper for the standard Behat runner: [ibexabehat](https://github.com/ibexa/behat/blob/4.6/bin/ibexabehat) to make running tests in parallel easier.

Use:
```
Expand All @@ -57,7 +53,7 @@ Running Behat feature files in parallel (on the available number of CPUs) is the

## Existing test profiles and suites

By convention profiles and suites are defined in the `behat_suites.yml` file in each bundle, if they exist. See [BehatBundle suites](../behat_suites.yml) and [AdminUI suites](https://github.com/ezsystems/ezplatform-admin-ui/blob/master/behat_suites.yml) for examples.
By convention profiles and suites are defined in the `behat_suites.yml` file in each bundle, if they exist. See [BehatBundle suites](../behat_suites.yml) and [AdminUI suites](https://github.com/ibexa/admin-ui/blob/4.6/behat_suites.yml) for examples.

In order to run them, execute:
- `bin/ibexabehat --profile=behat --suite=examples` (BehatBundle usage examples)
Expand Down

0 comments on commit d946303

Please sign in to comment.