Skip to content

Commit

Permalink
feat(e2e): New test that actually works with a new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Vere-Grey committed Jan 24, 2025
1 parent 6c682fd commit 81ca301
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { BridgeTransport } from '@trezor/transport';
import * as messages from '@trezor/protobuf/src/messages';

import { test, expect } from '../../support/fixtures';
import { DashboardActions } from '../../support/pageActions/dashboardActions';

const stealBridgeSession = async () => {
const bridge = new BridgeTransport({ messages, id: 'foo-bar' });
Expand All @@ -15,11 +16,11 @@ const stealBridgeSession = async () => {

const testCases = [
{
description: 'Multiple sessions for view-only disabled',
description: 'Session overtaken by another - View-Only Disabled',
enableViewOnly: false,
},
{
description: 'Multiple sessions for view-only enabled',
description: 'Session overtaken by another - View-Only Enabled',
enableViewOnly: true,
},
];
Expand Down Expand Up @@ -68,4 +69,20 @@ test.describe('Multiple sessions', { tag: ['@group=suite'] }, () => {
});
});
}

test(
'Overtake session by opening suite new tab',
{ tag: ['@webOnly'] },
async ({ context, onboardingPage, dashboardPage }) => {
await onboardingPage.completeOnboarding();
await dashboardPage.discoveryShouldFinish();

const pageTwo = await context.newPage();
await pageTwo.goto('');
const dashboardPageTwo = new DashboardActions(pageTwo);
await dashboardPageTwo.discoveryShouldFinish();
await expect(dashboardPageTwo.deviceStatus).toHaveText('Connected');
await expect(dashboardPage.deviceStatus).toHaveText('Refresh');
},
);
});

0 comments on commit 81ca301

Please sign in to comment.