Skip to content

Commit 66c3c45

Browse files
Harden Firefox CI tests for runner variability
- Increase SPA navigation wait to 30s and Mocha timeout to 75s - Fix racy import validation: set value directly instead of keystroke- by-keystroke setValue, which caused async validations to race - Add retries: Navigation tests (2, live github.com), global (1, CI) - Add cross-platform visual tolerance comment for Navigation describe Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1688b25 commit 66c3c45

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

tests/firefox/extension.spec.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,21 @@ describe('Popup', function () {
200200

201201
await browser.url(popupUrl());
202202
await waitForPopupLoaded();
203-
// Ensure the seeded bookmark is rendered before testing import duplicate detection
204203
await $('.issue-item').waitForDisplayed({ timeout: 10000 });
205204

206205
const importBtn = await $('#import-btn');
207206
await importBtn.click();
208207

208+
// Set value directly and dispatch a single input event, rather than using
209+
// setValue which types character-by-character. Each keystroke triggers async
210+
// validation — on slow runners, a validation for partial text can resolve
211+
// after the final one, producing "1 invalid" instead of "1 duplicate".
209212
const textarea = await $('#import-textarea');
210-
await textarea.setValue(`- ${issueUrl(TEST_ISSUES[0])}`);
213+
const pasteText = `- ${issueUrl(TEST_ISSUES[0])}`;
214+
await browser.execute(function (el, text) {
215+
el.value = text;
216+
el.dispatchEvent(new Event('input', { bubbles: true }));
217+
}, textarea, pasteText);
211218
await browser.pause(500);
212219

213220
const validation = await $('#import-validation');
@@ -401,6 +408,7 @@ describe('Options', function () {
401408

402409
describe('Navigation', function () {
403410
this.timeout(30000);
411+
this.retries(2);
404412

405413
const bookmarkSelector = '[data-extension-bookmark]';
406414
const headerActionsSelector = '[data-component="PH_Actions"]';
@@ -430,9 +438,9 @@ describe('Navigation', function () {
430438
await issueLink.waitForDisplayed({ timeout: 10000 });
431439
await issueLink.click();
432440

433-
// Wait for issue page header actions
441+
// Wait for issue page header actions (30s: GitHub SPA can be slow on CI)
434442
const headerActions = await $(headerActionsSelector);
435-
await headerActions.waitForDisplayed({ timeout: 15000 });
443+
await headerActions.waitForDisplayed({ timeout: 30000 });
436444

437445
const bookmarkButton = await $(`${headerActionsSelector} ${bookmarkSelector}`);
438446
await bookmarkButton.waitForDisplayed({ timeout: 10000 });
@@ -454,9 +462,9 @@ describe('Navigation', function () {
454462
await issueLink.waitForDisplayed({ timeout: 10000 });
455463
await issueLink.click();
456464

457-
// Wait for issue page header actions
465+
// Wait for issue page header actions (30s: GitHub SPA can be slow on CI)
458466
const headerActions = await $(headerActionsSelector);
459-
await headerActions.waitForDisplayed({ timeout: 15000 });
467+
await headerActions.waitForDisplayed({ timeout: 30000 });
460468

461469
const bookmarkButton = await $(`${headerActionsSelector} ${bookmarkSelector}`);
462470
await bookmarkButton.waitForDisplayed({ timeout: 10000 });

wdio.conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ export const config = {
5656
reporters: ['spec'],
5757
mochaOpts: {
5858
ui: 'bdd',
59-
timeout: 15000,
59+
timeout: 75000,
60+
retries: process.env.CI ? 1 : 0,
6061
},
6162

6263
// Install the extension via installAddOn() in the before hook rather than

0 commit comments

Comments
 (0)