Fix/stablize Robot test infrastructure with data-testid selectors#154
Merged
tanner37 merged 2 commits intoJul 24, 2026
Merged
Conversation
Replace brittle positional selectors (input >> nth=7, input >> nth=8) with stable data-testid attributes on the Sign and Vestaboard form inputs and submit buttons. - SignForm: data-testid='sign-and-vestaboard-input' / 'sign-and-vestaboard-submit' - VestaboardForm: data-testid='vestaboard-only-input' / 'vestaboard-only-submit' - Update PublicMessagingPage.resource selectors accordingly Co-Authored-By: GAIA Code <noreply@gaiacode.pro>
- Add data-testid='home-stats-section' to Home.js stats div for stable
page-ready detection instead of text-coupled selectors
- Fix Wait Until Spaceport Page Ready to use data-testid selector
- Replace Page Should Contain Text body-dump with Wait For Elements State
scoped assertions throughout Common.resource and LandingPage.resource
- Fix Charts Link Should Navigate to use has-text() instead of bare
text=[charts] which has CSS metacharacter ambiguity
- Default HEADLESS to True so CI works without a display server;
developers override with -v HEADLESS:False
- Move VALID_PASSWORD to env-var pattern (%{TEST_PASSWORD=...}) so
credentials are never committed to source
- Fix Test Teardown in smoke.robot to fire only on failure and use
${TEST NAME} for unique per-test screenshot filenames
- Add setup.sh to chain pip install + rfbrowser init in one step
Co-Authored-By: GAIA Code <noreply@gaiacode.pro>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problems
PublicMessagingPage.resourceused positionalselectors (
nth=7,nth=8,text=Submit >> nth=0/1) that break on any DOM change.Wait Until Spaceport Page Readywaited fortext=Protospace Stats, tying test startup to a string that could change.Page Should Contain Textdid a full body dump — the keyword grabbed all bodytext and used
Should Contain, which never waits; assertions could pass beforecontent finished rendering.
text=[charts]passes[charts]as a CSSattribute selector to Playwright, not a text match.
HEADLESSdefaulted toFalse— CI environments have no display server;tests would fail or require an Xvfb wrapper.
VALID_PASSWORDcommitted in source — credentials should come from environmentvariables.
Test Teardown Capture Debug Artifact smokefired unconditionally on every test and always wrote the same filename,leaving only the last screenshot.
pip installand
rfbrowser initseparately.Solution
Add
data-testidattributes to stable DOM landmarks in the React source, then updateall Robot selectors and infrastructure keywords to use them.
Changes
webclient/src/Sign.jsSignForm— addeddata-testid='sign-and-vestaboard-input'/data-testid='sign-and-vestaboard-submit'VestaboardForm— addeddata-testid='vestaboard-only-input'/data-testid='vestaboard-only-submit'webclient/src/Home.js<div data-testid="home-stats-section">for astable page-ready anchor
tests/robot/pages/PublicMessagingPage.resourcenth=andtext=Submit >> nth=selectors with[data-testid="..."]CSS attribute selectorstests/robot/pages/LandingPage.resourceCharts Link Should Navigateto usea:has-text("[charts]")(Playwright CSS)instead of
text=[charts](ambiguous CSS attribute selector)tests/robot/resources/Common.resourceWait Until Spaceport Page Ready— now waits on[data-testid="home-stats-section"]instead of a text string
Page Should Contain Text— replaced body dump +Should ContainwithWait For Elements State ... visibleso assertions properly wait for the elementtests/robot/resources/Variables.resourceHEADLESS→${True}(CI-safe default; developers override with-v HEADLESS:False)VALID_PASSWORD→%{TEST_PASSWORD=TestPass123!}(env-var with fallback)tests/robot/tests/smoke.robotTest Teardown→Run Keyword If Test Failed Capture Debug Artifact ${TEST NAME}— screenshots now fire only on failure and use the test name for unique filenames
tests/robot/setup.sh(new)pip install -r requirements.txt+rfbrowser init