-
-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(e2e): Convert to PW unaquired device test
rename refactor locator @deviceStatus and few cy tests split test to viewOnly enabled and false
- Loading branch information
Showing
6 changed files
with
89 additions
and
105 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
71 changes: 71 additions & 0 deletions
71
packages/suite-desktop-core/e2e/tests/suite/multiple-sessions.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,71 @@ | ||
import { BridgeTransport } from '@trezor/transport'; | ||
import * as messages from '@trezor/protobuf/src/messages'; | ||
|
||
import { test, expect } from '../../support/fixtures'; | ||
|
||
const stealBridgeSession = async () => { | ||
const bridge = new BridgeTransport({ messages, id: 'foo-bar' }); | ||
await bridge.init(); | ||
const enumerateRes = await bridge.enumerate(); | ||
if (!enumerateRes.success) return null; | ||
await bridge.acquire({ | ||
input: { path: enumerateRes.payload[0].path, previous: null }, | ||
}); | ||
}; | ||
|
||
const testCases = [ | ||
{ | ||
description: 'Multiple sessions for view-only disabled', | ||
enableViewOnly: false, | ||
}, | ||
{ | ||
description: 'Multiple sessions for view-only enabled', | ||
enableViewOnly: true, | ||
}, | ||
]; | ||
|
||
test.describe('Multiple sessions', { tag: ['@group=suite'] }, () => { | ||
test.use({ emulatorSetupConf: { passphrase_protection: true } }); | ||
|
||
for (const { description, enableViewOnly } of testCases) { | ||
test(description, async ({ page, onboardingPage, dashboardPage }) => { | ||
await onboardingPage.completeOnboarding({ enableViewOnly }); | ||
await dashboardPage.discoveryShouldFinish(); | ||
await test.step('Bridge session taken by another suite session', async () => { | ||
await stealBridgeSession(); | ||
await expect(dashboardPage.deviceStatus).toHaveText('Refresh'); | ||
await dashboardPage.deviceSwitchingOpenButton.click(); | ||
// TODO: #16601 Uncomment once fixed | ||
// await expect(dashboardPage.deviceStatusOnSwitchDevice).toHaveText('Refresh'); | ||
await expect(dashboardPage.walletAtIndex(0)).not.toBeVisible(); | ||
}); | ||
|
||
await test.step('Take Bridge session back', async () => { | ||
await dashboardPage.solveIssuesButton.click(); | ||
await expect(dashboardPage.deviceStatusOnSwitchDevice).toHaveText('Connected'); | ||
await expect(dashboardPage.walletAtIndex(0)).toBeVisible(); | ||
await dashboardPage.deviceSwitchingCloseButton.click(); | ||
await expect(dashboardPage.deviceStatus).toHaveText('Connected'); | ||
}); | ||
|
||
// This is where the flow ends for view-only disabled | ||
if (!enableViewOnly) { | ||
return; | ||
} | ||
|
||
await test.step('Reloading inactive suite session does not take Bridge session back', async () => { | ||
await stealBridgeSession(); | ||
await expect(dashboardPage.deviceStatus).toHaveText('Refresh'); | ||
await page.reload(); | ||
await expect(dashboardPage.deviceStatus).toHaveText('Disconnected'); | ||
await dashboardPage.deviceSwitchingOpenButton.click(); | ||
await expect(dashboardPage.deviceStatusOnSwitchDevice).toHaveText('Disconnected'); | ||
}); | ||
|
||
await test.step('Take Bridge session back', async () => { | ||
await dashboardPage.solveIssuesButton.click(); | ||
await expect(dashboardPage.deviceStatusOnSwitchDevice).toHaveText('Connected'); | ||
}); | ||
}); | ||
} | ||
}); |
97 changes: 0 additions & 97 deletions
97
packages/suite-desktop-core/e2e/tests/suite/stolen-device.test.ts
This file was deleted.
Oops, something went wrong.
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