|
1 | 1 | // This file is copied from `atomic-data-browser` to `atomic-data-server` when `pnpm build-server` is run. |
2 | 2 | // This is why the `testConfig` is imported. |
3 | 3 |
|
4 | | -import { test, expect, Page, Browser } from '@playwright/test'; |
5 | | -import { testConfig } from './test-config'; |
| 4 | +import { test, expect } from '@playwright/test'; |
| 5 | +import type { Browser, Page } from '@playwright/test'; |
| 6 | +import { testConfig } from './test-config.js'; |
6 | 7 |
|
7 | 8 | export interface TestConfig { |
8 | 9 | demoFileName: string; |
@@ -42,13 +43,16 @@ test.describe('data-browser', async () => { |
42 | 43 | if (!serverUrl) { |
43 | 44 | throw new Error('serverUrl is not set'); |
44 | 45 | } |
| 46 | + |
45 | 47 | // Open the server |
46 | 48 | await page.goto(frontEndUrl); |
| 49 | + |
47 | 50 | // Sometimes we run the test server on a different port, but we should |
48 | 51 | // only change the drive if it is non-default. |
49 | 52 | if (serverUrl !== 'http://localhost:9883') { |
50 | 53 | await changeDrive(serverUrl, page); |
51 | 54 | } |
| 55 | + |
52 | 56 | await expect(page.locator(currentDriveTitle)).toBeVisible(); |
53 | 57 | }); |
54 | 58 |
|
@@ -659,10 +663,12 @@ async function openNewSubjectWindow(browser: Browser, url: string) { |
659 | 663 | const context2 = await browser.newContext(); |
660 | 664 | const page = await context2.newPage(); |
661 | 665 | await page.goto(frontEndUrl); |
| 666 | + |
662 | 667 | // Only when we run on `localhost` we don't need to change drive during tests |
663 | 668 | if (serverUrl !== defaultDevServer) { |
664 | 669 | await changeDrive(serverUrl, page); |
665 | 670 | } |
| 671 | + |
666 | 672 | await openSubject(page, url); |
667 | 673 | await page.setViewportSize({ width: 1000, height: 400 }); |
668 | 674 |
|
|
0 commit comments