/robot-automation:write-robot-codefrom robot-automation
Use when writing, refactoring, or modifying Robot Framework E2E test code with the Browser library. Covers creating `.robot` suites from TC-ID specs, converting browser exploration results to executable keywords, refactoring locators or resources, adding network mocking via `Route`, test data setup with RequestsLibrary, `docs/qa/conventions.yaml` adherence, smoke-first implementation, auth patterns, and parallel-safe isolation for `pabot`. Triggers: "write a Robot test for", "add a Robot test case", "refactor this locator", "add error path tests", "convert specs to .robot code", "add network mocking in Robot", "set up auth for Robot tests". NOT for: full pipeline from scratch (use add-robot-tests), shared live-site exploration (use capture-feature-evidence), generating specs without code (use plan-test-coverage or generate-test-cases), diagnosing flaky tests (use fix-flaky-tests).
Ships in robot-automation. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write, refactor, or fix Robot Framework E2E tests using the Browser library. Convert browser exploration results or test case specifications into executable, stable .robot suites.
Parse the test description or spec file path from: $ARGUMENTS
docs/qa/conventions.yaml first if it exists. Validate it against plugins/robot-automation/schemas/conventions.schema.json and treat it as the source of truth for locator style, resource pattern, auth strategy, tag vocabulary, and parallel mode.docs/qa/conventions.yaml does not exist and the project already has Robot code, stop and run analyze-test-codebase first.robot.toml, pyproject.toml, requirements*.txt, __init__.robot, and CI scripts to confirm robotframework-browser is installed and extract outputdir, default tags, listeners, and retry configtests/**/*.robot and resources under resources/**/*.resource.robot files to match the project's naming, structure, locator style, and keyword granularityvariables.py, stored browser state, RequestsLibrary session helpers, and existing auth/resource patternsdocs/qa/exploration-report.md when selector evidence or observed flow behavior matterscapture-feature-evidence before writing codefind or get_element to confirm they resolve to the intended elementsGet Element By Role button name=SubmitGet Element By Label EmailGet Element By Placeholder SearchGet Element By Test Id submittext=Welcome, css=.legacy-selector, xpath=..., or id=username only when the project convention or DOM requires a prefixed engineconventions.yaml says css_first, keep using that dialect in the file. If it says get_element_by_role_first, prefer the Get Element By * family and locator variables.resources/ first when needed.robot files in parallel. Pass each subagent the spec path, conventions, and the operating principles from this skill.Sleep calls with Wait For Elements State, Promise To Wait For Response, or Browser-library retrying assertionsparent= or >> scoping, not >> nth=0Promise To + action + Wait For# WHY: commentrobot -d results tests/<feature>.robot 2>&1robot -d results -t "TC-LOGIN-001*" tests/login.robot--variable HEADLESS:true or keep headless as the defaultHEADLESS=False only during local interactive debuggingresults/log.html and results/report.htmlfix-flaky-tests.Return:
Assert what appears on the page: visible text, URL changes, enabled or disabled states, presence or absence, counts, and successful backend-driven state changes. Do not assert CSS classes or component internals.
SleepAvoid Sleep except as a temporary debug aid that is removed before completion.
| Priority | Method | When to Use |
|---|---|---|
| 1 | Get Element By Role button name=Submit | Buttons, links, headings, form controls with accessible roles |
| 2 | Get Element By Label Email | Form fields with visible labels |
| 3 | Get Element By Placeholder Search | Inputs identified by placeholder |
| 4 | Get Element By Test Id submit | Stable test IDs |
| 5 | text=Welcome or text=/welcome/i | Short, stable text |
| 6 | css=..., xpath=..., id=... | Last resort, always scoped tightly and matched to project convention |
Avoid fake selector-engine prefixes such as role=, label=, placeholder=, alt=, title=, or testid=. Those are not the canonical Browser-library dialect this skill should teach.
Prefer parent scoping over positional selection:
${dialog}= Get Element By Role dialog name=Confirm delete
${submit}= Get Element By Role button name=Submit parent=${dialog}
Click ${submit}
Wait For Elements State <locator> <state> for explicit readiness${promise}= Promise To Wait For Response matcher=**/api/items timeout=10s
Click ${submit_button}
${resp}= Wait For ${promise}
TC-<FEATURE>-<NNN> ID[Documentation] and [Tags]resources/, reuse it instead of duplicating inline keywordspabot, assert on the specific entity you created, not on list position or global countGet Text ${alert} == Invalid emailGet Element States ${submit_button} *= enabledGet Url contains /dashboard${BASE_URL} and relative navigationtracing=retain-on-failure, run_on_failure, and stable context config where the project supports themSuite Teardown Close Browser or rely on auto_closing_level=SUITEUse persisted browser state for most projects. Use per-test login only when testing the login flow itself. Use separate contexts for multi-role tests. Never hardcode tokens.
See references/auth-patterns.md.
Use RequestsLibrary to seed and clean up data whenever the UI flow itself is not under test.
See references/api-setup-teardown.md.
Use Route URL to mock server errors, patch responses, assert backend calls, or block heavy resources.
See references/network-interception.md.
When converting journey specs or exploration results to .robot code, use the mapping tables as the canonical translation guide.
See references/mapping-tables.md.
*** Settings ***
Documentation Login feature E2E suite
Resource ../resources/common.resource
Resource ../resources/login.resource
Suite Setup Open Browser To Base URL
Suite Teardown Close Browser
Test Tags login smoke
*** Variables ***
${VALID_EMAIL} [email protected]
${VALID_PASSWORD} %{TEST_USER_PASSWORD}
*** Test Cases ***
TC-LOGIN-001 User can log in with valid credentials
[Documentation] Happy path login redirects to dashboard.
[Tags] TC-LOGIN-001 critical
Go To ${BASE_URL}/login
${email}= Get Element By Label Email
${password}= Get Element By Label Password
${submit}= Get Element By Role button name=Sign in
Fill Text ${email} ${VALID_EMAIL}
Fill Secret ${password} $VALID_PASSWORD
${promise}= Promise To Wait For Response matcher=**/api/session timeout=10s
Click ${submit}
${resp}= Wait For ${promise}
Get Url contains /dashboard
${welcome}= Get Element By Role heading name=Welcome
Get Text ${welcome} contains Welcome
Always check for project resources before importing directly. If custom resources exist, import them so the tests use the project's real setup and conventions.
role= or label=Sleep>> nth=0Run Keyword And Ignore Error hiding assertion failuresforce=True on actions without justificationWait For Response instead of Promise Toagents/claude.yaml (opens in a new tab)agents/openai.yaml (opens in a new tab)references/anti-patterns.md (opens in a new tab)references/api-setup-teardown.md (opens in a new tab)references/auth-patterns.md (opens in a new tab)references/mapping-tables.md (opens in a new tab)references/network-interception.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
6 skills in this plugin
/add-robot-testsTHE DEFAULT ENTRY POINT for the Robot Framework execution layer in the split testing suite. Use to add, create, or set up Robot Framework end-to-end tests for a feature, page, or application. It orchestrates the Robot-specific workflow after shared exploration and planning: analyze the `.robot` codebase, consume `docs/qa/feature-map.md`, `docs/qa/exploration-report.md`, `docs/qa/coverage-plan.md`, and `docs/qa/test-cases/*.md`, write production-grade `.robot` suites, review them, and verify them with real execution. Delegates to `analyze-test-codebase`, `write-robot-code`, `review-test-code`, and `fix-flaky-tests`, while relying on shared `map-feature-scope`, `capture-feature-evidence`, `plan-test-coverage`, `generate-test-cases`, and `review-test-cases`.
/analyze-test-codebaseUse to inspect an existing Robot Framework + Browser library codebase before writing, reviewing, or fixing tests. Covers robot.toml or pyproject config, resource files, keyword libraries, listeners, auth keywords, suite init (`__init__.robot`), tag conventions, directory structure, and emits the typed `docs/qa/conventions.yaml` contract used by downstream skills. Triggers: "understand", "check", "show me", "inspect", or "analyze" the current Robot Framework test setup, config, infrastructure, patterns, or conventions. Does NOT write or fix tests, install Robot Framework, or explore live websites.
npx claudepluginhub lespaceman/athena-workflow-marketplace --plugin robot-automation