Skip to content

Demo data driven test automation framework for the LoopQA interview

Notifications You must be signed in to change notification settings

NadiraMaria/loopqa-playwright-demo

Repository files navigation

LoopQA Playright Test Automation Framework

Demo test playwright test automation framework that leverages data-driven technique for minimizing code duplications. Follow these steps to run the tests from this framework:

Dependency Installation

Please install all the module dependencies by running the following command in the root directory:

npm install

Please ensure that the Playwright browser binaries are installed by running the following command:

npx playwright install

Running tests

To run the tests, you must always provide the password for the test users. Note that the password is not included in the codebase for security reasons. Below is the environment variable you need to set for test execution. If you are using these variables in your CI/CD pipeline, ensure that the corresponding environment variables are created.

NOTE: For the purpose of this demo, I will provide the PASSWORD value in this README.md. However, in a real-world scenario, the PASSWORD value should never be included in the codebase.

Example:

SITE="https://animated-gingersnap-8cf7f2.netlify.app"\
 TESTUSER=admin PASSWORD=password123 npx playwright test

Since the default values for SITE and TESTUSER are already in the codebase, you only need to provide the PASSWORD value to run the tests.

Running all tests:

PASSWORD=password123 npx playwright test

Running a specific spec file:

PASSWORD=password123 npx playwright test tests/smoke.spec.ts

Running specific test project ( a collection of tests):

PASSWORD=password123 npx playwright test --project=firefox

Note: If you want to group different spec files into distinct test groups, you can do so by updating the projects array in the playwright.config.ts file. Ensure that you define the correct testMatch regex for each group**

Viewing Test Result

You can view the test results by running the following command:

npx playwright show-report reports 

About

Demo data driven test automation framework for the LoopQA interview

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published