Automated acceptance test suite for the Leilão Spring Boot MVC application (Thymeleaf + Spring Security + H2 in-memory database), implemented in Java using Selenium WebDriver, JUnit 5, and the Page Object Model (POM) pattern, with automated headless execution in GitHub Actions.
| Artifact | Purpose | Location |
|---|---|---|
| Test Plan | Acceptance strategy, POM lifecycle, H2 seeding, and CI setup | docs/qa/TEST_PLAN.md |
| Test Case Inventory | 5 automated JUnit + Selenium cases across login & auction flows | docs/qa/TEST_CASES.md |
| BDD Specifications | Gherkin scenarios for authentication, security, and auction forms | specs/features/ |
| Bug & Audit Report | LancesPage route bug, driver decoupling, and coverage gap |
BUG-001 |
.
├── .github/workflows/
│ └── ci.yml # CI: Java 11 + ChromeDriver + Spring Boot + mvn test
├── docs/qa/
│ ├── bug-reports/
│ │ └── BUG-001-driver-management-and-lances-url.md
│ ├── TEST_CASES.md
│ └── TEST_PLAN.md
├── specs/features/
│ ├── leiloes.feature # BDD scenarios for auction creation & validation
│ └── login.feature # BDD scenarios for login & route protection
├── src/
│ ├── main/ # Spring Boot Leilão app (MVC, Spring Security, H2 + data.sql)
│ └── test/java/br/com/alura/leilao/
│ ├── lances/
│ │ └── LancesPage.java # Bid details Page Object
│ ├── leiloes/
│ │ ├── CadastroLeilaoPage.java # Auction form Page Object & validation checks
│ │ ├── LeiloesPage.java # Auction table Page Object
│ │ └── LeiloesTest.java # Auction registration & Bean Validation tests
│ ├── login/
│ │ ├── LoginPage.java # Authentication Page Object
│ │ └── LoginTest.java # Login, invalid credentials & access control tests
│ └── PageObject.java # Base WebDriver lifecycle, timeouts & headless ChromeOptions
└── pom.xml
- Shared
PageObjectLifecycle:PageObject.javacentralizes browser instantiation,5simplicit wait /10spage-load timeouts, headless Chrome flags (-Dheadless=trueorCI=true), and session hand-off between pages while preserving Spring Security session cookies. - Spring Security & Form Validation Coverage: Verifies restricted route redirects (
/leiloes/2->/login), invalid login feedback (/login?error), and server-side Bean Validation messages (minimo 3 caracteres,não deve estar em branco,deve ser um valor maior de 0.1,deve ser uma data no formato dd/MM/yyyy). - Self-Contained In-Memory Database: Uses H2 (
create-drop) seeded on startup viadata.sql(fulano/pass), requiring no external database setup.
- Java 11+ (Selenium
4.27.0with Spring Boot2.3.1.RELEASE) - Apache Maven 3.6+
- Google Chrome + matching
chromedriveronPATH(or passed via-Dwebdriver.chrome.binary/-Dwebdriver.chrome.driver)
mvn spring-boot:runIn a second terminal:
# Run with visible browser
mvn test
# Run in headless mode
mvn test -Dheadless=trueWorkflow ci.yml executes on every push and pull_request to main:
- Configures Java 11 (Temurin) with Maven caching and installs Chrome
131+ matched ChromeDriver viabrowser-actions/setup-chrome@v2. - Compiles main and test sources (
mvn -B test-compile). - Boots the Spring Boot application on port
8080withspring-devtoolslive-restart disabled (SPRING_DEVTOOLS_RESTART_ENABLED=false) and pollsGET /loginreadiness. - Runs
mvn -B test -Dheadless=truepassing-Dwebdriver.chrome.binaryand-Dwebdriver.chrome.driver, archivingtarget/surefire-reports/for 14 days.
Luis Fernando Brandão
QA Automation Engineer