Skip to content

Commit 08fe5c5

Browse files
Update @jupyterlab/galata (#7361)
* Update `@jupyterlab/galata` * Align with the galata playwright dependency * Add back playwrigh test dependency * use fixed `tmpPath` * create and delete tmpPath * Update Playwright Snapshots * Update Playwright Snapshots * fix codespell * fix codespell * codespell * pre-commit * try fix flakyness * force skip codespell * add comments * update snapshot * try reduce flakyness * try fix flakyness * flakyness --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 7891117 commit 08fe5c5

22 files changed

+418
-641
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
rev: 'v2.2.6'
3030
hooks:
3131
- id: codespell
32-
args: ['-L', 'hart,noteable']
32+
args: ['-L', 'hart,noteable', '--skip', "*.spec.ts"]
3333
exclude: |
3434
(?x)^(
3535
yarn.lock|

ui-tests/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"test:update": "playwright test --update-snapshots"
1616
},
1717
"dependencies": {
18-
"@jupyterlab/galata": "~5.2.0-rc.0",
19-
"@playwright/test": "^1.33.0",
18+
"@jupyterlab/galata": "~5.2.0",
19+
"@playwright/test": "^1.44.0",
2020
"rimraf": "^3.0.2"
2121
}
2222
}

ui-tests/test/editor.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import path from 'path';
55

66
import { test } from './fixtures';
77

8-
import { expect } from '@playwright/test';
8+
import { expect } from '@jupyterlab/galata';
99

1010
const FILE = 'environment.yml';
1111

ui-tests/test/filebrowser.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import path from 'path';
55

6-
import { expect } from '@playwright/test';
6+
import { expect } from '@jupyterlab/galata';
77

88
import { test } from './fixtures';
99

ui-tests/test/general.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import path from 'path';
55

6-
import { expect } from '@playwright/test';
6+
import { expect } from '@jupyterlab/galata';
77

88
import { test } from './fixtures';
99

ui-tests/test/layout.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import path from 'path';
55

6-
import { expect } from '@playwright/test';
6+
import { expect } from '@jupyterlab/galata';
77

88
import { galata } from '@jupyterlab/galata';
99

ui-tests/test/links.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import path from 'path';
55

6-
import { expect } from '@playwright/test';
6+
import { expect } from '@jupyterlab/galata';
77

88
import { test } from './fixtures';
99

ui-tests/test/menus.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import path from 'path';
55

66
import { test } from './fixtures';
77

8-
import { expect } from '@playwright/test';
8+
import { expect } from '@jupyterlab/galata';
99
import { waitForKernelReady } from './utils';
1010

1111
const NOTEBOOK = 'empty.ipynb';

ui-tests/test/mobile.spec.ts

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
// Copyright (c) Jupyter Development Team.
22
// Distributed under the terms of the Modified BSD License.
33

4-
import { expect } from '@playwright/test';
4+
import { IJupyterLabPage, expect, galata } from '@jupyterlab/galata';
55

66
import { test } from './fixtures';
77

88
import { hideAddCellButton, waitForKernelReady } from './utils';
99

10-
test.use({ autoGoto: false, viewport: { width: 524, height: 800 } });
10+
test.use({
11+
autoGoto: false,
12+
viewport: { width: 524, height: 800 },
13+
// Set a fixed string as Playwright is preventing the unique test name to be too long
14+
// and replaces part of the path with a hash
15+
tmpPath: 'mobile-layout',
16+
});
1117

1218
test.describe('Mobile', () => {
19+
// manually create the test directory since tmpPath is set to a fixed value
20+
test.beforeAll(async ({ request, tmpPath }) => {
21+
const contents = galata.newContentsHelper(request);
22+
await contents.createDirectory(tmpPath);
23+
});
24+
25+
test.afterAll(async ({ request, tmpPath }) => {
26+
const contents = galata.newContentsHelper(request);
27+
await contents.deleteDirectory(tmpPath);
28+
});
29+
1330
test('The layout should be more compact on the file browser page', async ({
1431
page,
1532
tmpPath,
@@ -29,11 +46,14 @@ test.describe('Mobile', () => {
2946
await page.goto(`tree/${tmpPath}`);
3047

3148
// Create a new notebook
32-
const [notebook] = await Promise.all([
33-
page.waitForEvent('popup'),
34-
page.click('text="New"'),
35-
page.click('text="Python 3 (ipykernel)"'),
36-
]);
49+
const notebookPromise = page.waitForEvent('popup');
50+
await page.click('text="New"');
51+
await page
52+
.locator(
53+
'[data-command="notebook:create-new"] >> text="Python 3 (ipykernel)"'
54+
)
55+
.click();
56+
const notebook = await notebookPromise;
3757

3858
// wait for the kernel status animations to be finished
3959
await waitForKernelReady(notebook);
9.1 KB
Loading

0 commit comments

Comments
 (0)