Skip to content

nabilshaikh/cypress-demoqa-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cypress-DemoQA-Tests

This Cypress based sample tests project is implemented with the help of TypeScript and uses page-object model as the design pattern with BDD approach.

Folder Structure:


├── cypress
│   └── specs (feature files)
|   └── step-definitions (tests code)
│   └── ui-identifiers (page objects)
│   └── reports (load reports in HTML & JSON formats)
│   └── screenshots (capture screenshot on failure)
└── cypress.json (cypress global configuration)
└── testReport.html (mochawesome based HTML report)

Salient Features:

  • Based on POM design pattern.
  • Has the capability to run on various viewports such as desktop, tablet and mobile.
  • Based on Cucumber / Gherkin standard.
  • Cross-browser platform.
  • Fully automated and provide both console and HTML report.
  • Ability to take screenshot on failure.

Installation:

  • Clone the project
  • Open terminal and run npm install

Running tests:

  • Open terminal, run npm run cy:open to run tests in headed mode or run npm run cy:run to run in headless mode

Once the execution is complete, this is how the test report would look like,

Console:

console-report

HTML:

html-report

(A) Testing strategy

The goal of test automation is to increase the effectiveness and efficiency of testing. Good automation makes testing faster, more systematic, and reduces human error. This includes: to reduce the number of test cases that testers have to perform manually as well as those that are challenging to perform manually, therefore saving time and effort.

The ideal test automation strategy is to follow the Test Pyramid mindset. The test pyramid is a way of thinking about how different kinds of automated tests should be used to create a balanced portfolio. The whole point is to offer immediate feedback to ensure that code changes do not disrupt existing features. This would essentially help both developers and QAs to create high-quality software. It reduces the time required for developers to identify if a change they introduced breaks the code.

This test automation pyramid mainly operates at three levels: Unit, Integration & UI.

Test Pyramid

  1. Unit tests form the base of the test pyramid. They should be frequent, and they should run fast.

  2. Integration tests are the middle tier of the pyramid. These tests focus on interactions of your code with the outside world, such as databases and external services or microservices.

  3. UI tests top the test pyramid. They’re written from the perspective of a user and should test that your entire application is functioning from front-end to back-end.

Why to use test pyramid?

  • Pyramid help QAs to define right priorities. If test scripts are written with a greater focus on the UI, then chances are that core business logic and back-end functionality is not sufficiently verified periodically. Hence, this affects product quality and leads to more work for the team.
  • As TAT (turnaround time) of UI tests is high, it leads to lower test coverage overall. By adopting the pyramid, such situations can be completely avoided, and QAs can focus on writing quality tests keeping in mind all the 3 layers defined.
  • Frequent collaboration between 3 Amigos (i.e. Developer, Tester & Product Owner)
  • Since the pyramid is built to run the complex tests at the beginning, testers can manage time better, get better results and essentially make life easier for everyone involved. Therefore, it emphasize speed and efficacy.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published