Skip to content

Commit bcfc11b

Browse files
fix(cypress): use retry-able cy.get for audio setup button in stepVideoCheck
The synchronous $body.find() check raced against React rendering — after VideoEquipmentCheck auto-passes, AudioEquipmentCheck needs a render cycle to mount its "Begin audio setup" button. Replace with cy.get() which retries until the button appears (up to 10s). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d2c67ee commit bcfc11b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

cypress/support/sharedSteps.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,11 @@ Cypress.Commands.add(
196196

197197
if (setupMicrophone || setupHeadphones) {
198198
const audioButton = `[data-player-id="${playerKey}"] button[data-test="startAudioSetup"]`;
199-
cy.get("body").then(($body) => {
200-
if ($body.find(audioButton).length > 0) {
201-
cy.get(audioButton).should("be.visible").click();
202-
}
203-
});
199+
// Use cy.get with retry instead of synchronous $body.find(), because
200+
// the audio setup button may not have rendered yet when the video check
201+
// auto-completes (the Cypress window.Cypress shortcut advances the
202+
// intro step, and React needs a render cycle to mount AudioEquipmentCheck).
203+
cy.get(audioButton, { timeout: 10000 }).should("be.visible").click();
204204
}
205205
}
206206
);

0 commit comments

Comments
 (0)