From 00eddf5ba25e5c17f56e6340b56a53234214276d Mon Sep 17 00:00:00 2001 From: Sero <69639595+Seroxdesign@users.noreply.github.com> Date: Mon, 8 Jul 2024 11:45:09 -0400 Subject: [PATCH] route --- wallets/phantom/src/utils/getExtensionPage.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 wallets/phantom/src/utils/getExtensionPage.ts diff --git a/wallets/phantom/src/utils/getExtensionPage.ts b/wallets/phantom/src/utils/getExtensionPage.ts new file mode 100644 index 000000000..816efd0bb --- /dev/null +++ b/wallets/phantom/src/utils/getExtensionPage.ts @@ -0,0 +1,17 @@ +import type { Page } from "@playwright/test"; + +export const getExtensionPage = async (page: Page, extensionId: string, route: string) => { + const extensionHomeUrl = `chrome-extension://${extensionId}/notification.html`; + + const routes: any = { + advanced: `${extensionHomeUrl}#settings/advanced`, + settings: `${extensionHomeUrl}#settings`, + experimental: `${extensionHomeUrl}#settings/experimental`, + addNetwork: `${extensionHomeUrl}#settings/networks/add-network`, + newAccount: `${extensionHomeUrl}#new-account`, + importAccount: `${extensionHomeUrl}#new-account/import`, + importToken: `${extensionHomeUrl}#import-token`, + } + + page.goto(routes[route]) +} \ No newline at end of file