Skip to content

ZaafirDar/LoginPlaywrightDemoJavaMaven

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Playwright Demo with Java Maven

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

πŸ“Œ Project Overview

This project demonstrates how to automate UI testing for a web application using Playwright with Java and Maven.

Test Scenario:

  1. Open the web browser and navigate to the login page.
  2. Enter a valid username and password.
  3. Click the "Login" button.
  4. Verify that the user is successfully logged in.

πŸ“‚ Project Structure

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

Requirements

  • Java 11 or higher
  • Maven 3.6 or higher

Building the Project

To build the project, navigate to the project directory and run:

Running Tests locally

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

Test Execution on GithubActions CI/CD pipline

πŸ”— Github Actions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages