-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00eddf5
commit 769d933
Showing
13 changed files
with
138 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
wallets/phantom/src/pages/HomePage/actions/disconnectFromApp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { Page } from "@playwright/test"; | ||
import { getNotificationPageAndWaitForLoad } from "../../../utils/getNotificationAndWaitForLoads"; | ||
import { homePageElements } from "../selectors"; | ||
|
||
export const disconnectFromApp = async (page: Page, extensionId: string) => { | ||
const notificationPage = await getNotificationPageAndWaitForLoad(page.context(), extensionId) | ||
|
||
await notificationPage.click(homePageElements.settingsMenu.settingsMenuButton) | ||
await notificationPage.click(homePageElements.settingsMenu.settingsSidebarButton) | ||
await notificationPage.click(homePageElements.settingsMenu.trustedAppsRow) | ||
|
||
const rowButtonLocator = await notificationPage.locator(homePageElements.connectedSites.rowButton) | ||
const hasConnectedSite = await rowButtonLocator.isVisible(); | ||
|
||
let isDisconnected = false; | ||
if (hasConnectedSite) { | ||
await rowButtonLocator.click() | ||
await notificationPage.click(homePageElements.connectedSites.trustedAppsRevokeButton) | ||
isDisconnected = true | ||
} | ||
else { | ||
console.log( | ||
'[disconnectWalletFromDapp] Wallet is not connected to a dapp, skipping...', | ||
); | ||
} | ||
|
||
return isDisconnected; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './changeAccount' | ||
export * from './closePopupAndTooltips' | ||
export * from './getWalletAddress' | ||
export * from './disconnectFromApp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './importAccount' | ||
export * from './createAccount' | ||
export * from './createAccount' | ||
export * from './unlock' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from './selectors/loading' | ||
export * from './constants' | ||
export * from './selectors/loading' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { testWithSynpress } from '@synthetixio/synpress-core' | ||
import { phantomFixtures } from '../src' | ||
import importPhantom from './wallet-setup/import-wallet.setup' | ||
import importPhantom from './wallet-setup/import.setup' | ||
|
||
export default testWithSynpress(phantomFixtures(importPhantom)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters