This is a simple Playwright Demo project that automates the Login Feature Test for the OrangeHRM Open Source Test Site.
Test Site URL:
π OrangeHRM Demo Login
This project demonstrates how to automate UI testing for a web application using Playwright with Java and Maven.
Test Scenario:
- Open the web browser and navigate to the login page.
- Enter a valid username and password.
- Click the "Login" button.
- Verify that the user is successfully logged in.
playwrgiht-java-maven-demo
βββ src
β βββ main
β β βββ java
β β β βββ com
β β β β βββ orangehrm
β β β β β βββ data
β β β β β β βββ TestData.java
β β β β β βββ locators
β β β β β β βββ LoginPageLocators.java
β β β β β βββ pages
β β β β β β βββ LoginPage.java
β βββ test
β β βββ java
β β β βββ com
β β β β βββ orangehrm
β β β β β βββ tests
β β β β β β βββ LoginTest.java
βββ pom.xml
βββ .github
β βββ workflows
β β βββ playwright-ci.yml
βββ README.md
- Java 11 or higher
- Maven 3.6 or higher
To build the project, navigate to the project directory and run:
To run the tests, use the following command:
mvn clean test
To run only specific file, use the following command, replace login with the file required:
mvn -Dtest=com.orangehrm.tests.LoginTest test
Generate Test Report
mvn surefire-report:report
Test Report can be accessed in local browser, copy complete path of this file and paste it in the browser
target/site/surefire-report.html
π Github Actions