In this project, I selected an existing website to demonstrate my testing expertise. I created a Requirements Traceability Matrix (RTM), along with UI and API tests, to validate key scenarios.
UI tests: https://www.loom.com/share/37d6bf077a034e56abdbafa4cad706a7?sid=9e001a3f-2175-489b-8287-760d5b103d5e
API tests: https://www.loom.com/share/2435b19c4a514335a89a501723fcf13c?sid=f4bbff9c-0f9a-427a-be3a-76260669c648
RTM: https://jmp.sh/s/amRbi7SxXRRoaZE8q5kg
There is an RTM attached with the name RTM.xlsx where I have built the RTM that covers features like App access, Ticket creation & Case creation.
Framework selection: I selected PlayWright since our focus was only cross desktop-browser testing. As PlayWright uses chromium dev tools like protocol is alot more stable.
Selenium uses APIs to communicate with the driver which introduces all the API related stablity issues. So it was better avoided.
Cypress was an alternative as well, however, parallelization would be a task.
WDIO would be my go to framework if mobile based browser testing was needed.
Tests:
BeforeAll Hook:
I first start with registering a user on the platform. Leveraged faker library here to ensure that the creation of email does not follow any specific preset pattern and is
genuinly dynamic.
Test Cases
- Log into the platform create a ticket and asserts the ticket creation and log out. Leveraged 'expect' from PlayWright.
- Log into the platform creates a case and asserts the case creation and log out.
I have added a file BE validations.postman_collection.json.
The API test includes:
RBAC:
POST /login - Verify if we're able to login with valid credentials. Validation: Check for status 200
POST /login - Verify if login fails if we don't pass credentials. Validation: Check for sstatus 422
POST /login - Verify if login fails if we pass invalid credentials. Validation: Check for sstatus 403
Ticket creation:
POST /ticket - Create a new ticket for the User ID obtained after a successful login. Validation: A ticket ID should be returned.
GET /tickets - Get a list of tickets for the User ID obtained after a successful login. Validation: The ticket ID returned above should be present
PUT /ticket - Update a certain parameter for the ticket ID returned above. Validation: Check for status 200 and expect response Ticket updated.
Get Cases:
GET /cases - Just logging all the cases created by the User ID obtained above. Validation: Added schema validation.
This script can easily be exececuted on multiple browsers in parallel.
Some minor changes are needed to generate email address since we would like to generate email address only once and use it across
This guide will walk you through installing the necessary dependencies, setting up Playwright browsers, and running tests using pytest.
Make sure you have the following installed:
-
Python (version 3.8 or above)
Download Python -
pip (Python's package manager)
Comes pre-installed with Python. You can verify by running:pip --version
Run the following command to install all the dependencies:
pip install -r requirements.txtAfter installing the dependencies, you need to install the Playwright browsers. Use the following command:
playwright installThis will download and set up Chromium, Firefox, and WebKit browsers.
Alternatively, to install specific browsers only, use:
playwright install chromium firefox webkitTo run the tests using pytest, navigate to your project directory and execute:
Run the Playwright-integrated tests using:
pytest --headed --browser=chromium --browser=webkitpipcommand not found: Ensure Python is added to your system's PATH.- Browser installation fails: Check your internet connection and retry
playwright install. - Module not found errors: Ensure all dependencies are listed in
requirements.txtand correctly installed.
This guide covers the basic setup to install dependencies, install Playwright browsers, and run tests using pytest. For more advanced configuration, refer to the Playwright documentation or the pytest documentation.
Thanks, for coming up with a feedback/suggestion. You can reach out to me on adityagholkar@gmail.com