A sample project with a quick introduction to wdio-allure-ts framework and its usage on a real-world application.
The project contains examples for the following:
- Tests for implementation.
- Page Object Model.
- Allure Reporter, integrated and configured for attaching screenshots, browser logs, and HTML source on test failures.
- Configurations for local and CI execution.
- Selenium grid setup for test execution.
Following those instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- NodeJs runtime engine
- Chrome and FireFox for tests execution and display allure reporter
- Java for selenium grid and report generation
Install packages:
npm install
Start Selenium grid: (start grid in separate terminal)
npm run grid
Execute test suite: *(npm test)
npm run suite todoMvcTestSuite
Execute single test:
npm run spec ./lib/tests/TodoAngularTest.js
Show report: require installed java and firefox
npm run report
Additional commands can be found in the package.json
Test located under /test folder and file names ends with Test.ts
Suggestion: Use only 1 test, to keep it more readable and in case of failure we'll rerun only one test and not all tests in class(Mocha limitation)
Describe should hold name of the tests suite and it will be represented in report as one suite, and each test should hold file name of the test class
Example where TodoAngularTest
is a suite name and test file name is TodoAngularTest.ts
describe('TodoAngularTest', () => {
it('Check URL', () => {
//some test implementation
});
});
Page Object Model is used for tests and all page classes located under /pages folder. Each class represent an UI object/functionality. For example: TodoAngularPage.ts holds main functionality of the page, while Button.ts class holds basic functionality of the button component
TestHelperUtils with common describe method that suites all the tests.
Click for live report example