Skip to content

Commit caa728b

Browse files
jtpiofcollonval
andauthored
Update to Playwright 1.43.1 (#15621)
* Update to Playwright 1.40.1 * Bump to 1.42.1 * add esnext to lib * bump typescript for galata * Revert typescript changes Bump to pw 1.43.0 Fix some tests * Bump to playwright 1.43.1 * Attempt to fix debugger integration tests * Update snapshots * Make test more robust * Prettify * Add comment on regex in test path --------- Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com> Co-authored-by: Frédéric Collonval <fcollonval@gmail.com> Co-authored-by: Frédéric Collonval <frederic.collonval@webscit.com>
1 parent 9b75722 commit caa728b

File tree

39 files changed

+57
-29
lines changed

39 files changed

+57
-29
lines changed

galata/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@jupyterlab/services": "^7.2.0-rc.0",
5555
"@jupyterlab/settingregistry": "^4.2.0-rc.0",
5656
"@lumino/coreutils": "^2.1.2",
57-
"@playwright/test": "^1.32.2",
57+
"@playwright/test": "^1.43.1",
5858
"@stdlib/stats": "~0.0.13",
5959
"fs-extra": "^10.1.0",
6060
"json5": "^2.2.3",

galata/src/helpers/notebook.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,11 +1126,16 @@ export class NotebookHelper {
11261126
const gutter = gutters.nth(line);
11271127
for (let i = 0; i < 3; i++) {
11281128
await gutter.click({ position: { x: 5, y: 5 } });
1129-
await Utils.waitForCondition(
1130-
async () => ((await gutter.textContent())?.length ?? 0) > 0,
1131-
500
1132-
);
1133-
if ((await gutter.textContent())?.length) {
1129+
let break_ = true;
1130+
try {
1131+
await Utils.waitForCondition(
1132+
async () => ((await gutter.textContent())?.length ?? 0) > 0,
1133+
1000
1134+
);
1135+
} catch (reason) {
1136+
break_ = false;
1137+
}
1138+
if (break_) {
11341139
break;
11351140
}
11361141
}

galata/test/documentation/workspaces.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import { positionMouseOver } from './utils';
77

88
test.use({
99
viewport: { height: 720, width: 1280 },
10-
mockState: false
10+
mockState: false,
11+
tmpPath: 'workspaces-sidebar'
1112
});
1213

1314
test.describe('Workspaces sidebar', () => {

galata/test/galata/fixture.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ test.describe('terminals', () => {
161161

162162
test.describe('tmpPath', () => {
163163
test('should return an unique test folder', ({ tmpPath }) => {
164-
expect(tmpPath).toEqual(
165-
'test-galata-fixture-tmpPath-should-return-an-unique-test-folder-galata'
164+
// Use regex as Playwright is preventing the unique test name to be too long
165+
// by replacing the name center part with a hash of 5 characters.
166+
expect(tmpPath).toMatch(
167+
/test-galata-fixture-tmpPat-\w{5}-eturn-an-unique-test-folder-galata/
166168
);
167169
});
168170
});

galata/test/jupyterlab/debugger.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ test.describe('Debugger Tests', () => {
3434
test('Start debug session', async ({ page, tmpPath }) => {
3535
await openNotebook(page, tmpPath, 'code_notebook.ipynb');
3636

37+
await page.getByText('Python 3 (ipykernel) | Idle').waitFor();
3738
await page.debugger.switchOn();
3839
await page.waitForCondition(() => page.debugger.isOpen());
3940

@@ -80,6 +81,7 @@ test.describe('Debugger Tests', () => {
8081

8182
await openNotebook(page, tmpPath, notebookName);
8283

84+
await page.getByText('Python 3 (ipykernel) | Idle').waitFor();
8385
await page.debugger.switchOn();
8486
await page.waitForCondition(() => page.debugger.isOpen());
8587

@@ -136,6 +138,8 @@ test.describe('Debugger Tests', () => {
136138
await select.selectOption(await option.textContent());
137139
await page.click('div.jp-Dialog-content >> button:has-text("Select")');
138140

141+
await page.getByText('Python 3 (ipykernel) | Idle').waitFor();
142+
139143
// activate the script tab
140144
await page.click('.jp-FileEditor');
141145
await page.debugger.switchOn();
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

galata/test/jupyterlab/windowed-notebook.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,20 @@ test('should update window height on resize', async ({ page, tmpPath }) => {
8383

8484
test('should not update height when hiding', async ({ page, tmpPath }) => {
8585
await page.notebook.openByPath(`${tmpPath}/${fileName}`);
86+
const notebook = await page.notebook.getNotebookInPanelLocator();
87+
let initialHeight = 0;
88+
let previousHeight = 0;
89+
let counter = 0;
8690

8791
// Wait to ensure the rendering logic is stable.
88-
await page.waitForTimeout(200);
92+
do {
93+
previousHeight = initialHeight;
94+
await page.waitForTimeout(200);
8995

90-
const notebook = await page.notebook.getNotebookInPanelLocator();
91-
const initialHeight = await getInnerHeight(notebook!);
96+
initialHeight = await getInnerHeight(notebook!);
97+
} while (previousHeight !== initialHeight && counter++ < 10);
9298

93-
expect(initialHeight).toBeGreaterThan(0);
99+
expect.soft(initialHeight).toBeGreaterThan(0);
94100

95101
// Add a new launcher covering the notebook.
96102
await page.menu.clickMenuItem('File>New Launcher');

galata/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"rootDir": "src",
77
"module": "commonjs",
88
"types": ["node"],
9-
"lib": ["DOM", "DOM.iterable", "es2019.array"]
9+
"lib": ["DOM", "DOM.iterable", "es2019.array", "esnext"]
1010
},
1111
"include": ["src/**/*"],
1212
"references": [

yarn.lock

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3494,7 +3494,7 @@ __metadata:
34943494
"@jupyterlab/services": ^7.2.0-rc.0
34953495
"@jupyterlab/settingregistry": ^4.2.0-rc.0
34963496
"@lumino/coreutils": ^2.1.2
3497-
"@playwright/test": ^1.32.2
3497+
"@playwright/test": ^1.43.1
34983498
"@stdlib/stats": ~0.0.13
34993499
fs-extra: ^10.1.0
35003500
json5: ^2.2.3
@@ -5863,19 +5863,14 @@ __metadata:
58635863
languageName: node
58645864
linkType: hard
58655865

5866-
"@playwright/test@npm:^1.32.2":
5867-
version: 1.32.2
5868-
resolution: "@playwright/test@npm:1.32.2"
5866+
"@playwright/test@npm:^1.43.1":
5867+
version: 1.43.1
5868+
resolution: "@playwright/test@npm:1.43.1"
58695869
dependencies:
5870-
"@types/node": "*"
5871-
fsevents: 2.3.2
5872-
playwright-core: 1.32.2
5873-
dependenciesMeta:
5874-
fsevents:
5875-
optional: true
5870+
playwright: 1.43.1
58765871
bin:
58775872
playwright: cli.js
5878-
checksum: 3e4a9286c2a63c12b55368c3b94e8817fee15146e09e5be549be21d6938b6bcd26a32b0dc295100a3b24f1f0839fdb65be680e7a11a39014f485f36551c6844a
5873+
checksum: f9db387b488a03125e5dc22dd7ffed9c661d1f2428188912a35a2235b3bd9d826b390e7600d04998639994f5a96695b9dc9034ca9cb59e261d2fdee93a60df3f
58795874
languageName: node
58805875
linkType: hard
58815876

@@ -17363,12 +17358,27 @@ __metadata:
1736317358
languageName: node
1736417359
linkType: hard
1736517360

17366-
"playwright-core@npm:1.32.2":
17367-
version: 1.32.2
17368-
resolution: "playwright-core@npm:1.32.2"
17361+
"playwright-core@npm:1.43.1":
17362+
version: 1.43.1
17363+
resolution: "playwright-core@npm:1.43.1"
17364+
bin:
17365+
playwright-core: cli.js
17366+
checksum: 7c96b3a4a4bce2ee22c3cd680c9b0bb9e4bf07ee4b51d1e9a7f47a6489c7b0b960d4b550e530b8f41d1ffeadd26c7c6bb626ae8689dfd90dce1cb8e35ae78ff7
17367+
languageName: node
17368+
linkType: hard
17369+
17370+
"playwright@npm:1.43.1":
17371+
version: 1.43.1
17372+
resolution: "playwright@npm:1.43.1"
17373+
dependencies:
17374+
fsevents: 2.3.2
17375+
playwright-core: 1.43.1
17376+
dependenciesMeta:
17377+
fsevents:
17378+
optional: true
1736917379
bin:
1737017380
playwright: cli.js
17371-
checksum: ff000cbf280e5d558fe70fd3edf14910a2e86ec68b04e28327176268345be7b3f88a5d22d78e8dae677dd633dce6cd493237df199773b55312f2ae1ab85d711f
17381+
checksum: de9db021f93018a18275bbb5af09ebf1804aa0534f47578b35b440064abc774509740205802824afc94a99fc84dd55ffe9e215718ad3ecc691b251ab3882b096
1737217382
languageName: node
1737317383
linkType: hard
1737417384

0 commit comments

Comments
 (0)