A Behat Context for integrating with Zalenium and allowing split videos for test scenarios
The context passes message to Zalenium through the use of Browser cookies:
- To indicate test pass and failure
- Add current step message to output video
- Some error handling
- PHP7.0+
- Using Zalenium (based on Selenium 3)
- Docker (for Zalenium to run)
- Using Chrome in automated tests
Install via composer -
composer require edmondscommerce/behat-zalenium-context:dev-master@devif you are using this in your main repository we suggest add this as a dev dependency with the --dev flag
Replace the MinkExtension in your behat.yml file with the ZaleniumExtension.
This is required to allow the Zalenium messages to be set in the videos correctly.
default:
extensions:
Behat\MinkExtension: Becomes
default:
extensions:
EdmondsCommerce\ZaleniumContext\ZaleniumExtension:default:
# ...
suites:
default:
# ...
contexts:
- # ...
- EdmondsCommerce\ZaleniumContext\ZaleniumContextThis will allow the ZaleniumDriver to work in place of Selenium2Driver.
The ZaleniumDriver is an extension of the Selenium2Driver.
# ...
selenium_chrome_session_headless:
selenium2:
browser: chrome
capabilities:
# ...Becomes
# ...
selenium_chrome_session:
zalenium:
browser: chrome
capabilities:
# ...See our handbook page in the links below for further information on how to use Zalenium with Behat. If you find a bug or want to help improve the extension, drop us an issue/pull request!
By default, the ZaleniumDriver will disable W3C mode, this is not supported by the underlying web driver.
As a matter of convenience, this has been done in the driver itself, along with the allowance of insecure SSL.
These options are automatically added to the desired capabilities.
All test scenarios must have a name, the following will cause an exception in the Zalenium driver.
Scenario:
Given I don't set my scenario name
Then I see my tests are broken