Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

chore: refactor to remove braking change #242

Merged
merged 1 commit into from
Jan 16, 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
18 changes: 1 addition & 17 deletions src/setup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,7 @@ export const bootstrap = async ({
browser: DappeteerBrowser;
metaMaskPage: DappeteerPage;
}> => {
const browser = await launch({
headless: true,
playwrightOptions: {
args: ["--accept-lang=en"],
},
puppeteerOptions: {
args: ["--accept-lang=en"],
},
...launchOptions,
});
const browser = await launch(launchOptions);
const metaMask = await setupMetaMask(browser, {
seed,
password,
Expand All @@ -52,13 +43,6 @@ export const initSnapEnv = async (
snapId: string;
}> => {
const browser = await launch({
headless: true,
playwrightOptions: {
args: ["--accept-lang=en"],
},
puppeteerOptions: {
args: ["--accept-lang=en"],
},
...opts,
metaMaskFlask: true,
});
Expand Down
2 changes: 1 addition & 1 deletion src/setup/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export async function launch(
`
);

console.warn(); // new line
console.log(); // new line

metamaskPath = await downloader(metaMaskVersion, {
location: metaMaskLocation,
Expand Down
1 change: 1 addition & 0 deletions src/setup/playwright.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export async function launchPlaywright(
...(options.playwrightOptions ?? {}),
headless: options.headless,
args: [
"--accept-lang=en",
`--disable-extensions-except=${metamaskPath}`,
`--load-extension=${metamaskPath}`,
...(options.playwrightOptions?.args || []),
Expand Down
1 change: 1 addition & 0 deletions src/setup/puppeteer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export async function launchPuppeteer(
...(options.puppeteerOptions ?? {}),
headless: options.headless,
args: [
"--accept-lang=en",
`--disable-extensions-except=${metamaskPath}`,
`--load-extension=${metamaskPath}`,
...(options.puppeteerOptions?.args || []),
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type DappeteerLaunchOptions = {
//fallbacks to installed dependency and prefers playwright if both are installed
automation?: "puppeteer" | "playwright";
browser: "chrome";
headless?: boolean; // default true
headless?: boolean; // default false
puppeteerOptions?: Parameters<typeof puppeteerLaunch>[0];
playwrightOptions?: PlaywrightLaunchOptions;
};
Expand Down
1 change: 1 addition & 0 deletions test/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const mochaHooks = {
automation:
(process.env.AUTOMATION as "puppeteer" | "playwright") ?? "puppeteer",
browser: "chrome",
headless: true,
metaMaskVersion:
process.env.METAMASK_VERSION || dappeteer.RECOMMENDED_METAMASK_VERSION,
});
Expand Down
1 change: 1 addition & 0 deletions test/global_flask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const mochaHooks = {
automation:
(process.env.AUTOMATION as "puppeteer" | "playwright") ?? "puppeteer",
browser: "chrome",
headless: true,
metaMaskVersion:
process.env.METAMASK_VERSION || dappeteer.RECOMMENDED_METAMASK_VERSION,
metaMaskFlask: true,
Expand Down