Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brunofbarbosa/playwright-cucumber-automation
Web automation framework using Java, Cucumber and Playwright
https://github.com/brunofbarbosa/playwright-cucumber-automation
cucumber java playwright
Last synced: 6 days ago
JSON representation
Web automation framework using Java, Cucumber and Playwright
- Host: GitHub
- URL: https://github.com/brunofbarbosa/playwright-cucumber-automation
- Owner: BrunoFBarbosa
- Created: 2023-09-05T14:17:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-05T16:06:21.000Z (over 1 year ago)
- Last Synced: 2023-09-05T17:41:33.674Z (over 1 year ago)
- Topics: cucumber, java, playwright
- Language: Java
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About the Project
[![e2e-tests](https://github.com/BrunoFBarbosa/playwright-cucumber-automation/actions/workflows/ci.yml/badge.svg)](https://github.com/BrunoFBarbosa/playwright-cucumber-automation/actions/workflows/ci.yml)
Simple web automation framework using Playwright, Cucumber, JUnit and Page Object pattern in order to increase the knowledge of such tools. The application under test is https://www.saucedemo.com/
## Getting Started
### Prerequisites
- OpenJDK 17+
- Apache Maven 3.9.3+### Installation
1. Clone the repo
```
git clone https://github.com/BrunoFBarbosa/playwright-cucumber-automation.git
```
2. Navigate to the project's folder and install the dependencies
```
cd playwright-cucumber-automation/
mvn clean install -DskipTests
```### Project's Structure
`/features`Folder where all the BDD test scenarios are located
`/src/test/resources`
Folder with the configuration for the QA and local environments
In order to run the tests you will need to configure the `uat.properties` file from the qa or local folder.
Example configuration:
```
BrowserName=chrome
HeadlessBrowser=true
LoginPageUrl=https://www.saucedemo.com/
ValidUser=standard_user
LockedUser=locked_out_user
ValidPassword=secret_sauce
```
`/src/test/java/com/automation/support/properties`- Folder related to the classes used for reading the properties file
`/src/test/java/com/automation/uat/features/login`
- Folder related to the Login test cases, steps definitions and dependency injection
`/src/test/java/com/automation/uat/pages`
- Folder related to the Page Object classes
`/src/test/java/com/automation/uat/support`
- Folder related to general classes for support
### Running the Tests
In order to run the tests you can use the `mvn test` commandExamples:
1. Running the LoginTest class using the QA properties:
```
mvn test -Dtest=com.automation.uat.features.login.LoginTest -DQA_ENVIRONMENT=qa
```2. Running the LoginTest class using the QA properties with **only** the tests tagged as "negative":
```
mvn test -Dtest=com.automation.uat.features.login.LoginTest -DQA_ENVIRONMENT=qa -Dgroups="negative"
```3. Running the LoginTest class using the QA properties **excluding** the tests tagged as "negative":
```
mvn test -Dtest=com.automation.uat.features.login.LoginTest -DQA_ENVIRONMENT=qa -DexcludedGroups="negative"
```