-
-
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.
Phantom - Functions updates and more tests
- Loading branch information
Showing
29 changed files
with
256 additions
and
245 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
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
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
30 changes: 1 addition & 29 deletions
30
wallets/phantom/src/playwright/pages/HomePage/actions/switchNetwork.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 |
---|---|---|
@@ -1,39 +1,11 @@ | ||
import type { Page } from '@playwright/test' | ||
import Selectors from '../../../../selectors/pages/HomePage' | ||
import { allTextContents } from '../../../utils/allTextContents' | ||
import { closeRecoveryPhraseReminder } from './popups' | ||
|
||
async function openTestnetSection(page: Page) { | ||
export async function openTestnetSection(page: Page) { | ||
const toggleButtonLocator = page.locator(Selectors.networkDropdown.showTestNetworksToggle) | ||
const classes = await toggleButtonLocator.getAttribute('class') | ||
if (classes?.includes('toggle-button--off')) { | ||
await toggleButtonLocator.click() | ||
await page.locator(Selectors.networkDropdown.toggleOn).isChecked() | ||
} | ||
} | ||
|
||
export async function switchNetwork(page: Page, networkName: string, includeTestNetworks: boolean) { | ||
await page.locator(Selectors.networkDropdown.dropdownButton).click() | ||
|
||
if (includeTestNetworks) { | ||
await openTestnetSection(page) | ||
} | ||
|
||
const networkLocators = await page.locator(Selectors.networkDropdown.networks).all() | ||
const networkNames = await allTextContents(networkLocators) | ||
|
||
const seekedNetworkNameIndex = networkNames.findIndex( | ||
(name) => name.toLocaleLowerCase() === networkName.toLocaleLowerCase() | ||
) | ||
|
||
const seekedNetworkLocator = seekedNetworkNameIndex >= 0 && networkLocators[seekedNetworkNameIndex] | ||
|
||
if (!seekedNetworkLocator) { | ||
throw new Error(`[SwitchNetwork] Network with name ${networkName} not found`) | ||
} | ||
|
||
await seekedNetworkLocator.click() | ||
|
||
// TODO: This is not really needed if we do `phantom.toggleDismissSecretRecoveryPhraseReminder()` by default. Figure this out! | ||
await closeRecoveryPhraseReminder(page) | ||
} |
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
40 changes: 7 additions & 33 deletions
40
wallets/phantom/src/playwright/pages/NotificationPage/actions/connectToDapp.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
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
7 changes: 0 additions & 7 deletions
7
wallets/phantom/src/playwright/pages/SettingsPage/actions/disableEthSign.ts
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
wallets/phantom/src/playwright/pages/SettingsPage/actions/enableEthSign.ts
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
wallets/phantom/src/playwright/pages/SettingsPage/actions/index.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.