Complex Counter App / PASV Automation Framework
- Clone repository
- Run
npm install
- Run
npm run cca-smoke
- Create new NodeJS project
- Run
npm i --save-dev @wdio/cli
- Run
npx wdio config -y
- Run
mkdir -p ./test/specs & mkdir -p ./test/pages
- Babel setup:
- create babel.config.js file with following code:
module.exports = { presets: [ ['@babel/preset-env', { targets: { node: 12 } }] ] }
- Run
npm install --save-dev @babel/core @babel/cli @babel/preset-env @babel/register
- In wdio.conf.js edit this piece of code:
mochaOpts: { ui: 'bdd', compilers: ['js:@babel/register'], timeout: 60000 },
- Prettier setup:
- Run
npm install --save-dev prettier
- Create
prettier.config.js
with following code:module.exports = { trailingComma: 'all', tabWidth: 2, semi: true, singleQuote: true, bracketSpacing: true, arrowParens: 'avoid', parser: 'babel', printWidth: 100, };
- To run your tests use npx wdio wdio.conf.js
- Install Allure Reporter
npm install @wdio/allure-reporter --save-dev
- Add Allure to reporters in wdio.conf.js file:
reporters: ['spec', ['allure', { outputDir: 'allure-results', disableWebdriverStepsReporting: false, disableWebdriverScreenshotsReporting: true, }]],
- Install CLI for Allure
npm install allure-commandline --save-dev
- Modify your package.json file, so Allure Report generates and opens automatically after each test run. To do that you need to add allure generate allure-results --clean && allure open to existing scripts. For example:
"scripts": { "test": "wdio wdio.conf.js && allure generate allure-results --clean && allure open", },
From now each time you execute npm test
command, Allure Report will be generated and run on a local server.