Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: android@* passing with LT #1067

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions tests/util/basic-checks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */
import {notFirefox, notIE, notIOS, notSafari, onlyIE} from "../../tools/browser-matcher/common-matchers.mjs";
import {onlyAndroid, onlyIE, supportsFirstPaint, supportsFirstContentfulPaint} from "../../tools/browser-matcher/common-matchers.mjs";

export const baseQuery = expect.objectContaining({
a: expect.any(String),
Expand Down Expand Up @@ -286,7 +286,7 @@ export function checkSpa ({ query, body }, { trigger } = {}) {

const interaction = body.find(b => b.type === 'interaction')
expect(interaction).toBeDefined()
expect(interaction).toMatchObject({
expect(interaction).toEqual(expect.objectContaining({
type: "interaction",
children: expect.any(Array),
start: expect.any(Number),
Expand All @@ -300,8 +300,14 @@ export function checkSpa ({ query, body }, { trigger } = {}) {
category: expect.any(String),
id: expect.any(String),
nodeId: expect.any(String),
firstPaint: browserMatch([notIE, notSafari, notIOS, notFirefox]) && (!trigger || trigger === 'initialPageLoad') ? expect.any(Number) : null,
firstContentfulPaint: browserMatch(notIE) && (!trigger || trigger === 'initialPageLoad') ? expect.any(Number) : null,
navTiming: expect.any(Object)
})
}))
// *cli Jun'24 - LambdaTest's Android Chrome arbitrarily have paint timing in spa tests checking IPL depending on some race condition.
// Sometimes they are present (Number) and sometimes not (null). It's too unreliable for tests so their check is excluded.
if (!browserMatch(onlyAndroid)) {
expect(interaction).toEqual(expect.objectContaining({
firstPaint: browserMatch(supportsFirstPaint) && (!trigger || trigger === 'initialPageLoad') ? expect.any(Number) : null,
firstContentfulPaint: browserMatch(supportsFirstContentfulPaint) && (!trigger || trigger === 'initialPageLoad') ? expect.any(Number) : null
}))
}
}
14 changes: 7 additions & 7 deletions tools/browser-matcher/common-matchers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const onlyAndroid = new SpecMatcher()
export const onlyChromium = new SpecMatcher()
.include('chrome')
.include('edge')
.include('android>9.0')
.include('android>=9.0')

export const onlyFirefox = new SpecMatcher()
.include('firefox')
Expand All @@ -109,17 +109,17 @@ export const supportsBFCache = new SpecMatcher()
// .include('edge>=89') -- not enabled by default still (current v109); user must set flag
.include('firefox')
.include('ios')
// .include('android>9.0') -- does not work on android 9.0 emulator (v100 Chrome) for unknown precise reason;
.include('android>=9.0') // -- does not work on android 9.0 emulator (v100 Chrome) for unknown precise reason;

export const supportsFirstPaint = new SpecMatcher()
.include('chrome>=60')
.include('edge>=79')
// .include('android>9.0') -- LT simulated chromium android does not appear to support PerformancePaintTiming
// .include('android>=9.0') -- LT simulated chromium android does not appear to support PerformancePaintTiming

export const supportsFirstContentfulPaint = new SpecMatcher()
.include('chrome>=60')
.include('edge>=79')
// .include('android>9.0') -- LT simulated chromium android does not appear to support PerformancePaintTiming
// .include('android>=9.0') -- LT simulated chromium android does not appear to support PerformancePaintTiming
.include('firefox>=84')
.include('safari>15') // this should be >= 14.1 but safari 15 on Sauce hates FCP, and it destroys the other tests on the same thread too...
.include('ios>=14.5') // -- *cli Mar'23 - FYI there's a bug associated with paint observer for version < 16, see ios-version.js
Expand All @@ -128,17 +128,17 @@ export const supportsFirstInputDelay = new SpecMatcher()
.include('chrome>=76')
.include('edge>=79')
.include('firefox>=89')
.include('android>9.0')
.include('android>=9.0')

export const supportsLargestContentfulPaint = new SpecMatcher()
.include('chrome>=77')
.include('edge>=79')
.include('android>9.0')
.include('android>=9.0')

export const supportsInteractionToNextPaint = new SpecMatcher()
.include('chrome>=96')
.include('edge>=96')
.include('android>9.0')
.include('android>=9.0')

export const supportsLongTaskTiming = new SpecMatcher()
.include('chrome>=58')
Expand Down
Loading