MarketSquare / MarketSquare/robotframework-browser
Add `Get Accessible Property` keyword to assert accessible name, description, role and error message
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 655
- Forks
- 147
- Avg merge
- 5h 27m
- Merged PRs (30d)
- 59
Description
Use case
Accessibility testing is a mainstream requirement now, but the library has no way to check what assistive technologies actually see for a single element. Playwright ships four dedicated assertions for this — accessible name, accessible description, ARIA role and accessible error message — and none of them has a getter equivalent in Browser library today.
The current situation for users:
Get Aria Snapshotexposes role/name of a whole subtree in YAML, which is awkward and brittle when you only want to check one element's computed accessible name.- Computed accessible description and accessible error message (from
aria-describedby/aria-errormessage) are not reachable at all — the accname algorithm (label elements,aria-labelledbychains, alt text, etc.) is far too complex to reimplement in a hand-writtenEvaluate JavaScriptsnippet.
A single assertion-engine getter with a property selector covers all four checks with auto-retry (Set Retry Assertions For), following the library's established getter idiom.
Proposed keyword / arguments
Get Accessible Property selector property=name assertion_operator=None assertion_expected=None message=None
| Argument | Description |
|---|---|
selector |
Element selector, strict mode applies. |
property |
Enum: name (default), description, role, errormessage. |
assertion_operator / assertion_expected / message |
Standard assertion-engine arguments with auto-retry. |
Returns the computed value as a string (empty string when the property is not set).
*** Test Cases ***
Accessible Properties
Get Accessible Property id=submit name == Submit form
Get Accessible Property id=avatar description contains profile picture
Get Accessible Property css=.primary-action role == button
Fill Text id=email not-an-email
Blur id=email
Get Accessible Property id=email errormessage == Please enter a valid e-mail address
${name} = Get Accessible Property id=logo name
Playwright API
Covers the getter side of four LocatorAssertions:
The wrapper can reuse the same accname computation Playwright's expect uses (injected aria utils in playwright-core), so results match Playwright assertions exactly.
Implementation notes
protobuf/playwright.proto: new request message carrying selector + property enum (or reuse an existing selector/property request shape) and a string-response RPC.node/playwright-wrapper: resolve the locator, compute the requested accessible property via Playwright's injected aria utilities.Browser/keywords/getters.py: new keyword with@with_assertion_polling, tagsGetter, Assertion, PageContent; newAccessiblePropertyenum in the types module.- Docs +
inv buildstub regen, atest cases against the test app (labelled inputs,aria-describedby,aria-errormessage, implicit/explicit roles).
Backwards compatibility
Purely additive: a new keyword, no changes to any existing keyword or return value.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with protobuf/playwright.proto, node/playwright-wrapper, and Browser/keywords/getters.py to trace existing getter and assertion-polling patterns. Review the types module, documentation, and inv build stub regeneration, then run or add atest cases for labelled inputs, aria-describedby, aria-errormessage, and implicit or explicit roles. Done means the keyword returns or asserts all four accessible properties with retry support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, playwright, python
- Domain
- accessibility, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100