Skip to content

Commit

Permalink
test(suite-desktop-core): bridge is restarted by app
Browse files Browse the repository at this point in the history
  • Loading branch information
karliatto authored and mroz22 committed Sep 11, 2024
1 parent 942ec34 commit 17e94f3
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion packages/suite-desktop-core/e2e/tests/spawn-bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { test as testPlaywright, expect as expectPlaywright } from '@playwright/
import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link';

import { launchSuite, waitForDataTestSelector } from '../support/common';
import { onDashboardPage } from '../support/pageActions/dashboardActions';

testPlaywright.describe.serial('Bridge', () => {
const expectedBridgeVersion = '2.0.33';
testPlaywright.beforeAll(async () => {
testPlaywright.beforeEach(async () => {
// We make sure that bridge from trezor-user-env is stopped.
// So we properly test the electron app starting node-bridge module.
await TrezorUserEnvLink.connect();
Expand Down Expand Up @@ -58,4 +59,25 @@ testPlaywright.describe.serial('Bridge', () => {
// ok
}
});

testPlaywright(
'App acquired device, EXTERNAL bridge is restarted, app reconnects',
async () => {
await TrezorUserEnvLink.startEmu({ wipe: true, version: '2-latest', model: 'T2T1' });
await TrezorUserEnvLink.setupEmu({});
await TrezorUserEnvLink.startBridge();

const suite = await launchSuite();
await suite.window.title();
await waitForDataTestSelector(suite.window, '@welcome/title');
await onDashboardPage.passThroughInitialRun(suite.window);

await TrezorUserEnvLink.stopBridge();

await waitForDataTestSelector(suite.window, '@connect-device-prompt');

await TrezorUserEnvLink.startBridge();
await waitForDataTestSelector(suite.window, '@dashboard/index');
},
);
});

0 comments on commit 17e94f3

Please sign in to comment.