-
-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(e2e): Fixed and updated t1b1 seed check test
- Loading branch information
1 parent
b45a147
commit 84bd8f5
Showing
6 changed files
with
91 additions
and
24 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,4 @@ | ||
export enum SeedCheckType { | ||
Advanced = 'advanced', | ||
Standard = 'basic', | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/suite-web/e2e/support/pageObjects/checkSeedObject.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,18 @@ | ||
/// <reference types="cypress" /> | ||
|
||
import { SeedCheckType } from '../enums/seedCheckType'; | ||
|
||
class CheckSeedPage { | ||
initCheck(type: SeedCheckType, numOfWords: 12 | 24): void { | ||
cy.getTestElement('@recovery/user-understands-checkbox').click(); | ||
cy.getTestElement('@recovery/start-button').click(); | ||
cy.getTestElement(`@recover/select-count/${numOfWords}`).click(); | ||
cy.getTestElement(`@recover/select-type/${type}`).click(); | ||
} | ||
|
||
verifyCheckSuccessful(): void { | ||
cy.getTestElement('@recovery/success-title').should('be.visible'); | ||
} | ||
} | ||
|
||
export const onCheckSeedPage = new CheckSeedPage(); |
4 changes: 4 additions & 0 deletions
4
packages/suite-web/e2e/support/pageObjects/settings/settingsDeviceObject.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
63 changes: 50 additions & 13 deletions
63
packages/suite-web/e2e/tests/recovery/t1b1-dry-run.test.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,26 +1,63 @@ | ||
// @group_device-management | ||
|
||
describe.skip('Recovery - dry run', () => { | ||
import { SeedCheckType } from '../../support/enums/seedCheckType'; | ||
import { onCheckSeedPage } from '../../support/pageObjects/checkSeedObject'; | ||
import { onSettingsDevicePage } from '../../support/pageObjects/settings/settingsDeviceObject'; | ||
import { onSettingsMenu } from '../../support/pageObjects/settings/settingsMenuObject'; | ||
import { onNavBar } from '../../support/pageObjects/topBarObject'; | ||
import { onWordInputPage } from '../../support/pageObjects/wordInputObject'; | ||
|
||
const mnemonic = [ | ||
'nasty', | ||
'answer', | ||
'gentle', | ||
'inform', | ||
'unaware', | ||
'abandon', | ||
'regret', | ||
'supreme', | ||
'dragon', | ||
'gravity', | ||
'behind', | ||
'lava', | ||
'dose', | ||
'pilot', | ||
'garden', | ||
'into', | ||
'dynamic', | ||
'outer', | ||
'hard', | ||
'speed', | ||
'luxury', | ||
'run', | ||
'truly', | ||
'armed', | ||
]; | ||
|
||
function confirmSuccessOnDevice(): void { | ||
cy.task('pressYes'); | ||
} | ||
|
||
describe('Recovery T1B1 - dry run', () => { | ||
beforeEach(() => { | ||
cy.task('startEmu', { model: 'T1B1', version: '1-latest', wipe: true }); | ||
cy.wait(2000); | ||
cy.task('setupEmu', { needs_backup: false }); | ||
cy.task('setupEmu', { needs_backup: false, mnemonic: mnemonic.join(' ') }); | ||
cy.task('startBridge'); | ||
cy.viewport(1440, 2560).resetDb(); | ||
cy.prefixedVisit('/settings/device'); | ||
cy.viewport('macbook-13').resetDb(); | ||
cy.prefixedVisit('/'); | ||
cy.passThroughInitialRun(); | ||
onNavBar.openSettings(); | ||
onSettingsMenu.openDeviceSettings(); | ||
}); | ||
|
||
it('Dry run with T1B1', () => { | ||
cy.getTestElement('@settings/device/check-seed-button').click(); | ||
cy.getTestElement('@recovery/user-understands-checkbox').click(); | ||
cy.getTestElement('@recovery/start-button').click(); | ||
it('Standard dry run', () => { | ||
onSettingsDevicePage.openSeedCheck(); | ||
onCheckSeedPage.initCheck(SeedCheckType.Standard, 24); | ||
onWordInputPage.inputMnemonicT1B1(mnemonic); | ||
|
||
cy.getTestElement('@recover/select-count/24').click(); | ||
cy.getTestElement('@recover/select-type/advanced').click(); | ||
cy.task('pressYes'); | ||
cy.getTestElement('@recovery/word-input-advanced/1'); | ||
confirmSuccessOnDevice(); | ||
|
||
// todo: elaborate more, seems like finally T1B1 tests are stable so it would make finally sense to finish this | ||
onCheckSeedPage.verifyCheckSuccessful(); | ||
}); | ||
}); |