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

Commit

Permalink
refactor to remove braking change
Browse files Browse the repository at this point in the history
  • Loading branch information
BeroBurny committed Jan 16, 2023
1 parent c148a5c commit b6e89e2
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 19 deletions.
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

0 comments on commit b6e89e2

Please sign in to comment.