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

core(replay): fix stringify extension #14297

Merged
merged 1 commit into from
Aug 16, 2022
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
12 changes: 5 additions & 7 deletions core/fraggle-rock/replay/stringify-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ class LighthouseStringifyExtension extends PuppeteerReplay.PuppeteerStringifyExt

await super.beforeAllSteps(out, flow);

const configContext = {
settingsOverrides: {
screenEmulation: {
disabled: true,
},
const flags = {
screenEmulation: {
disabled: true,
},
};
out.appendLine(`const configContext = ${JSON.stringify(configContext)}`);
out.appendLine(`const flags = ${JSON.stringify(flags)}`);
if (isMobile) {
out.appendLine(`const config = undefined;`);
} else {
Expand All @@ -54,7 +52,7 @@ class LighthouseStringifyExtension extends PuppeteerReplay.PuppeteerStringifyExt

out.appendLine(`const lhApi = await import('lighthouse/core/fraggle-rock/api.js');`);
// eslint-disable-next-line max-len
out.appendLine(`const lhFlow = await lhApi.startFlow(page, {name: ${JSON.stringify(flow.title)}, config, configContext});`);
out.appendLine(`const lhFlow = await lhApi.startFlow(page, {name: ${JSON.stringify(flow.title)}, config, flags});`);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const puppeteer = require('puppeteer'); // v13.0.0 or later
const timeout = 5000;
page.setDefaultTimeout(timeout);

const configContext = {\\"settingsOverrides\\":{\\"screenEmulation\\":{\\"disabled\\":true}}}
const flags = {\\"screenEmulation\\":{\\"disabled\\":true}}
const config = undefined;
const lhApi = await import('lighthouse/core/fraggle-rock/api.js');
const lhFlow = await lhApi.startFlow(page, {name: \\"Test Flow\\", config, configContext});
const lhFlow = await lhApi.startFlow(page, {name: \\"Test Flow\\", config, flags});
{
const targetPage = page;
await targetPage.setViewport({\\"width\\":757,\\"height\\":988})
Expand Down Expand Up @@ -65,10 +65,10 @@ const puppeteer = require('puppeteer'); // v13.0.0 or later
const timeout = 5000;
page.setDefaultTimeout(timeout);

const configContext = {\\"settingsOverrides\\":{\\"screenEmulation\\":{\\"disabled\\":true}}}
const flags = {\\"screenEmulation\\":{\\"disabled\\":true}}
const config = undefined;
const lhApi = await import('lighthouse/core/fraggle-rock/api.js');
const lhFlow = await lhApi.startFlow(page, {name: \\"Test Flow\\", config, configContext});
const lhFlow = await lhApi.startFlow(page, {name: \\"Test Flow\\", config, flags});
{
const targetPage = page;
await targetPage.setViewport({\\"width\\":757,\\"height\\":988})
Expand Down Expand Up @@ -111,10 +111,10 @@ const puppeteer = require('puppeteer'); // v13.0.0 or later
const timeout = 5000;
page.setDefaultTimeout(timeout);

const configContext = {\\"settingsOverrides\\":{\\"screenEmulation\\":{\\"disabled\\":true}}}
const flags = {\\"screenEmulation\\":{\\"disabled\\":true}}
const config = undefined;
const lhApi = await import('lighthouse/core/fraggle-rock/api.js');
const lhFlow = await lhApi.startFlow(page, {name: \\"Test Flow\\", config, configContext});
const lhFlow = await lhApi.startFlow(page, {name: \\"Test Flow\\", config, flags});
{
const targetPage = page;
await targetPage.setViewport({\\"width\\":757,\\"height\\":988})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const puppeteer = require('puppeteer'); // v13.0.0 or later
const timeout = 5000;
page.setDefaultTimeout(timeout);

const configContext = {\\"settingsOverrides\\":{\\"screenEmulation\\":{\\"disabled\\":true}}}
const flags = {\\"screenEmulation\\":{\\"disabled\\":true}}
const config = (await import('lighthouse/core/config/desktop-config.js')).default;
const lhApi = await import('lighthouse/core/fraggle-rock/api.js');
const lhFlow = await lhApi.startFlow(page, {name: \\"Test Flow on Desktop\\", config, configContext});
const lhFlow = await lhApi.startFlow(page, {name: \\"Test Flow on Desktop\\", config, flags});
{
const targetPage = page;
await targetPage.setViewport({\\"width\\":757,\\"height\\":988})
Expand Down Expand Up @@ -252,10 +252,10 @@ const puppeteer = require('puppeteer'); // v13.0.0 or later
const timeout = 5000;
page.setDefaultTimeout(timeout);

const configContext = {\\"settingsOverrides\\":{\\"screenEmulation\\":{\\"disabled\\":true}}}
const flags = {\\"screenEmulation\\":{\\"disabled\\":true}}
const config = undefined;
const lhApi = await import('lighthouse/core/fraggle-rock/api.js');
const lhFlow = await lhApi.startFlow(page, {name: \\"Test Flow on Mobile\\", config, configContext});
const lhFlow = await lhApi.startFlow(page, {name: \\"Test Flow on Mobile\\", config, flags});
{
const targetPage = page;
await targetPage.setViewport({\\"width\\":300,\\"height\\":600})
Expand Down