-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: new scenarios for generate-seed-phrase.feature
- Loading branch information
Showing
9 changed files
with
131 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Feature: GenerateSeedPhrase | ||
|
||
Background: | ||
Given user tap Get Started button on Onboarding screen | ||
And user generate passcode on Passcode screen | ||
|
||
Scenario: GenerateSeedPhrase - user can review seed phrase again | ||
Given user choose and save 15 words seed phrase | ||
And tap agree to the Terms and Conditions checkbox on Generate Seed Phrase screen | ||
When user tap Continue button Generate Seed Phrase screen | ||
And tap Cancel button on modal on Generate Seed Phrase screen | ||
Then user can see 15 words seed phrase list on Generate Seed Phrase screen | ||
|
||
Scenario: GenerateSeedPhrase - user can use 15 words seed phrase to see Verify Seed Phrase screen | ||
Given user choose and save 15 words seed phrase | ||
And tap agree to the Terms and Conditions checkbox on Generate Seed Phrase screen | ||
When user tap Continue button Generate Seed Phrase screen | ||
And tap Confirm button on modal on Generate Seed Phrase screen | ||
Then user can see Verify Seed Phrase screen | ||
|
||
Scenario: GenerateSeedPhrase - user can use 24 words seed phrase to see Verify Seed Phrase screen | ||
Given user choose and save 24 words seed phrase | ||
And tap agree to the Terms and Conditions checkbox on Generate Seed Phrase screen | ||
When user tap Continue button Generate Seed Phrase screen | ||
And tap Confirm button on modal on Generate Seed Phrase screen | ||
Then user can see Verify Seed Phrase screen |
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 @@ | ||
import GenerateSeedPhraseScreen from "../screen-objects/generate-seed-phrase.screen.js"; | ||
import {log} from "./logger.js"; | ||
|
||
export function seedPhrase() { | ||
const phrase: string[] = []; | ||
const save = async (phraseLength: number) => { | ||
for (let i = 1; i <= phraseLength; i++) { | ||
const wordValue = await GenerateSeedPhraseScreen.seedPhraseWordText(i).getText(); | ||
log.info(`Word number ${i}: ${wordValue}`); | ||
phrase.push(wordValue); | ||
} | ||
return phrase; | ||
}; | ||
|
||
return { | ||
save | ||
}; | ||
} |
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,11 @@ | ||
import { expect } from "expect-webdriverio" | ||
|
||
export class VerifySeedPhraseScreen { | ||
get seedPhraseContainer () { return $("[data-testid=\"matching-seed-phrase-container\"]") } | ||
|
||
async screenLoads() { | ||
await expect(this.seedPhraseContainer).toBeDisplayed(); | ||
} | ||
} | ||
|
||
export default new VerifySeedPhraseScreen(); |
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,6 +1,37 @@ | ||
import { Then } from "@wdio/cucumber-framework"; | ||
import { Given, When, Then } from "@wdio/cucumber-framework"; | ||
import { expect } from "expect-webdriverio" | ||
import { seedPhrase } from "../helpers/seed-phrase.js"; | ||
import GenerateSeedPhraseScreen from "../screen-objects/generate-seed-phrase.screen.js"; | ||
|
||
|
||
export let seedPhraseWords: string [] = []; | ||
|
||
Given(/^user choose and save (\d+) words seed phrase$/, async function (phraseLength) { | ||
await GenerateSeedPhraseScreen.phraseWordsButton(phraseLength).click(); | ||
await GenerateSeedPhraseScreen.viewSeedPhraseButton.click(); | ||
seedPhraseWords = await seedPhrase().save(phraseLength); | ||
}); | ||
|
||
Given(/^tap agree to the Terms and Conditions checkbox on Generate Seed Phrase screen$/, async function () { | ||
await GenerateSeedPhraseScreen.termsAndConditionsCheckbox.click(); | ||
}); | ||
|
||
When(/^user tap Continue button Generate Seed Phrase screen$/, async function () { | ||
await GenerateSeedPhraseScreen.continueButton.click(); | ||
}); | ||
|
||
When(/^tap Cancel button on modal on Generate Seed Phrase screen$/, async function () { | ||
await GenerateSeedPhraseScreen.cancelAlertButton.click(); | ||
}); | ||
|
||
When(/^tap Confirm button on modal on Generate Seed Phrase screen$/, async function () { | ||
await GenerateSeedPhraseScreen.confirmAlertButton.click(); | ||
}); | ||
|
||
Then(/^user can see Generate Seed Phrase screen$/, async function() { | ||
await GenerateSeedPhraseScreen.screenLoads() | ||
await GenerateSeedPhraseScreen.screenLoads(); | ||
}); | ||
|
||
Then(/^user can see (\d+) words seed phrase list on Generate Seed Phrase screen$/, async function (phraseLength: number) { | ||
await expect(await GenerateSeedPhraseScreen.seedPhraseContainerChildren.length).toEqual(phraseLength); | ||
}); |
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,6 @@ | ||
import { Then } from "@wdio/cucumber-framework"; | ||
import VerifySeedPhraseScreen from "../screen-objects/verify-seed-phrase.screen.js"; | ||
|
||
Then(/^user can see Verify Seed Phrase screen$/, async function () { | ||
await VerifySeedPhraseScreen.screenLoads(); | ||
}); |