Skip to content
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
2 changes: 1 addition & 1 deletion core/test/devtools-tests/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export LH_ROOT="$SCRIPT_DIR/../../.."

cd "$DEVTOOLS_PATH"

TEST_PATTERN="${1:-test/e2e_non_hosted/lighthouse/*}"
TEST_PATTERN="${1:-test/e2e/lighthouse/*}"

# Don't let console.errors() like 'Unknown VE Context' fail the build
sed -i.bak 's| fatalErrors.push(message);|/*fatalErrors.push(message)*/|' test/conductor/events.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ describe('DevTools', function() {
it('is respected during a lighthouse run', async ({devToolsPage, inspectedPage}) => {
expectErrors();
await blockCss(devToolsPage);
await navigateToLighthouseTab('lighthouse/hello.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'lighthouse/hello.html');

await selectCategories(['performance'], devToolsPage);
await selectCategories(devToolsPage, ['performance']);

await clickStartButton(devToolsPage);

Expand All @@ -94,15 +94,15 @@ describe('DevTools', function() {
it('is restored after a lighthouse run', async ({devToolsPage, inspectedPage}) => {
await openDeviceToolbar(devToolsPage, inspectedPage);
// Use iPad Mini in landscape mode and custom zoom.
await selectDevice('iPad Mini', devToolsPage);
await selectDevice(devToolsPage, 'iPad Mini');
const rotateButton = await devToolsPage.waitForAria('Rotate');
await rotateButton.click();
await selectZoomLevel(devToolsPage, '75%');

assert.deepEqual(await getTargetViewport(inspectedPage), IPAD_MINI_LANDSCAPE_VIEWPORT_DIMENSIONS);

await navigateToLighthouseTab('lighthouse/hello.html', devToolsPage, inspectedPage);
await selectCategories(['performance', 'best-practices'], devToolsPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'lighthouse/hello.html');
await selectCategories(devToolsPage, ['performance', 'best-practices']);
await clickStartButton(devToolsPage);

const {artifacts} = await waitForResult(devToolsPage, inspectedPage);
Expand Down
26 changes: 13 additions & 13 deletions third-party/devtools-tests/e2e/lighthouse/navigation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('Navigation', function() {
devToolsPage.page.on('console', consoleListener);
try {
expectErrors();
await navigateToLighthouseTab('lighthouse/hello.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'lighthouse/hello.html');
await registerServiceWorker(inspectedPage);

await devToolsPage.waitFor('.lighthouse-start-view');
Expand Down Expand Up @@ -136,7 +136,7 @@ describe('Navigation', function() {
});
assert.strictEqual(selectedTabText, 'Performance');

await navigateToLighthouseTab(undefined, devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, undefined);

// Test .lh-node is linkified to Elements panel.
const lcpBreakdownAudit = await devToolsPage.waitForElementWithTextContent('LCP breakdown', reportEl);
Expand Down Expand Up @@ -166,7 +166,7 @@ describe('Navigation', function() {
'a[data-action="save-html"]:not(.hidden)', saveHtmlEl => (saveHtmlEl as HTMLElement).click());

const htmlContent = await waitForHtml();
const iframeHandle = await renderHtmlInIframe(htmlContent, inspectedPage);
const iframeHandle = await renderHtmlInIframe(inspectedPage, htmlContent);
const iframeAuditDivs = await iframeHandle.$$('.lh-audit');
const frontendAuditDivs = await reportEl.$$('.lh-audit');
assert.strictEqual(frontendAuditDivs.length, iframeAuditDivs.length);
Expand All @@ -186,9 +186,9 @@ describe('Navigation', function() {
try {
expectErrors();

await navigateToLighthouseTab('lighthouse/hello.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'lighthouse/hello.html');

await setThrottlingMethod('devtools', devToolsPage);
await setThrottlingMethod(devToolsPage, 'devtools');

await clickStartButton(devToolsPage);

Expand Down Expand Up @@ -230,7 +230,7 @@ describe('Navigation', function() {
try {
expectErrors();

await navigateToLighthouseTab('lighthouse/busy-worker.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'lighthouse/busy-worker.html');

await clickStartButton(devToolsPage);

Expand Down Expand Up @@ -263,9 +263,9 @@ describe('Navigation', function() {
try {
expectErrors();

await navigateToLighthouseTab('lighthouse/protocol-error.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'lighthouse/protocol-error.html');

await selectCategories(['seo'], devToolsPage);
await selectCategories(devToolsPage, ['seo']);

await clickStartButton(devToolsPage);

Expand Down Expand Up @@ -301,12 +301,12 @@ describe('with changed settings', function() {
devToolsPage.page.on('console', consoleListener);
try {
expectErrors();
await navigateToLighthouseTab('lighthouse/hello.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'lighthouse/hello.html');
await registerServiceWorker(inspectedPage);
await setToolbarCheckboxWithText(true, 'Habilitar muestreo de JS', devToolsPage);
await setToolbarCheckboxWithText(false, 'Borrar almacenamiento', devToolsPage);
await selectCategories(['performance', 'best-practices'], devToolsPage);
await selectDevice('desktop', devToolsPage);
await setToolbarCheckboxWithText(devToolsPage, true, 'Habilitar muestreo de JS');
await setToolbarCheckboxWithText(devToolsPage, false, 'Borrar almacenamiento');
await selectCategories(devToolsPage, ['performance', 'best-practices']);
await selectDevice(devToolsPage, 'desktop');

await clickStartButton(devToolsPage);

Expand Down
4 changes: 2 additions & 2 deletions third-party/devtools-tests/e2e/lighthouse/snapshot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Snapshot', function() {
expectError(/Protocol Error: the message with wrong session id/);
expectError(/Protocol Error: the message with wrong session id/);

await navigateToLighthouseTab('lighthouse/hello.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'lighthouse/hello.html');
await registerServiceWorker(inspectedPage);

await inspectedPage.evaluate(() => {
Expand All @@ -51,7 +51,7 @@ describe('Snapshot', function() {
let numNavigations = 0;
inspectedPage.page.on('framenavigated', () => ++numNavigations);

await selectMode('snapshot', devToolsPage);
await selectMode(devToolsPage, 'snapshot');
await clickStartButton(devToolsPage);

const {lhr, artifacts, reportEl} = await waitForResult(devToolsPage, inspectedPage);
Expand Down
22 changes: 11 additions & 11 deletions third-party/devtools-tests/e2e/lighthouse/start-view.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('The Lighthouse start view', () => {
setup({dockingMode: 'undocked'});

it('shows a button to generate a new report', async ({devToolsPage, inspectedPage}) => {
await navigateToLighthouseTab('empty.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'empty.html');

const disabled = await isGenerateReportButtonDisabled(devToolsPage);
const helpText = await getHelpText(devToolsPage);
Expand All @@ -28,9 +28,9 @@ describe('The Lighthouse start view', () => {
});

it('disables the start button when no categories are selected', async ({devToolsPage, inspectedPage}) => {
await navigateToLighthouseTab('empty.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'empty.html');

await selectCategories([], devToolsPage);
await selectCategories(devToolsPage, []);

const disabled = await isGenerateReportButtonDisabled(devToolsPage);
const helpText = await getHelpText(devToolsPage);
Expand All @@ -39,9 +39,9 @@ describe('The Lighthouse start view', () => {
});

it('enables the start button if only one category is selected', async ({devToolsPage, inspectedPage}) => {
await navigateToLighthouseTab('empty.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'empty.html');

await selectCategories(['performance'], devToolsPage);
await selectCategories(devToolsPage, ['performance']);

const disabled = await isGenerateReportButtonDisabled(devToolsPage);
const helpText = await getHelpText(devToolsPage);
Expand All @@ -50,7 +50,7 @@ describe('The Lighthouse start view', () => {
});

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

const disabled = await isGenerateReportButtonDisabled(devToolsPage);
Expand All @@ -60,9 +60,9 @@ describe('The Lighthouse start view', () => {
});

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

const disabled = await isGenerateReportButtonDisabled(devToolsPage);
const helpText = await getHelpText(devToolsPage);
Expand All @@ -72,7 +72,7 @@ describe('The Lighthouse start view', () => {

it('shows generate report button even when navigating to an unreachable page',
async ({devToolsPage, inspectedPage}) => {
await navigateToLighthouseTab('empty.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'empty.html');

await inspectedPage.goToResource('network/unreachable.rawresponse');
const disabled = await isGenerateReportButtonDisabled(devToolsPage);
Expand All @@ -83,13 +83,13 @@ describe('The Lighthouse start view', () => {
// e2e tests in application/ create indexeddb items and don't clean up after themselves
await clearSiteData(devToolsPage, inspectedPage);

await navigateToLighthouseTab('empty.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'empty.html');

let warningElem = await devToolsPage.waitFor('.lighthouse-warning-text.hidden');
const warningText1 = await warningElem.evaluate(node => node.textContent?.trim());
assert.strictEqual(warningText1, '');

await navigateToLighthouseTab('lighthouse/lighthouse-storage.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'lighthouse/lighthouse-storage.html');
// Wait for storage state to lazily update
await waitForStorageUsage(quota => quota > 0, devToolsPage);

Expand Down
8 changes: 4 additions & 4 deletions third-party/devtools-tests/e2e/lighthouse/timespan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ describe('Timespan', function() {
it('successfully returns a Lighthouse report for user interactions', async ({devToolsPage, inspectedPage}) => {
expectErrors();

await navigateToLighthouseTab('lighthouse/hello.html', devToolsPage, inspectedPage);
await navigateToLighthouseTab(devToolsPage, inspectedPage, 'lighthouse/hello.html');
await registerServiceWorker(inspectedPage);

// https://bugs.chromium.org/p/chromium/issues/detail?id=1364257
await selectDevice('desktop', devToolsPage);
await selectDevice(devToolsPage, 'desktop');

await selectMode('timespan', devToolsPage);
await setThrottlingMethod('simulate', devToolsPage);
await selectMode(devToolsPage, 'timespan');
await setThrottlingMethod(devToolsPage, 'simulate');

let numNavigations = 0;
inspectedPage.page.on('framenavigated', () => ++numNavigations);
Expand Down
Loading