Setup automated test framework using CucumberJS library writing tests in Typescript. The example feature uses selenium webdriver to launch tests for frontend.
- Ensure you have node installed globally on your machine.
- Ensure you have yarn installed globally on your machine.
- Ensure you have chrome browser installed and its path defined (both windows and mac users)
- Ensure you have geckodriver installed and its path defined (both windows and mac users)
yarn install
-- this step will download the required packages defined in package.json- To run feature file
yarn cucumber --url=<URL>
- To run a scenario in parallel (that is more than 1 browsers)
yarn cucumber:parallel --url=<URL> --config=parallel
- Create a new feature file under features folder e.g.
example.feature
- Add your scenario
- Run the feature file, it will complain about missing/pending step def.
- Simple copy those steps and create a new step file or add those steps to an existing file under
step_definitions
For simple projects using single browsers, you can simply run the following command
in your process once test run is complete
yarn generateTestReport