se-data-driven-designer
Designs data-driven Selenium tests with TestNG @DataProvider (or Excel/CSV/JSON sources), covering valid, invalid, and boundary data sets. Use when an SDET says "make this test data-driven", "add a @DataProvider", "parameterize this login test", "read test data from CSV/Excel/JSON", or wants coverage across many inputs. Produces test scaffolding and data the engineer must run and review.
- License 许可
- MIT
- 最近更新
- 2026-07-15
- Stars
- ★ 4
- Forks
- 8
01 前言 Front Matter
- name
- se-data-driven-designer
- license
- MIT
- metadata
- { "pack": "selenium", "author": "TheTestingAcademy", "version": "1.0.0" }
- description
- Designs data-driven Selenium tests with TestNG @DataProvider (or Excel/CSV/JSON sources), covering valid, invalid, and boundary data sets. Use when an SDET says "make this test data-driven", "add a @DataProvider", "parameterize this login test", "read test data from CSV/Excel/JSON", or wants coverage across many inputs. Produces test scaffolding and data the engineer must run and review.
03 SKILL.md 正文
Selenium Data-Driven Designer
You design data-driven tests and the data sets that feed them — covering valid, invalid, and boundary inputs. The tests and data are drafts the engineer must run and review; you do not know the app's real validation rules.
When to use
- A single test should run across many input combinations.
- Someone asks to "parameterize" a test or read inputs from CSV/Excel/JSON.
- Coverage gaps exist around invalid, empty, boundary, or malformed inputs.
Workflow
- Identify the varying inputs and the expected outcome per row (this is the contract — pass/fail/error message).
- Design equivalence classes: valid (happy path), invalid (wrong format, wrong creds), and boundary (min/max length, empty, whitespace, unicode, off-by-one).
- Pick a data source:
@DataProviderfor small inline sets; CSV/JSON/Excel (Apache POI / Jackson / OpenCSV) when volume or non-devs own the data. - Build the provider returning
Object[][]or an iterator; keep expected outcome in the data so assertions are data-driven, not hardcoded. - Write one parameterized
@Testconsuming the provider; assert against the row's expected result. Flag inputs whose expected outcome you had to assume. - Emit the provider + test and list the boundary cases you added for review.
Output shape
@DataProvider(name = "loginData")
public Object[][] loginData() {
return new Object[][] {
// username, password, expectedOutcome (assumptions — confirm real rules)
{ "valid@x.io", "Correct1!", "success" }, // valid
{ "valid@x.io", "wrong", "error" }, // invalid password
{ "", "Correct1!", "error" }, // boundary: empty username
{ "a".repeat(256), "Correct1!", "error" }, // boundary: over-length
};
}
@Test(dataProvider = "loginData")
public void loginScenarios(String user, String pass, String expected) {
LoginPage page = new LoginPage(driver);
page.loginAs(user, pass); // page object supplies the real locators
if (expected.equals("success"))
Assert.assertTrue(new DashboardPage(driver).isLoaded(), "Expected login to succeed for: " + user);
else
Assert.assertTrue(page.isErrorShown(), "Expected an error for input: " + user);
}
Guardrails
- The tests and data are drafts the engineer must run and review — you have not confirmed the app's actual validation behavior.
- Never assume a locator exists; drive interactions through page objects and flag any locator you couldn't confirm.
- Don't fabricate expected outcomes as fact — mark assumed pass/fail results for the engineer to verify against real rules.
- Keep the expected result inside the data row so assertions stay data-driven, not hardcoded per case.
- Externalize large or PII-like data to files; don't hardcode real credentials in source.
- Cover invalid and boundary classes, not just the happy path — that's where data-driven testing earns its keep.
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.