Ready-to-use UI Test Automation Architecture using Java and Playwright.
In order to use the framework:
- Fork the repository.
- Clone, i.e, download your copy of the repository to your local machine using
git clone https://github.com/[your_username]/playwright-java-test-automation-architecture.git
- Import the project in IntelliJ IDEA.
- Make your desired changes.
- Use IntelliJ IDEA to run your desired tests. Alternatively, you can use the terminal to run the tests, for example
./gradlew test -Dbrowser=firefox -Dheadless=false
to run all the tests using the firefox browser in headed mode. - Build and browse the allure report using
./gradlew allureServe
The project uses the following:
- Java 11 as the programming language.
- Playwright as the web browser automation framework using the Java binding.
- Univocity Parsers to parse and handle CSV files.
- JUnit 5 as the testing framework.
- Lombok to generate getters.
- Owner to minimize the code to handle properties file.
- Allure Report as the test reporting strategy.
- Gradle as the Java build tool.
- IntelliJ IDEA as the IDE.
The project is structured as follows:
📦 playwright-java-test-automation-architecture
├─ .github
│ └─ workflows
│ └─ test-execution.yml
├─ .gitignore
├─ LICENSE
├─ README.md
├─ build.gradle
├─ gradle
│ └─ wrapper
│ ├─ gradle-wrapper.jar
│ └─ gradle-wrapper.properties
├─ gradlew
├─ gradlew.bat
├─ settings.gradle
└─ src
├─ main
│ └─ java
│ └─ io
│ └─ github
│ └─ tahanima
│ ├─ config
│ │ ├─ Configuration.java
│ │ └─ ConfigurationManager.java
│ ├─ data
│ │ ├─ BaseTestData.java
│ │ └─ login
│ │ └─ LoginTestData.java
│ ├─ page
│ │ ├─ BasePage.java
│ │ ├─ BasePageFactory.java
│ │ ├─ login
│ │ │ └─ LoginPage.java
│ │ └─ product
│ │ └─ ProductsPage.java
│ └─ util
│ ├─ BrowserFactory.java
│ └─ BrowserManager.java
└─ test
├─ java
│ └─ io
│ └─ github
│ └─ tahanima
│ ├─ e2e
│ │ ├─ BaseE2ETest.java
│ │ └─ login
│ │ └─ LoginE2ETest.java
│ └─ util
│ ├─ CsvToPOJOMapper.java
│ ├─ DataArgumentsProvider.java
│ └─ DataSource.java
└─ resources
├─ allure.properties
├─ general.properties
├─ junit-platform.properties
└─ testdata
└─ login
└─ login.csv