This project contains the Senior Automation Challenge v2 project from Winston Cruz that consists of working the following tasks with a new set of tools:
- Automate 10 test cases for the Orange HRM web application
- Automate 3 API Calls to Marvel API Endpoints, and also automate its invalid scenarios
The framework containst the following 11 test cases for the webapp https://opensource-demo.orangehrmlive.com/web/index.php/:
Login
- Login
- Invalid Login
- Logout
PIM Employees
- Add an Employee
- Update an Employee
- Search an Employee
- Remove an Employee
Admin Users
- Add a System User
- Update a System User
- Search a System User
- Remove a System User
The test case were documented on the Test Management Tool called Qase before proceeding the automation work. Feel free to request me the access to the test cases if needed.
For the API testing it was required to be automated 3 request to the Marvel Comics API Marvel Developer Site.
- Automate that all the characters can be fetch.
- Automate that all the comics for Spiderman can be fetch.
- Automate that all characters for the X-Man comic can be fetch
Using SSH
git clone [email protected]:AlephCK/AutomationChallengeV2.git
Install all dependencies
npm install
First, create a Marvel Developers account and follow their official documentation here: https://developer.marvel.com/documentation/getting_started, in order to get the API Keys that are needed to run this project.
We use .env
file to add the credentials used for both API and e2e specs tests locally:
USERNAME: 'Admin'
PASSWORD: 'admin123'
MARVEL_PRIVATE_KEY: '{MARVEL_PRIVATE_KEY}'
MARVEL_PUBLIC_KEY: '{MARVEL_PUBLIC_KEY}'
The following commands can be used in order to run the test cases:
Open UI mode
npm run test-open-ui
Show test reports
npm run test-show-report
Run all specs (both API and e2e)
npm run test-all
Run the e2e tests
npm run test-e2e
Run the API tests
npm run test-api
Run ESLint to fix any typos
npm run lint-fix
Run ESLint to look out for any typos
npm run lint-check
All the API tests (valid and invalid) were done using Insomnia.
Go to insomnia.rest/download to download the Insomnia Client and install in your preferred OS.
Once Insomnia Client is installed, you'll need to import the Insomnia collection file located on the folder Insomnia API Collection
on the root folder of this project.
To import the file, click on Create > Import from File
or click Insomnia > Settings > Data > Import Data
.
Once the collection is imported, click on No Environment > Manage Environments > Base Environment
and add the apiKey (which is the publicKey provided by Marvel Developer API) and the hash.
To generate the hash, you can use the following website to generate it. The format is the following:
md5(ts+marvelPrivateKey+marvelPublicKey)
Ex:
ts: 1000
marvelPrivateKey: abcdef
marvelPublicKey: 123456
md5(1000abcdef123456)
Where marvelPrivateKey
and marvelPublicKey
will be the keys provided by Marvel API Developer.