Task for Kaluza
This is a task to Automate API using Cypress, Cucumber and Mochawesome report, Please see below for the Test Case that are automated
Why I choose Cypress?
I choose Cypress over other tools because I have many years of experience with this tool and I feel comfortable. Cypress also provides integration with Cucumber for writing the test scenarios in BDD format.
Due to TLF api registration form having issues, I took the decision to looking for an alternative API. I found CityMapper API
I also used https://postcodes.io/ API to generate lat & long for a location(postcode)
I have left one test case failing to demonstrate the debuging of the report
Prerequisite
city mapper
- Go to https://enterprise.citymapper.com/ and create a free account to access API Key
- Then create a
.env
and add the key by following.evn.example
template
mediawiki
- Go to https://www.mediawiki.org/wiki/Manual:Bot_passwords and create a free account to be able to create a bot
- Then edit
.env
and add theusername
&password
by following.evn.example
template
Install
- clone the repo
npm install
oryarn install
Run tests
CLI - Run CLI
Run regression
npm run run:regression
Run smoke pack
npm run run:smoke
Cypress UI - Run on Cypress UI
npx cypress open
Generate Report
node cucumber-html-report.js
Technology used:
- Cypress
- Cucumber
- Mocha
- Gitub Action
- multiple-cucumber-html-reporter