se-framework-scaffolder
Scaffolds a Maven Selenium framework — TestNG suite, base test, Page Object package, config loader, logging, and reporting hooks. Use when an SDET says "scaffold a Selenium framework", "set up a new Maven Selenium project", "give me a POM/TestNG project structure", or is starting automation from zero. Produces a starter layout and files the engineer must build, run, and adapt.
- License 许可
- MIT
- 最近更新
- 2026-07-15
- Stars
- ★ 4
- Forks
- 8
01 前言 Front Matter
- name
- se-framework-scaffolder
- license
- MIT
- metadata
- { "pack": "selenium", "author": "TheTestingAcademy", "version": "1.0.0" }
- description
- Scaffolds a Maven Selenium framework — TestNG suite, base test, Page Object package, config loader, logging, and reporting hooks. Use when an SDET says "scaffold a Selenium framework", "set up a new Maven Selenium project", "give me a POM/TestNG project structure", or is starting automation from zero. Produces a starter layout and files the engineer must build, run, and adapt.
03 SKILL.md 正文
Selenium Framework Scaffolder
You lay out a Maven + Selenium + TestNG framework skeleton. Everything you emit
is a starter the engineer must build (mvn test), run, and adapt — it is not a
finished framework.
When to use
- A new project needs a repeatable structure instead of ad-hoc test files.
- Someone asks for "the standard Selenium framework layout" or "a base test + POM setup".
- An existing suite needs restructuring into layers (config, pages, tests, utils).
Workflow
- Define the module layout:
pom.xml,src/test/javawith packagesbase,pages,tests,utils,config, andsrc/test/resourcesfortestng.xml,config.properties,log4j2.xml. - Pin dependencies in
pom.xml:selenium-java,testng, a logger (Log4j2/SLF4J), and a reporter hook (Allure/ExtentReports) — state versions must be confirmed current. - Write
BaseTest: driver lifecycle via aDriverFactory(ThreadLocal), config load in@BeforeMethod,quitin@AfterMethod. - Add config loading: a
ConfigReaderoverconfig.properties(baseUrl, browser, timeouts) with system-property overrides for CI. - Add logging + reporting hooks: a TestNG
ITestListenerfor start/pass/fail and screenshot-on-failure. - Emit the tree + key files, then list what the engineer must fill in (real URLs, pages).
Output shape
selenium-framework/
├── pom.xml # selenium-java, testng, log4j2, allure/extent
├── testng.xml # suite: parallel + thread-count
└── src/test/
├── java/com/qa/
│ ├── base/BaseTest.java # driver up/down + config
│ ├── config/ConfigReader.java
│ ├── pages/ # Page Objects
│ ├── tests/ # @Test classes extending BaseTest
│ └── listeners/TestListener.java # ITestListener: log + screenshot on fail
└── resources/
├── config.properties # baseUrl, browser, timeout
└── log4j2.xml
public abstract class BaseTest {
protected WebDriver driver;
@BeforeMethod
public void setUp() {
driver = DriverFactory.getDriver();
driver.get(ConfigReader.get("baseUrl")); // TODO: set real baseUrl in config.properties
}
@AfterMethod
public void tearDown() { DriverFactory.quitDriver(); }
}
Guardrails
- This is a starter the engineer must build, run, and adapt —
mvn teston the raw skeleton proves structure, not passing tests. - Never assume a locator exists; scaffolded page classes ship with
// TODOlocators, not fabricated selectors. - Do not invent dependency versions as current — tell the engineer to confirm the latest compatible
selenium-java/testng. - Keep layers separated: no locators in tests, no assertions in pages, no config strings hardcoded.
- Wire driver management through a ThreadLocal factory so the suite is parallel-ready.
- Don't fabricate a baseUrl or credentials — leave them as config the engineer supplies.
04 同仓库更多 Skills
se-wait-fixer
Scans Selenium Java code for Thread.sleep and for implicit+explicit wait mixing, then replaces them with WebDriverWait/ExpectedConditions or FluentWait to fix synchronization. Use when an SDET says "remove Thread.sleep from my tests", "fix the flaky waits", "my implicit and explicit waits conflict", or pastes code full of hard sleeps. Produces refactors the engineer must run and confirm.
se-test-generator
Generates a runnable Selenium 4 + TestNG test in Java from a plain-language scenario, using explicit waits and stable locators. Use when an SDET says "write a Selenium test for login", "generate a TestNG test for the checkout flow", "automate this scenario in Selenium", or pastes Gherkin/steps and wants Java WebDriver code. Produces a draft test the engineer must review and run.
se-report-integrator
Integrates reporting (Allure or ExtentReports) into a Selenium + TestNG suite with listeners, screenshot-on-failure, and step logging. Use when an SDET says "add Allure to my tests", "set up ExtentReports", "capture a screenshot on failure", "add a TestNG listener for reporting", or wants readable run reports. Produces listener and config code the engineer must run to generate a report.
se-page-object-builder
Builds a Page Object Model class in Java (PageFactory @FindBy or explicit locators) with action methods and a WebDriverWait for a given page. Use when an SDET says "create a page object for the login page", "build a POM class", "refactor these locators into a page object", or pastes a page's fields and wants a reusable POM. Produces a draft class the engineer must review and run.
se-locator-strategist
Recommends and repairs Selenium locator strategy — replaces brittle absolute XPath with By.id, By.cssSelector, or Selenium 4 relative locators, and explains the trade-offs. Use when an SDET says "this XPath keeps breaking", "make this locator more stable", "why is my locator flaky", "convert this XPath to CSS", or pastes selectors to harden. Produces proposals the engineer must verify in the DOM.
se-grid-configurator
Configures Selenium Grid 4 (hub-and-node or standalone, including Docker) and wires RemoteWebDriver for parallel and distributed runs. Use when an SDET says "set up Selenium Grid", "run my tests on a remote grid", "dockerize Selenium Grid 4", "point my tests at RemoteWebDriver", or wants parallel execution across nodes. Produces config and code the engineer must run and validate in their environment.