-
-
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.
Playwright - AddNewAccount & RenameAccount
- Loading branch information
Showing
8 changed files
with
83 additions
and
72 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
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,23 @@ | ||
import { testWithSynpress } from '@synthetixio/synpress-core' | ||
import { Phantom, phantomFixtures } from '../../../src/playwright' | ||
|
||
import basicSetup from '../wallet-setup/basic.setup' | ||
|
||
const test = testWithSynpress(phantomFixtures(basicSetup)) | ||
|
||
const { expect } = test | ||
|
||
test('should add a new account with specified name', async ({ context, phantomPage }) => { | ||
const phantom = new Phantom(context, phantomPage, basicSetup.walletPassword) | ||
|
||
const accountName = 'Test Account' | ||
await phantom.addNewAccount(accountName) | ||
|
||
await expect(phantomPage.locator(phantom.homePage.selectors.accountMenu.accountName)).toHaveText(accountName) | ||
}) | ||
|
||
test('should throw an error if an empty account name is passed', async ({ context, phantomPage }) => { | ||
const phantom = new Phantom(context, phantomPage, basicSetup.walletPassword) | ||
|
||
await expect(phantom.addNewAccount('')).rejects.toThrowError('[AddNewAccount] Account name cannot be an empty string') | ||
}) |
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,19 @@ | ||
import { testWithSynpress } from '@synthetixio/synpress-core' | ||
import { Phantom, phantomFixtures } from '../../../src/playwright' | ||
|
||
import basicSetup from '../wallet-setup/basic.setup' | ||
|
||
const test = testWithSynpress(phantomFixtures(basicSetup)) | ||
|
||
const { expect } = test | ||
|
||
test('should rename current account with specified name', async ({ context, phantomPage }) => { | ||
const phantom = new Phantom(context, phantomPage, basicSetup.walletPassword) | ||
|
||
const accountName = 'Test Account' | ||
await phantom.renameAccount('Account 1', accountName) | ||
|
||
await phantomPage.reload() | ||
|
||
await expect(phantomPage.locator(phantom.homePage.selectors.accountMenu.accountName)).toHaveText(accountName) | ||
}) |