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

tests(devtools): sync e2e #15550

Merged
merged 1 commit into from
Oct 18, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ describe('DevTools', function() {

await clickStartButton();

const {target} = getBrowserAndPages();
await target.bringToFront();

const {lhr} = await waitForResult();

const requests = lhr.audits['network-requests'].details.items;
Expand Down Expand Up @@ -126,9 +123,6 @@ describe('DevTools', function() {
await selectCategories(['performance']);
await clickStartButton();

const {target} = getBrowserAndPages();
await target.bringToFront();

const {artifacts} = await waitForResult();
assert.deepStrictEqual(artifacts.ViewportDimensions, {
innerHeight: 823,
Expand Down
14 changes: 2 additions & 12 deletions third-party/devtools-tests/e2e/lighthouse/navigation_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,13 @@ describe('Navigation', async function() {
]);

let numNavigations = 0;
const {target, frontend} = getBrowserAndPages();
const {target} = getBrowserAndPages();
target.on('framenavigated', () => {
++numNavigations;
if (numNavigations === 6) {
void frontend.bringToFront();
}
});

await clickStartButton();

await target.bringToFront();

const {lhr, artifacts, reportEl} = await waitForResult();

// 1 initial about:blank jump
Expand Down Expand Up @@ -194,9 +189,6 @@ describe('Navigation', async function() {

await clickStartButton();

const {target} = getBrowserAndPages();
await target.bringToFront();

const {lhr, reportEl} = await waitForResult();

assert.strictEqual(lhr.configSettings.throttlingMethod, 'devtools');
Expand All @@ -205,6 +197,7 @@ describe('Navigation', async function() {
const flakyAudits = [
'server-response-time',
'render-blocking-resources',
'max-potential-fid',
];

const {auditResults, erroredAudits, failedAudits} = getAuditsBreakdown(lhr, flakyAudits);
Expand Down Expand Up @@ -235,9 +228,6 @@ describe('Navigation', async function() {

await clickStartButton();

const {target} = getBrowserAndPages();
await target.bringToFront();

const {reportEl, lhr, artifacts} = await waitForResult();

const {innerWidth, innerHeight, devicePixelRatio} = artifacts.ViewportDimensions;
Expand Down
2 changes: 0 additions & 2 deletions third-party/devtools-tests/e2e/lighthouse/snapshot_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ describe('Snapshot', async function() {
await selectMode('snapshot');
await clickStartButton();

await target.bringToFront();

const {lhr, artifacts, reportEl} = await waitForResult();

assert.strictEqual(numNavigations, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ describe('The Lighthouse start view', async () => {
assert.strictEqual(helpText, '');
});

it('disables the start button for internal pages', async () => {
// Flaky test.
it.skipOnPlatforms(['mac'], '[crbug.com/1484942]: disables the start button for internal pages', async () => {
await navigateToLighthouseTab();
await goTo('about:blank');

Expand Down
8 changes: 6 additions & 2 deletions third-party/devtools-tests/e2e/lighthouse/timespan_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,16 @@ describe('Timespan', async function() {
await target.click('button');
await target.click('button');

// Wait for content to be painted so that the INP event gets emitted.
// If we don't do this, `frontend.bringToFront()` can disable paints on the target page before INP is emitted.
await target.evaluate(() => {
return new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r)));
});

await frontend.bringToFront();

await endTimespan();

await target.bringToFront();

const {lhr, artifacts, reportEl} = await waitForResult();

assert.strictEqual(numNavigations, 0);
Expand Down
Loading