Skip to content

Don't use problematic selectors#8

Merged
qi-imbue merged 6 commits into
mainfrom
hynek/dont-use-problematic-selectors
Feb 4, 2026
Merged

Don't use problematic selectors#8
qi-imbue merged 6 commits into
mainfrom
hynek/dont-use-problematic-selectors

Conversation

@hynek-urban

Copy link
Copy Markdown
Collaborator
  • Make sure none of the selectors are locale-dependent.
  • Add a style guideline to hopefully avoid this in the future.
  • Make the generated app names a little more informative (date is now included).
  • And fix a bug related to github login detection. (Turns out the old logic sometimes misfired due to github returning http 200 and yet showing a sudo page.)

…n e8bfe2ed)

A number of services generate random Latchkey- prefixed app names when necessary. Move this to a central place (a single reused function), probably in playwrightUtils.ts.
hynek@\~/gi/projects/latchkey$ latchkey login dropbox

node:internal/process/promises:394

    triggerUncaughtException(err, true /\* fromPromise \*/);

    ^

locator.waitFor: Error: strict mode violation: locator('//\*[@id="create-button"]') resolved to 3 elements:

    1) <button type="submit" id="create-button" class="button-primary">Create app</button> aka getByRole('button', { name: 'Create app' })

    2) <button id="create-button" disabled="disabled" class="button-primary">Send email for verification</button> aka getByText('Send email for verification')

    3) <button id="create-button" disabled="disabled" class="button-primary">Resend verification email</button> aka getByText('Resend verification email')

Call log:

- waiting for locator('//\*[@id="create-button"]') to be visible

    at DropboxServiceSession.performBrowserFollowup (/home/hynek/gi/projects/latchkey/dist/src/services/dropbox.js:52:28)

    at async file:///home/hynek/gi/projects/latchkey/dist/src/services/base.js:76:34

    at async withTempBrowserContext (/home/hynek/gi/projects/latchkey/dist/src/playwrightUtils.js:44:24)

    at async Command.<anonymous> (/home/hynek/gi/projects/latchkey/dist/src/cliCommands.js:253:36)

Node.js v24.13.0
@qi-imbue qi-imbue assigned hynek-urban and unassigned qi-imbue Feb 4, 2026
@qi-imbue qi-imbue self-requested a review February 4, 2026 19:05
@qi-imbue qi-imbue merged commit bebe786 into main Feb 4, 2026
1 check passed
@hynek-urban hynek-urban deleted the hynek/dont-use-problematic-selectors branch March 4, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants