- Added the functional_tests and performance_tests test cases.
- Implemented in Page Object Model, Modular approach and Behavioral Driven Development.
- Handled the parallel execution.
- configured gitHub Actions yaml with artifacts publish feature.
- Reports and traces generated and published in pipeline.
- Custom logging and Error handling were implemented.
-
Playwright is an open-source automation framework developed by Microsoft for testing and interacting with web applications.
-
I have used Playwright along with Cucumber to achieve behaviour-driven development (BDD).
-
I have used shell script to execute the functional tests.
-
Note: One of the usecase url i.e.,https://marksheet.io/html-forms.html is not as expected. It is not having required signup form. So I have changes the usecase according to the new url changes.
BusPatrol-Assignment/
├── functional_tests/
│ ├── src/ # Contains source code related to functional tests
│ │ ├── pages/ # Contains page objects (Page Object Model pattern)
│ │ ├── playwright_actions/ # Contains Playwright actions like interactions and asserts of elements
│ │ └── xpaths/ # Contains XPath selectors for locating elements
│ ├── tests/ # Contains test cases and test scripts
│ │ ├── features/ # Contains feature files with Gherkin languages
│ │ ├── hooks/ # Contains hooks from cucumber for browser, traces and screenshots setups
│ │ └── step_def/ # Contains step definitions to implement the actions described in the feature files
│ └── utils/ # Contains utility functions for functional testing
- Pre-setup:
- Install WSL
- Install Playwright in WSL
-
Navigate to root folder level in local
-
Set env values of channel=chrome or msedge & headless=true or false in .env file in root level
-
Open WSL in terminal in root level
-
Execute below command:
npm i # to install all dependencies required
bash run_ui.sh # to run the ui test cases
bash rerun_ui.sh # to rerun the ui test cases
- Prerequisite: I. Install Playwright in Windows
-
Navigate to root folder level in local
-
Set env values of channel=chrome or msedge & headless=true or false in .env file in root level
-
Execute below command:
npm i # to install all dependencies required
npm run_ui_tests # to run functional test cases
npm rerun_ui_tests # to rerun failed test cases
- Note: By running ui test cases, by default the report get generated in below path:
BusPatrol-Assignment/
├── test-results/
│ ├── json-reports/ # Contains index.html file report
- After running test cases in test-results, .json file will be generated. Based on that we will generate the cucumber html report.
- index.html folder shown in below path is the report file
- Run below command in wsl/windows to generate report.
BusPatrol-Assignment/
├── test-results/
│ ├── json-reports/ # Contains index.html file report
npm run_ui_report_gen # to generate the index.html file based on functional-tests-report in test-results folder
- K6 (from Grafana) is an open-source load testing tool designed for testing the performance and scalability of applications.
- I have used K6 library from Grafana for testing end points performance in web application.
- I have used the shell script to execute the performance tests by setting up required env values.
BusPatrol-Assignment/
├── performance_tests/
│ ├── tests/ # Contains tests related performance test
│ └── utils/ # Contains utility functions for performance testing
- Pre-setup:
- Install WSL
- Install K6 in WSL
- Install Playwright in WSL
- Navigate to root folder level in local
- Open WSL in terminal
- Execute below command:
npm i # to install all dependencies required
bash run_k6.sh # to reun the k6 test cases
- Note: search_and_navigate test cases is mostly failing because the bbc website is not withstanding for too many requests as shown in below screenshot:
- After running test cases reports will be generated in performance-reports folder.
BusPatrol-Assignment/
├── performance-reports/ # Contains performance test html file reports
- I have integrated the github action pipeline also. pipeline.yml is provided under './github/workflows' path.
- I have published the artifactes that contains traces and reports reports in pipleline.
- node.js [https://nodejs.org/en/download/package-manager]
- playwright (install typescript) [https://www.npmjs.com/package/playwright]
- cucumber [https://www.npmjs.com/package/@cucumber/cucumber]
- cucumber plugin in vscode [https://marketplace.visualstudio.com/items?itemName=CucumberOpen.cucumber-official]
- ts-node [https://www.npmjs.com/package/ts-node]
- k6 Grafana [https://grafana.com/docs/k6/latest/set-up/install-k6/]
- k6 Grafana node package [https://www.npmjs.com/package/k6]
- cucumber-js [https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md]
- winston logger [https://www.npmjs.com/package/winston]
- multiple cucumber html reporter [https://github.com/WasiqB/multiple-cucumber-html-reporter]