-
-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(cherry picked from commit 192bb35)
- Loading branch information
Showing
6 changed files
with
58 additions
and
0 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
40 changes: 40 additions & 0 deletions
40
packages/suite-web/e2e/tests/suite/unacquired-device.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,40 @@ | ||
// @group:suite | ||
// @retry=2 | ||
|
||
describe('unacquried device', () => { | ||
beforeEach(() => { | ||
cy.viewport(1080, 1440).resetDb(); | ||
cy.task('startEmu', { wipe: true }); | ||
cy.task('setupEmu', { passphrase_protection: true, pin_protection: false }); | ||
cy.task('startBridge'); | ||
}); | ||
|
||
it('somone steals session, device status turns inactive', () => { | ||
cy.prefixedVisit('/'); | ||
cy.passThroughInitialRun(); | ||
cy.getTestElement('@passphrase-type/standard').click(); | ||
cy.discoveryShouldFinish(); | ||
|
||
// simulate stolen session from another window. device receives indicative button | ||
cy.task('stealBridgeSession'); | ||
cy.getTestElement('@menu/switch-device/refresh-button').click(); | ||
cy.getTestElement('@deviceStatus-connected'); | ||
|
||
// when user reloads app while device is ancquired, suite will not try to acquire device so that it | ||
// does not interfers with somebody else's session | ||
cy.task('stealBridgeSession'); | ||
cy.getTestElement('@menu/switch-device/refresh-button'); | ||
cy.reload(); | ||
cy.getTestElement('@device-acquire').click(); | ||
cy.getTestElement('@passphrase-type/standard').click(); | ||
cy.discoveryShouldFinish(); | ||
}); | ||
|
||
// todo: | ||
// - it is broken in settings! there is not acquire button | ||
// - make sure it works in onboarding, I am not sure there is acquire button present | ||
// - also firmware update, maybe standalone backup/recovery might have custom implementation that might be worth revisiting | ||
// - device state is incorrect is wrong copy!!! | ||
}); | ||
|
||
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
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