Skip to content

AlephCK/playwright-demo-challenge

Repository files navigation

Senior Automation Challenge Project V2

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

UI Testing

The framework containst the following 11 test cases for the webapp https://opensource-demo.orangehrmlive.com/web/index.php/:

Login

  1. Login
  2. Invalid Login
  3. Logout

PIM Employees

  1. Add an Employee
  2. Update an Employee
  3. Search an Employee
  4. Remove an Employee

Admin Users

  1. Add a System User
  2. Update a System User
  3. Search a System User
  4. 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.

API Testing

For the API testing it was required to be automated 3 request to the Marvel Comics API Marvel Developer Site.

  1. Automate that all the characters can be fetch.
  2. Automate that all the comics for Spiderman can be fetch.
  3. Automate that all characters for the X-Man comic can be fetch

Tech Stack

General Requirements

Clone the Repository

Using SSH

git clone [email protected]:AlephCK/AutomationChallengeV2.git

Dev Install

Install all dependencies

npm install

Using credentials to run Playwrigth Tests

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}'

How To Use Playwright

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

Before doing a commit

Run ESLint to fix any typos

npm run lint-fix

Run ESLint to look out for any typos

npm run lint-check

Insomnia Setup

All the API tests (valid and invalid) were done using Insomnia.

Install Insomnia

Go to insomnia.rest/download to download the Insomnia Client and install in your preferred OS.

Import API Collection

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published