-
-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(suite-web): add a test for t3t1 multishare backup
- Loading branch information
Showing
6 changed files
with
118 additions
and
3 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
packages/suite-web/e2e/support/pageObjects/multiShareBackupObject.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,16 @@ | ||
/// <reference types="cypress" /> | ||
|
||
class MultiShareBackupModal { | ||
createMultiShareBackup(): void { | ||
cy.getTestElement('@multi-share-backup/checkbox/1').click(); | ||
cy.getTestElement('@multi-share-backup/checkbox/2').click(); | ||
cy.getTestElement('@multi-share-backup/1st-info/submit-button').click(); | ||
cy.getTestElement('@multi-share-backup/2nd-info/submit-button').click(); | ||
} | ||
|
||
finalizeMultiShareBackup(): void { | ||
cy.getTestElement('@multi-share-backup/done/got-it-button').should('be.visible').click(); | ||
} | ||
} | ||
|
||
export const onMultiShareBackupModal = new MultiShareBackupModal(); |
12 changes: 12 additions & 0 deletions
12
packages/suite-web/e2e/support/pageObjects/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference types="cypress" /> | ||
|
||
class SettingsDevicePage { | ||
openCreateMultiShareBackup(): void { | ||
cy.getTestElement('@settings/device/create-multi-share-backup-button') | ||
.should('be.visible') | ||
.click(); | ||
cy.getTestElement('@multi-share-backup/1st-info/submit-button').should('be.visible'); | ||
} | ||
} | ||
|
||
export const onSettingsDevicePage = new SettingsDevicePage(); |
9 changes: 9 additions & 0 deletions
9
packages/suite-web/e2e/support/pageObjects/settingsMenuObject.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,9 @@ | ||
/// <reference types="cypress" /> | ||
|
||
class SettingsMenu { | ||
openDeviceSettings(): void { | ||
cy.getTestElement('@settings/menu/device').should('be.visible').click(); | ||
} | ||
} | ||
|
||
export const onSettingsMenu = new SettingsMenu(); |
67 changes: 67 additions & 0 deletions
67
packages/suite-web/e2e/tests/backup/t3t1-create-addtional-share.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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// @group_device-management | ||
// @retry=2 | ||
|
||
import { onNavBar } from '../../support/pageObjects/topBarObject'; | ||
import { onSettingsMenu } from '../../support/pageObjects/settingsMenuObject'; | ||
import { onSettingsDevicePage } from '../../support/pageObjects/settingsDeviceObject'; | ||
import { onMultiShareBackupModal } from '../../support/pageObjects/multiShareBackupObject'; | ||
|
||
const mnemonic = | ||
'academic again academic academic academic academic academic academic academic academic academic academic academic academic academic academic academic pecan provide remember'; | ||
describe('Backup success', () => { | ||
beforeEach(() => { | ||
cy.task('startEmu', { wipe: true, model: 'T3T1', version: '2.8.1' }); | ||
cy.task('setupEmu', { | ||
needs_backup: false, | ||
mnemonic, | ||
}); | ||
cy.task('startBridge'); | ||
|
||
cy.viewport('macbook-15').resetDb(); | ||
cy.prefixedVisit('/'); | ||
}); | ||
|
||
it('Successful backup happy path', () => { | ||
// Arrange | ||
cy.getTestElement('@analytics/continue-button', { timeout: 40000 }) | ||
.click() | ||
.getTestElement('@onboarding/exit-app-button') | ||
.click(); | ||
cy.passThroughAuthenticityCheck(); | ||
cy.getTestElement('@onboarding/viewOnly/enable').click(); | ||
cy.getTestElement('@viewOnlyTooltip/gotIt', { timeout: 15000 }) | ||
.should('be.visible') | ||
.click(); | ||
|
||
// Act | ||
// navigate to device settings page | ||
onNavBar.openSettings(); | ||
onSettingsMenu.openDeviceSettings(); | ||
onSettingsDevicePage.openCreateMultiShareBackup(); | ||
onMultiShareBackupModal.createMultiShareBackup(); | ||
|
||
// [device screen] check your backup? | ||
cy.task('swipeEmu', 'up'); | ||
|
||
// [device screen] select the number of words in your backup | ||
cy.task('inputEmu', '20'); | ||
|
||
// [device screen] backup instructions | ||
cy.task('swipeEmu', 'up'); | ||
for (const word of mnemonic.split(' ')) { | ||
// [device screen] enter next word | ||
cy.task('inputEmu', word); | ||
} | ||
|
||
// [device screen] create additional backup? | ||
cy.wait(1000); // without this timeout, backup on device simply disappears, it stinks | ||
cy.task('swipeEmu', 'up'); | ||
|
||
cy.task('readAndConfirmShamirMnemonicEmu', { shares: 3, threshold: 2 }); | ||
|
||
// Assert | ||
onMultiShareBackupModal.finalizeMultiShareBackup(); | ||
}); | ||
}); | ||
|
||
export {}; |
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