What is Playwright?
Built by Microsoft, Playwright is a Node.js library that, with a single API, automates Chromium, Firefox, and WebKit. These APIs can be used by developers writing JavaScript code to create new browser pages, navigate to URLs and then interact with elements on a page. In addition, since Microsoft Edge is built on the open-source Chromium web platform, Playwright can also automate Microsoft Edge.
What is BDD?
Behavior-driven development (BDD) is an Agile software development methodology in which an application is documented and designed around the behavior a user expects to experience when interacting with it. By encouraging developers to focus only on the requested behaviors of an app or program, BDD helps to avoid bloat, excessive code, unnecessary features or lack of focus. This methodology combines, augments and refines the practices used in test-driven development (TDD) and acceptance testing.
1. Install Node Js version 14 or later. (https://nodejs.org/en/download/)
2. Install Visual Studio Code. (https://code.visualstudio.com/download)
3. Install vs code extensions- Cucumber (Gherkin) Full Support v2.15.2
4. Install vs code extensions- ESLint v2.4.0
5. Install vs code extensions- Prettier - Code formatter v9.10.4
1. Clone the repo- https://github.com/CDL-samir-thaker/MS-Playwright-Cucumber-BDD-html.git
2. Install required dependency node_modules via running command (npm i or npm install ) in vs code terminal.
1. To run the test - Open vs code terminal and type npm run test
2. To generate report run - npm run report
1. For setting up ESLint & Prettier code formatting tools- https://dev.to/andrewbaisden/how-to-use-eslint-and-prettier-for-code-analysis-and-formatting-1b4g
Report Image: