This is a sample playwright(v1.40.0) project with POM design pattern. This readme provides a step-by-step guide to set up and execute tests using powerful combination of playwright, java and TestNG.
Before runnig the tests, ensure that you have following:
- Java Development Kit (JDK)
- Any IDE such as JetBrains Aqua, IntelliJ, or Eclipse.
-
Clone this repository by running the following command:
git clone https://github.com/alphabin1/playwright-sample cd Playwright_Java
-
Run the TestNG file located within the
testrunners
directory undersrc/test/resources
:java -cp <CLASSPATH> org.testng.TestNG testng.xml
-
Modify the
browser
value within theconfig.properties
file to seamlessly switch between browsers (e.g., Chrome, Firefox, WebKit, Chromium, and Edge) and execute your tests. -
To execute the tests, adjust the
headless
value within the config directory (src/test/resources
) totrue
for headless mode orfalse
for the standard mode.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.