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
│ ├─ FUNDING.yml
│ └─ 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
│ │ ├─ BaseData.java
│ │ ├─ LoginData.java
│ │ └─ ProductsData.java
│ ├─ factory
│ │ ├─ BasePageFactory.java
│ │ └─ BrowserFactory.java
│ ├─ ui
│ │ ├─ component
│ │ │ ├─ BaseComponent.java
│ │ │ ├─ Header.java
│ │ │ └─ SideNavMenu.java
│ │ └─ page
│ │ ├─ BasePage.java
│ │ ├─ LoginPage.java
│ │ └─ ProductsPage.java
│ └─ util
│ └─ BrowserManager.java
└─ test
├─ java
│ └─ io
│ └─ github
│ └─ tahanima
│ ├─ annotation
│ │ ├─ DataSource.java
│ │ ├─ Regression.java
│ │ ├─ Smoke.java
│ │ └─ Validation.java
│ ├─ e2e
│ │ ├─ BaseE2ETest.java
│ │ ├─ LoginE2ETest.java
│ │ └─ ProductsE2ETest.java
│ └─ util
│ ├─ CsvToPOJOMapper.java
│ └─ DataArgumentsProvider.java
└─ resources
├─ allure.properties
├─ config.properties
├─ junit-platform.properties
└─ testdata
├─ login.csv
└─ products.csv