Skip to content

Commit

Permalink
tests(devtools): sync e2e (#16253)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine authored Dec 12, 2024
1 parent fc50e70 commit 268fcdb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
waitFor,
waitForElementWithTextContent,
} from '../../shared/helper.js';

import {
clickStartButton,
getAuditsBreakdown,
Expand Down
15 changes: 13 additions & 2 deletions third-party/devtools-tests/e2e/lighthouse/start-view_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import {assert} from 'chai';

import {goTo, goToResource, waitFor} from '../../shared/helper.js';

import {
clearSiteData,
getHelpText,
isGenerateReportButtonDisabled,
navigateToLighthouseTab,
selectCategories,
selectMode,
waitForStorageUsage,
} from '../helpers/lighthouse-helpers.js';

Expand Down Expand Up @@ -47,7 +47,7 @@ describe('The Lighthouse start view', () => {
assert.strictEqual(helpText, '');
});

it('disables the start button for internal pages', async () => {
it('disables the start button for internal pages in navigation mode', async () => {
await navigateToLighthouseTab();
await goTo('about:blank');

Expand All @@ -57,6 +57,17 @@ describe('The Lighthouse start view', () => {
assert.strictEqual(helpText, 'Can only audit pages on HTTP or HTTPS. Navigate to a different page.');
});

it('disables the start button for internal pages in non-navigation mode', async () => {
await navigateToLighthouseTab();
await goTo('about:blank');
await selectMode('timespan');

const disabled = await isGenerateReportButtonDisabled();
const helpText = await getHelpText();
assert.isFalse(disabled, 'The Generate Report button should be enabled');
assert.strictEqual(helpText, '');
});

// Broken on non-debug runs
it.skip('[crbug.com/1057948] shows generate report button even when navigating to an unreachable page', async () => {
await navigateToLighthouseTab('empty.html');
Expand Down

0 comments on commit 268fcdb

Please sign in to comment.