Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
matstyler committed Feb 5, 2024
1 parent 0f2f55e commit 4d2d348
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
16 changes: 8 additions & 8 deletions examples/new-dawn/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defineConfig, devices } from '@playwright/test';
import { defineConfig, devices } from "@playwright/test";

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
// Look for test files in the "test/e2e" directory, relative to this configuration file.
testDir: './test/e2e',
testDir: "./test/e2e",

// Run all tests in parallel.
fullyParallel: true,
Expand All @@ -15,21 +15,21 @@ export default defineConfig({

use: {
// We are using locally deployed MetaMask Test Dapp.
baseURL: 'http://localhost:9999',
baseURL: "http://localhost:9999",
},

// Synpress currently only supports Chromium, however, this will change in the future.
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] }
}
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],

// Serve MetaMask Test Dapp locally before starting the tests.
webServer: {
command: 'pnpm run serve:test-dapp',
url: 'http://localhost:9999',
command: "pnpm run serve:test-dapp",
url: "http://localhost:9999",
reuseExistingServer: true,
},
});
28 changes: 16 additions & 12 deletions examples/new-dawn/test/wallet-setup/connected.setup.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
import { MetaMask, defineWalletSetup, getExtensionId } from '@synthetixio/synpress'
import 'dotenv/config'
import {
MetaMask,
defineWalletSetup,
getExtensionId,
} from "@synthetixio/synpress";
import "dotenv/config";

const SEED_PHRASE = process.env.SEED_PHRASE
const PASSWORD = process.env.WALLET_PASSWORD
const SEED_PHRASE = process.env.SEED_PHRASE;
const PASSWORD = process.env.WALLET_PASSWORD;

export default defineWalletSetup(PASSWORD, async (context, walletPage) => {
// This is a workaround for the fact that the MetaMask extension ID changes.
// This workaround won't be needed in the near future! 😁
const extensionId = await getExtensionId(context, 'MetaMask')
const extensionId = await getExtensionId(context, "MetaMask");

const metamask = new MetaMask(context, walletPage, PASSWORD, extensionId)
const metamask = new MetaMask(context, walletPage, PASSWORD, extensionId);

await metamask.importWallet(SEED_PHRASE)
await metamask.importWallet(SEED_PHRASE);

const page = await context.newPage()
const page = await context.newPage();

// Go to a locally hosted MetaMask Test Dapp.
await page.goto('http://localhost:9999')
await page.goto("http://localhost:9999");

await page.locator('#connectButton').click()
await page.locator("#connectButton").click();

await metamask.connectToDapp()
})
await metamask.connectToDapp();
});

0 comments on commit 4d2d348

Please sign in to comment.