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 #14995

Merged
merged 1 commit into from
Apr 19, 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
79 changes: 40 additions & 39 deletions third-party/devtools-tests/e2e/lighthouse/navigation_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,45 +199,46 @@ describe.skipOnParallel('Navigation', async function() {
assert.strictEqual(await getServiceWorkerCount(), 0);
});

// [crbug.com/1427407] Flaky in legacy mode
if (mode !== 'legacy') {
it('successfully returns a Lighthouse report with DevTools throttling', async () => {
await navigateToLighthouseTab('lighthouse/hello.html');

await setThrottlingMethod('devtools');
await setLegacyNavigation(mode === 'legacy');

await clickStartButton();

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

assert.strictEqual(lhr.configSettings.throttlingMethod, 'devtools');

// [crbug.com/1347220] DevTools throttling can force resources to load slow enough for these audits to fail sometimes.
const flakyAudits = [
'server-response-time',
'render-blocking-resources',
];

const {auditResults, erroredAudits, failedAudits} = getAuditsBreakdown(lhr, flakyAudits);
assert.strictEqual(auditResults.length, 150);
assert.deepStrictEqual(erroredAudits, []);
assert.deepStrictEqual(failedAudits.map(audit => audit.id), [
'service-worker',
'installable-manifest',
'splash-screen',
'themed-omnibox',
'maskable-icon',
'document-title',
'html-has-lang',
'meta-description',
'bf-cache',
]);

const viewTraceButton = await $textContent('View Trace', reportEl);
assert.ok(viewTraceButton);
});
}
it('successfully returns a Lighthouse report with DevTools throttling', async () => {
// [crbug.com/1427407] Flaky in legacy mode
if (mode === 'legacy') {
return;
}
await navigateToLighthouseTab('lighthouse/hello.html');

await setThrottlingMethod('devtools');
await setLegacyNavigation(mode === 'legacy');

await clickStartButton();

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

assert.strictEqual(lhr.configSettings.throttlingMethod, 'devtools');

// [crbug.com/1347220] DevTools throttling can force resources to load slow enough for these audits to fail sometimes.
const flakyAudits = [
'server-response-time',
'render-blocking-resources',
];

const {auditResults, erroredAudits, failedAudits} = getAuditsBreakdown(lhr, flakyAudits);
assert.strictEqual(auditResults.length, 150);
assert.deepStrictEqual(erroredAudits, []);
assert.deepStrictEqual(failedAudits.map(audit => audit.id), [
'service-worker',
'installable-manifest',
'splash-screen',
'themed-omnibox',
'maskable-icon',
'document-title',
'html-has-lang',
'meta-description',
'bf-cache',
]);

const viewTraceButton = await $textContent('View Trace', reportEl);
assert.ok(viewTraceButton);
});

it('successfully returns a Lighthouse report when settings changed', async () => {
await setDevToolsSettings({language: 'es'});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ describe.skipOnParallel('The Lighthouse start view', async () => {
const disabled = await isGenerateReportButtonDisabled();
const helpText = await getHelpText();
assert.isTrue(disabled, 'The Generate Report button should be disabled');
assert.strictEqual(
helpText,
'Can only audit HTTP/HTTPS pages and Chrome extensions. Navigate to a different page to start an audit.');
assert.strictEqual(helpText, 'Can only audit pages on HTTP or HTTPS. Navigate to a different page.');
});

// Broken on non-debug runs
Expand Down