Skip to content

Latest commit

 

History

History
105 lines (67 loc) · 3.97 KB

File metadata and controls

105 lines (67 loc) · 3.97 KB

C&A QA Task

Table of Contents

  1. General Info

    -Cypress

    -Mailsac

  2. Technologies

  3. Project structure

  4. Installation

  5. Reporter - Mochawesome

    -Mochawesome

  6. Email contact

General Info

This is a QA task for C&A login page. This includes docs for manual tests covered (tests.txt), and test themselves using Cypress automation framework.

Please note passwords are for a test accounts created during creation of project, and normally would be used as secret key passed as environment variable via command line, to not be exposed anywhere.

I'm also leaving .env file with some credentials, but feel free to modify to different users.

Technologies

Cypress

Cypress docs: Cypress docs

Mailsac

Mailsac email api: Mailsac

EMAIL_API_KEY is for apikey mailsac API which will allow to call on inboxes API and assert on emails received.

Mailsac is free for sign up, and inboxes can be created with different emails and a different email api key.

On Forgot Password spec; within the before() clause on the start of the script, mailsac will be called on whichever inbox is set as 'mailsacEmail1' env variable, and delete all emails. Then we assert that after triggering of the forgot password, we can await and assert email is received.

During creation I did test the website with different accounts but at some point I stopped receiving the emails in Mailsac. Not sure if anti-spam or security feature.

With that in mind, I've set tests up to point to a Mailsac inbox which has already an email for reset password and asserts on email received.

This inbox on checkEmailInbox() command, is not the same variable called on before() clause which deletes all emails in an inbox, so the email is there to see the flow when its called and asserted.

I shall reset said key a bit after you review entire project.

In root I've also added .mov file with recording and image of CLI results.


Project-structure

 ├── cypress                   # cypress main folder.
    ├── downloads              # Downloaded file folder
    ├── fixtures               # Fixtures folders -> images, json's etc.
    ├── e2e                    # Main folder for specs. Broken down by FE, BE, + any add.
        ├── ca.login.js         
    ├── plugins                # Where tasks are added.
    └── support                # Where commands are added.
    └── utils                  # Utilities

Installation

See below: Cypress Install

Cypress installation documents found below however, easiest way is to navigate to root of project, and install dependencies.

npm i

Once dependencies are installed, to run cypress test runner, navigate to Cypress root folder where it was downloaded/place in (/CA_task) and run command

'npm run cy:open'

This will open the test runner from where you can run the spec for login page.

Here you will see all actions taken on UI.

Alternatively, if you want to simply run the spec you can run.

'npm run cy:run:loginTest' 

Here, the test will run on terminal.

isolated

All start and run scripts available in 'package.json'.

Reporters

Example reporter already included under cypress/results/mochawesome.html.

If you open file in browser, by adding its full path, you will see a formated reported.

Further cypress reporter options available below: Cypress reporters

-Mochawsome

isolated

Questions

Any questions, please reach out to diegsan20@gmail.com.