This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Selenium Boot is a Java library (JAR) published to Maven Central — an opinionated, zero-boilerplate Selenium automation framework inspired by Spring Boot. Users add it as a single dependency; the framework handles WebDriver lifecycle, waits, retries, reporting, and CI integration automatically.
- GroupId / ArtifactId:
io.github.seleniumboot / selenium-boot - Java: 17+ required
- Build: Maven 3.8+
- Test Framework: TestNG 7.9.0
# Run all unit tests
mvn test
# Full build (compile + test + package)
mvn clean verify
# Install locally for testing with consumer projects
mvn clean install -DskipTests
# Run a single test class
mvn test -Dtest=ConfigurationLoaderTest
# Run a single test method
mvn test -Dtest=ConfigurationLoaderTest#testMethodName
# Run tests against a specific environment profile
mvn test -Denv=staging
# Docs site (Docusaurus) — from docs-site/
npm install
npm run start # dev server
npm run build # production buildNo linter/formatter is enforced. Follow the style of existing code.
The framework is a 4-layer library:
Consumer Test Code (BaseTest / BasePage subclasses, user's test project)
↑
Selenium Boot Core (lifecycle, driver mgmt, waits, retries, reporting)
↑
Infrastructure (config loading, SPI plugin registry, listeners)
↑
Selenium WebDriver (browser automation)
All source lives under src/main/java/com/seleniumboot/. Key packages:
| Package | Role |
|---|---|
test/ |
BaseTest, BasePage, SmartLocator — user-facing base classes |
driver/ |
DriverManager (ThreadLocal), provider registry, Chrome/Firefox/Remote providers |
config/ |
ConfigurationLoader reads selenium-boot.yml; SeleniumBootDefaults supplies fallbacks |
lifecycle/ |
FrameworkBootstrap — wires everything together at suite start |
listeners/ |
TestNG SuiteExecutionListener / TestExecutionListener; @Retryable + RetryListener |
hooks/ |
HookRegistry + ExecutionHook — plugin lifecycle callbacks |
precondition/ |
@PreCondition / @ConditionProvider — session caching (cookies, localStorage) |
wait/ |
WaitEngine — centralised explicit waits, no Thread.sleep() |
reporting/ |
HTML report, JUnit XML, ScreenshotManager, adapter registry |
extension/ |
PluginRegistry + SPI — custom drivers, report adapters, hooks |
ci/ |
CiEnvironmentDetector, BuildThresholdEnforcer — pass-rate gates |
steps/ |
StepLogger, StepRecord — named test steps with screenshots |
junit5/ |
Optional JUnit 5 bridge (BaseJUnit5Test, @EnableSeleniumBoot) |
- Registry + SPI —
DriverProviderRegistry,PluginRegistry,ReportAdapterRegistryuseServiceLoaderfor extensibility. - ThreadLocal driver isolation —
DriverManagerstoresWebDriverper thread; safe for parallel TestNG execution. - Template Method —
BaseTest/BasePagedefine framework-managed lifecycle; users override hook methods. - Convention over configuration —
selenium-boot.ymlis optional.ConfigurationLoaderfalls back to built-in defaults (browser.name: chrome,execution.mode: local,timeouts.explicit: 10,timeouts.pageLoad: 30) for an absent file (only when no profile / explicit path was requested — those still throw if missing) and for any omitted field listed there (execution.baseUrlhas no default;open()requires it);SeleniumBootDefaultsprogrammatic overrides take precedence over the built-ins. Present-but-invalid values (unknownexecution.mode, negative timeout) still fail validation.
Classes/methods annotated @SeleniumBootApi are the stable public surface. Avoid breaking changes to these without a version bump. Internal packages (classes not annotated) may change freely.
Unit tests are in src/test/java/com/seleniumboot/unit/ (39 test classes, 480 tests). They use TestNG + Mockito. Tests mock Selenium/browser interactions — no real browser is required to run the test suite.
Consumer projects configure via selenium-boot.yml at the project root:
execution:
mode: local | remote
baseUrl: https://example.com
parallel: none | methods | classes | tests | instances
threadCount: 4
browser:
name: chrome | firefox
headless: true | false
lifecycle: per-test | per-suite
retry:
enabled: true
maxAttempts: 2
timeouts:
explicit: 10 # seconds
pageLoad: 30
ci:
failOnPassRateBelow: 80
maxFlakyTests: 3When upgrading the project version, always update all places the version is referenced:
| File | Location |
|---|---|
pom.xml |
<version> tag |
README.md |
Maven dependency snippet + "Current release" line under ## Project Status |
CHANGELOG.md |
New release entry at top |
docs-site/docs/getting-started.md |
Maven dependency snippet |
docs-site/docs/junit5.md |
Maven dependency snippet |
docs-site/docs/changelog.md |
New release entry at top |
docs-site/src/pages/index.js |
Maven dependency snippet in hero section |
PLAN.md |
Released versions table |
Outside this repo — the marketing site ships the version too, so a bump here without a bump there advertises a stale release on seleniumboot.com:
| Repo / File | Location |
|---|---|
seleniumboot/website → src/data/content.ts |
LATEST_VERSION — feeds the copy-to-clipboard Maven snippet in the homepage CTA |
selenium-boot-migrator → Migrator.java |
SELENIUM_BOOT_VERSION — the version migrate writes into users' build files (also asserted in CliTest/MigratorTest, and the README). Was stuck on 3.5.0 until 3.9.0 |
Also add a new changelog entry in CHANGELOG.md and docs-site/docs/changelog.md describing what changed. The full version history lives in CHANGELOG.md (extracted from the README); the README only keeps a one-line "Current release" pointer.
- Update all version references in the in-repo table above.
- Add the
CHANGELOG.md+docs-site/docs/changelog.mdentries. - Commit and push.
- Tag the release commit and push the tag — lightweight tag named
vX.Y.Zon the commit that was published (not later CI/housekeeping commits):Verify afterwards withgit tag v3.1.0 <release-commit> git push origin v3.1.0
git describe --tags(HEAD should resolve to the new tag). - Create the GitHub Release from the tag — a pushed tag does not create a
Release, so the repo's "Releases" page keeps showing the old version until you do:
Verify with
gh release create v3.1.0 --title "v3.1.0 — <summary>" --latest --notes "<changelog>"
gh release list(newest version should show "Latest"). - Publish to Maven Central (
mvn deploy) and finish the manual publish in the Central Portal (see Publishing below). - Last, bump
LATEST_VERSIONin theseleniumboot/websiterepo and push tomain(Actions deploys it). Do this after the artifact is live on Central — the homepage snippet is copy-to-clipboard, so bumping earlier hands visitors apom.xmlthat won't resolve yet.
Maven Central publishing is handled by central-publishing-maven-plugin with GPG signing. The CI workflow (.github/workflows/selenium-boot.yml) runs mvn test. Publishing is a manual step.
GPG key and Maven Central credentials are configured in ~/.m2/settings.xml. To publish:
mvn deployNo extra flags needed — GPG signing and Central Portal upload are handled automatically via the configured settings.