QA Automation Challenge

This is an automation framework designed to test the website (UI Test) automationpractice.com/ and Marvel API which can be found in developer.marvel.com/docs/.

UI testing

The test cases have been documented in platform qatouch.com. To access the test suite, can reach me at: edgarysabel@gmail.com. These were the scenerios documented as well as automated:

1. Sign up.

2. Login.

3. Logout.

4. Search Item.

5. Subscribe to newsletter.

6. Add item to shopping cart.

7. Checkout.

8. Delete item from shopping cart.

9. Add message to order.

10. Contact Us.

API testing

For API Testing, 3 scenarios where automated:

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

Run Locally

Required to run project

  • Node.js

  • Must have a Marvel Private Key and Public Key which can be obtained going to Marvel's developer website and creating a new account.

  • An email and password is needed for automationpractice.com/.

    Note: Both Marvels Keys and Account for UI testing are being included in Main branch, feel free to use this or generate new ones.

  • Clone repository:
  git clone https://github.com/edgarysabel/Edgar-Ysabel-QA-Challange.git
  • Install dependencies:
  npm install
  • Run project in headless mode:
  npm run cy:run
  • Run project in headed mode:
  npm run cy:open

This will run all the tests and generate a report at the end of the execution.

Note: local testing is configured to run on Mac/Linux based environments. If running in a windows machine please go to package.json under root directory and replace:

  "cy:open": "yarn cypress open --env allure=true --browser chrome",
  "cy:run": "yarn cypress run --config video=false --env allure=true --browser chrome",

for:

  "cy:open": "npx cypress open --env allure=true --browser chrome",
  "cy:run": "npx cypress run --config video=false --env allure=true --browser chrome",

Run CI

CI has been configured with Github Actions for ease of use and integration since project is already hosted on Github. To run it just go to actions and run the workflow Allure-report under your preferred Branch. Aditionally, pipeline always run whenever there is a new commit.

Note: To be able to do commits or run workflows please reach me at edgarysabel@gmail.com.

Test Reports

Test report have been done with Allure Report and stored with GitHub Pages, so pipeline is run, the reports are generated along it. To access reports go to edgarysabel.github.io/Edgar-Ysabel-QA-Challange/allure-report.

Project Structure

UI testing configuration

The file cypress.env.json under root directory contains needed credentails for UI testing. Working credentials are currently included with the project.

  {
  "FRONTEND_URL": "http://automationpractice.com/index.php",
  "USER": "email@mail.com",
  "PASSWORD": "password"
   }

API testing configuration

Under directory cypress/support, file api.js contains the properties apiDetails.publicKey and apiDetails.privateKey, which are the needed keys to access the API. You can replace them with the ones obtained from Marvel's developer website after creating the account.

    apiDetails.publicKey = "Marvel Public Key";
    apiDetails.privateKey = "Marvel Private Key";

Note: required hash is being generated by using the MD5 library in this same file.

  apiDetails.ts = date.getTime();
  apiDetails.hash = md5(apiDetails.ts + apiDetails.privateKey + apiDetails.publicKey);

Must Know

  • For API invalid scenarios was used failOnStatusCode: false, so it continues and do the assertions.

  • A custom POM Pattern with Javascript and Cypress was used.

  • The static data is stored on fixture for each test case.

  • The website automationpractice.com has loading issues and can make tests fail.