- Build Tool: Gradle (using
build.gradle) - Language: Java 17+
- Browser Automation Library: Playwright
- Architecture: Data-driven test automation using POM to model and reuse web page functionality.
- Base Package:
io.github.tahanima - Test Runner: JUnit 5 with custom annotations (
@TestDataSource,@Validation,@Smoke,@Regression).
- Pages:
src/main/java/io/github/tahanima/ui/page/– Encapsulate low-level page actions and locators. - Components:
src/main/java/io/github/tahanima/ui/component/– Reusable UI elements (Header, SideNav, etc.). - TestData POJOs:
src/main/java/io/github/tahanima/testdata/– Business logic layer that interprets CSV data and interacts with Pages. - Tests:
src/test/java/io/github/tahanima/e2e/– High-level orchestration; must extendBaseTest. - Test Data Files:
src/test/resources/testdata/– CSV files for data-driven inputs. - Utilities:
BrowserManager.java– Browser lifecycle management.CsvLoader.java– CSV loading for test data.
- Factories:
BasePageFactory.java– Centralized page initialization.BrowserFactory.java– Abstracts browser setup and creation.
- Reporting:
AllureManager.java– Custom logging, screenshots, and test reporting.
- Instantiation: Do not use
new LoginPage(). Always use theBasePageFactoryto initialize pages. - Logic Placement:
- Pages/Components: Handle locators and atomic actions (e.g.,
typeUsername). - TestData POJOs: Handle business workflows (e.g.,
loginWith(LoginTestData data)). - Tests: Handle assertions and test flow. Minimal direct Playwright API calls here.
- Pages/Components: Handle locators and atomic actions (e.g.,
- Stability & Waits:
- No Hard Sleeps: Never use
Thread.sleep(). Rely on Playwright’s auto-waiting orpage.waitForCondition(). - Web-First Assertions: Use
PlaywrightAssertions.assertThat()for UI states to enable automatic retries.
- No Hard Sleeps: Never use
- Configuration: Use
ConfigurationManagerto accessconfig.properties. Do not hardcode URLs or credentials. - Data Loading: Use the custom
@TestDataSourceannotation for CSV data-driven tests. - Naming Conventions:
- Pages →
*Page.java - Components →
*Component.java - Test Data POJOs →
*TestData.java(must extendBaseTestData).
- Pages →
page.getByRole()(Prioritize accessibility-first selectors).page.getByLabel()/page.getByPlaceholder().page.getByTestId()(Use whendata-testidattributes are available).- CSS/XPath (Use only as a last resort for complex structural selectors).
- CSV files →
TestDataArgumentsProvider→ Test method parameters → Test execution. - POJOs (
testdatapackage) represent structured test data for readability and business logic reuse.
- Run all tests:
./gradlew clean test - Run a specific test class:
./gradlew test --tests *LoginTest - Generate Allure report:
./gradlew allureServe
- code-reviewer:
- Trigger: When providing new code or asking for architectural feedback.
- Focus: Enforcing layer separation (Page vs. TestData vs. E2E) and checking Factory usage.
- healing-agent:
- Trigger: When reporting a
TimeoutError, broken locator, or execution failure. - Focus: Converting brittle selectors to the "Locator Strategy" priority list above.
- Trigger: When reporting a
- Skill Activation: If a task matches the triggers above, ask for permission to load the skill using
/skills load <name>. - Contextual Awareness: Before proposing code changes, refer to
src/main/resources/config.propertiesfor environment-specific settings.