codeceptjs-webdriver v14.15.3
ui_tests
Install
npm i If running tests vis Selenium: 1) Default option.
- Download selenium standalone server - https://www.selenium.dev/downloads/
- Download webdrivers for your version of browsers: chrome (https://chromedriver.chromium.org/downloads), firefox(https://github.com/mozilla/geckodriver/releases),
opera(https://github.com/operasoftware/operachromiumdriver/releases), Microsoft Edge (https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/).
Safari webdriver is already included in MacOSX. It is required ro run once
safaridriver --enable
. Also in Safari browser check thet Choose Develop - Allow Remote Automation option is selected. Before starting tests it is required to start selenium server. For example:java -Dwebdriver.chrome.driver=chromedriver -jar selenium-server-standalone-3.141.59.jar
if using chromejava -Dwebdriver.chrome.driver=geckodriver -jar selenium-server-standalone-3.141.59.jar
for firefox, etc. This option is highly configurable (for example, it is possible to run tests on different versions of the same browser (chrome 81, chrome 80, etc.), but requires webdriver's magagement as every major version of browser requires appropriate version of webdriver.
2) Custom option, using codeceptjs plugin. In the configuration file, inside plugin section there is a plugin enabled - wdio. To use it just add option --plugins wdio
to the running command. Problem noticed: option windowSize: "maximize"
for chrome doesn't work, could be windowSize: '1920x1680'
used instead.
Configuration
The main configuration file - codecept.conf.js Inside helpers section it is possible to switch between diffent runners: Webdriver, Testcafe, Playwright etc. Note, that only one runner should be used, others should be commented. Currently tested on Chrome and Firefox on following runners
- Selenium Webdriver
- Testcafe (works but before the tests mute button should be clicked, also problems with drag and drop)
- Playwright (video doesn't start on chrome, but works in firefox)
Run
Run below commands in the same folder where the codecep.conf.js file is locarted
- ./node_modules/.bin/codeceptjs run - base command to run all tests, specified int the codecept.conf.js Options:
--steps
- console output of every step (CLI reporting)--grep @tagName
- scenarios could be marked the tags and using this option it is possible to run particular group of tests or one test--plugins pluginName
- run tests, using plugin from the config file. For reporting curretnly two plugins were tested--plugins allure
- run tests to generate reports, using allure framework. After runnning tests the following command should be excecuted to run allure server and to show reportallure serve output
--reporter mochawesome
- generated offline HTML report. Current problem - adding screenshot to the report doesn't work
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago