Example of Selenium tests with Mocha and Allure report
- Clone this repository
git clone firstname.lastname@example.org:allure-examples/mocha-allure-example.git && cd mocha-allure-example
- Install dependencies
- Run tests via
npm test. It will start Selenium server and perform some tests
npm run reportto build
htmlreport from results and it will be opened in your browser
- pages/ – directory with page objects. Page object is an convenient way to create reusable actions to interact with page .
- test/ – test files. Our setup uses Mocha.
- simple.spec.js – simple test example that uses only pure Allure, without webdriver
- webdriver-io.spec.js – tests with selenium and webdriver.io, one of the popular libraries
- util/ - additional helpers
- config.js – configuration file where specified base options for tests. Here you can change target browser or page urls
- browser.js - browser provider for your tests
Also, check out files content, they are also well-commented.