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
testrunnersdirectory undersrc/test/resources:java -cp <CLASSPATH> org.testng.TestNG testng.xml
-
Modify the
browservalue within theconfig.propertiesfile to seamlessly switch between browsers (e.g., Chrome, Firefox, WebKit, Chromium, and Edge) and execute your tests. -
To execute the tests, adjust the
headlessvalue within the config directory (src/test/resources) totruefor headless mode orfalsefor 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.