Skip to content

Commit

Permalink
Only apply Firefox workarounds in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tunetheweb committed May 13, 2024
1 parent 9d1d10a commit a957d49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/e2e/onFCP-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {stubVisibilityChange} from '../utils/stubVisibilityChange.js';
const originalStrictEqual = assert.strictEqual;
assert.strictEqual = function (actual, expected, message) {
if (
process.env.GITHUB_ACTIONS &&
browser.capabilities.browserName === 'firefox' &&
(expected === 'good' || expected === 'needs-improvement') &&
actual !== expected
Expand Down
6 changes: 5 additions & 1 deletion test/e2e/onLCP-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {stubVisibilityChange} from '../utils/stubVisibilityChange.js';
const originalStrictEqual = assert.strictEqual;
assert.strictEqual = function (actual, expected, message) {
if (
process.env.GITHUB_ACTIONS &&
browser.capabilities.browserName === 'firefox' &&
(expected === 'good' || expected === 'needs-improvement') &&
actual !== expected
Expand Down Expand Up @@ -717,7 +718,10 @@ const assertFullReportsAreCorrect = (beacons) => {

// Temp fix to address Firefox flakiness.
// See https://github.com/GoogleChrome/web-vitals/issues/472
if (browser.capabilities.browserName !== 'firefox') {
if (
!process.env.GITHUB_ACTIONS &&
browser.capabilities.browserName == 'firefox'
) {
assert(lcp1.value < 500); // Less than the image load delay.
}
assert(lcp1.id.match(/^v4-\d+-\d+$/));
Expand Down

0 comments on commit a957d49

Please sign in to comment.