-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TW-459: [e2e] Import account by Mnemonic (#852)
* [e2e] Import account by Mnemonic * env fix * env fix * env fix * env fix * env fix * env fix * TW-459: [e2e] Import account by Mnemonic. Refactor * TW-459: [e2e] Import account by Mnemonic. Refactor * TW-459: [e2e] Import account by Mnemonic. Refactor + CopyButton selector fix --------- Co-authored-by: alex-seleznov <alex.seleznov@gmail.com>
- Loading branch information
Showing
31 changed files
with
301 additions
and
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
DEFAULT_SEED_PHRASE= | ||
DEFAULT_PASSWORD= | ||
DEFAULT_HD_ACCOUNT_PRIVATE_KEY= | ||
SECOND_SEED_PHRASE= | ||
SECOND_SEED_PHRASE_PRIVATE_KEY= |
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,18 @@ | ||
Feature: Import Account by Mnemonic | ||
@dev | ||
Scenario: As a user, I'd like to import account by mnemonic | ||
Given I have imported an existing account | ||
|
||
And I press AccountIcon on the Header page | ||
And I am on the AccountsDropdown page | ||
|
||
And I press ImportAccountButton on the AccountsDropdown page | ||
And I am on the ImportAccountTab page | ||
|
||
And I select Mnemonic tab | ||
And I am on the ImportAccountMnemonic page | ||
|
||
And I enter second mnemonic | ||
And I press Mnemonic Import Button on the Import Account(Mnemonic) page | ||
|
||
Then I reveal a private key and compare with private key of second seed phrase |
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,27 @@ | ||
import { ExploreSelectors } from '../../../../src/app/pages/Explore.selectors'; | ||
import { Page } from '../../classes/page.class'; | ||
import { createPageElement } from '../../utils/search.utils'; | ||
|
||
export class HomePage extends Page { | ||
ReceiveButton = createPageElement(ExploreSelectors.ReceiveButton); | ||
BuyButton = createPageElement(ExploreSelectors.BuyButton); | ||
SendButton = createPageElement(ExploreSelectors.SendButton); | ||
WithdrawButton = createPageElement(ExploreSelectors.WithdrawButton); | ||
SwapButton = createPageElement(ExploreSelectors.SwapButton); | ||
AssetsTab = createPageElement(ExploreSelectors.AssetsTab); | ||
ActivityTab = createPageElement(ExploreSelectors.ActivityTab); | ||
CollectiblesTab = createPageElement(ExploreSelectors.CollectiblesTab); | ||
PublicAddressButton = createPageElement(ExploreSelectors.PublicAddressButton); | ||
|
||
async isVisible() { | ||
await this.ReceiveButton.waitForDisplayed(); | ||
await this.BuyButton.waitForDisplayed(); | ||
await this.SendButton.waitForDisplayed(); | ||
await this.WithdrawButton.waitForDisplayed(); | ||
await this.SwapButton.waitForDisplayed(); | ||
await this.AssetsTab.waitForDisplayed(); | ||
await this.ActivityTab.waitForDisplayed(); | ||
await this.CollectiblesTab.waitForDisplayed(); | ||
await this.PublicAddressButton.waitForDisplayed(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
e2e/src/page-objects/pages/import-account-tabs/import-account-mnemonic-tab.page.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,27 @@ | ||
import { ImportAccountTestIds } from '../../../../../src/app/pages/ImportAccount/ImportAccount.test-ids'; | ||
import { Page } from '../../../classes/page.class'; | ||
import { createPageElement, findElements } from '../../../utils/search.utils'; | ||
|
||
export class ImportAccountMnemonicTab extends Page { | ||
mnemonicWordInput = createPageElement(ImportAccountTestIds.mnemonicWordInput); | ||
mnemonicPasswordField = createPageElement(ImportAccountTestIds.mnemonicPasswordField); | ||
mnemonicImportButton = createPageElement(ImportAccountTestIds.mnemonicImportButton); | ||
|
||
async isVisible() { | ||
await this.mnemonicWordInput.waitForDisplayed(); | ||
await this.mnemonicPasswordField.waitForDisplayed(); | ||
await this.mnemonicImportButton.waitForDisplayed(); | ||
} | ||
|
||
async enterSeedPhrase(seedPhrase: string) { | ||
const wordsArray = seedPhrase.split(' '); | ||
const wordsInputs = await findElements(ImportAccountTestIds.mnemonicWordInput); | ||
|
||
for (let i = 0; i < wordsArray.length; i++) { | ||
const word = wordsArray[i]; | ||
const input = wordsInputs[i]; | ||
|
||
await input.type(word); | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
e2e/src/page-objects/pages/import-account-tabs/import-account-private-key-tab.page.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,13 @@ | ||
import { ImportAccountTestIds } from '../../../../../src/app/pages/ImportAccount/ImportAccount.test-ids'; | ||
import { Page } from '../../../classes/page.class'; | ||
import { createPageElement } from '../../../utils/search.utils'; | ||
|
||
export class ImportAccountPrivateKeyTab extends Page { | ||
privateKeyInput = createPageElement(ImportAccountTestIds.privateKeyInput); | ||
privateKeyImportButton = createPageElement(ImportAccountTestIds.privateKeyImportButton); | ||
|
||
async isVisible() { | ||
await this.privateKeyInput.waitForDisplayed(); | ||
await this.privateKeyImportButton.waitForDisplayed(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
e2e/src/page-objects/pages/import-account-tabs/import-account-tab-switcher.page.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,22 @@ | ||
import { ImportAccountTestIds } from '../../../../../src/app/pages/ImportAccount/ImportAccount.test-ids'; | ||
import { Page } from '../../../classes/page.class'; | ||
import { createPageElement, findElements, getElementText } from '../../../utils/search.utils'; | ||
|
||
export class ImportAccountTab extends Page { | ||
tabSwitcher = createPageElement(ImportAccountTestIds.tabSwitcher); | ||
|
||
async isVisible() { | ||
await this.tabSwitcher.waitForDisplayed(); | ||
} | ||
async selectTab(tabName: string) { | ||
const tabElements = await findElements(ImportAccountTestIds.tabSwitcher); | ||
|
||
for (const tabElement of tabElements) { | ||
const getTabValue = await getElementText(tabElement); | ||
|
||
if (getTabValue === tabName) { | ||
await tabElement.click(); | ||
} | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
e2e/src/page-objects/pages/import-account-tabs/import-account-watch-only-tab.page.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,13 @@ | ||
import { ImportAccountTestIds } from '../../../../../src/app/pages/ImportAccount/ImportAccount.test-ids'; | ||
import { Page } from '../../../classes/page.class'; | ||
import { createPageElement } from '../../../utils/search.utils'; | ||
|
||
export class ImportAccountWatchOnlyTab extends Page { | ||
watchOnlyInput = createPageElement(ImportAccountTestIds.watchOnlyInput); | ||
watchOnlyImportButton = createPageElement(ImportAccountTestIds.watchOnlyImportButton); | ||
|
||
async isVisible() { | ||
await this.watchOnlyInput.waitForDisplayed(); | ||
await this.watchOnlyImportButton.waitForDisplayed(); | ||
} | ||
} |
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
Oops, something went wrong.