Skip to content

Commit

Permalink
Update to Playwright 1.43.1 (#15621)
Browse files Browse the repository at this point in the history
* 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>
4 people authored Apr 30, 2024
1 parent 9b75722 commit caa728b
Showing 39 changed files with 57 additions and 29 deletions.
2 changes: 1 addition & 1 deletion galata/package.json
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@
"@jupyterlab/services": "^7.2.0-rc.0",
"@jupyterlab/settingregistry": "^4.2.0-rc.0",
"@lumino/coreutils": "^2.1.2",
"@playwright/test": "^1.32.2",
"@playwright/test": "^1.43.1",
"@stdlib/stats": "~0.0.13",
"fs-extra": "^10.1.0",
"json5": "^2.2.3",
15 changes: 10 additions & 5 deletions galata/src/helpers/notebook.ts
Original file line number Diff line number Diff line change
@@ -1126,11 +1126,16 @@ export class NotebookHelper {
const gutter = gutters.nth(line);
for (let i = 0; i < 3; i++) {
await gutter.click({ position: { x: 5, y: 5 } });
await Utils.waitForCondition(
async () => ((await gutter.textContent())?.length ?? 0) > 0,
500
);
if ((await gutter.textContent())?.length) {
let break_ = true;
try {
await Utils.waitForCondition(
async () => ((await gutter.textContent())?.length ?? 0) > 0,
1000
);
} catch (reason) {
break_ = false;
}
if (break_) {
break;
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion galata/test/documentation/workspaces.test.ts
Original file line number Diff line number Diff line change
@@ -7,7 +7,8 @@ import { positionMouseOver } from './utils';

test.use({
viewport: { height: 720, width: 1280 },
mockState: false
mockState: false,
tmpPath: 'workspaces-sidebar'
});

test.describe('Workspaces sidebar', () => {
6 changes: 4 additions & 2 deletions galata/test/galata/fixture.spec.ts
Original file line number Diff line number Diff line change
@@ -161,8 +161,10 @@ test.describe('terminals', () => {

test.describe('tmpPath', () => {
test('should return an unique test folder', ({ tmpPath }) => {
expect(tmpPath).toEqual(
'test-galata-fixture-tmpPath-should-return-an-unique-test-folder-galata'
// Use regex as Playwright is preventing the unique test name to be too long
// by replacing the name center part with a hash of 5 characters.
expect(tmpPath).toMatch(
/test-galata-fixture-tmpPat-\w{5}-eturn-an-unique-test-folder-galata/
);
});
});
4 changes: 4 additions & 0 deletions galata/test/jupyterlab/debugger.test.ts
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ test.describe('Debugger Tests', () => {
test('Start debug session', async ({ page, tmpPath }) => {
await openNotebook(page, tmpPath, 'code_notebook.ipynb');

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

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

await openNotebook(page, tmpPath, notebookName);

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

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

await page.getByText('Python 3 (ipykernel) | Idle').waitFor();

// activate the script tab
await page.click('.jp-FileEditor');
await page.debugger.switchOn();
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions galata/test/jupyterlab/windowed-notebook.test.ts
Original file line number Diff line number Diff line change
@@ -83,14 +83,20 @@ test('should update window height on resize', async ({ page, tmpPath }) => {

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

// Wait to ensure the rendering logic is stable.
await page.waitForTimeout(200);
do {
previousHeight = initialHeight;
await page.waitForTimeout(200);

const notebook = await page.notebook.getNotebookInPanelLocator();
const initialHeight = await getInnerHeight(notebook!);
initialHeight = await getInnerHeight(notebook!);
} while (previousHeight !== initialHeight && counter++ < 10);

expect(initialHeight).toBeGreaterThan(0);
expect.soft(initialHeight).toBeGreaterThan(0);

// Add a new launcher covering the notebook.
await page.menu.clickMenuItem('File>New Launcher');
2 changes: 1 addition & 1 deletion galata/tsconfig.json
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"rootDir": "src",
"module": "commonjs",
"types": ["node"],
"lib": ["DOM", "DOM.iterable", "es2019.array"]
"lib": ["DOM", "DOM.iterable", "es2019.array", "esnext"]
},
"include": ["src/**/*"],
"references": [
40 changes: 25 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -3494,7 +3494,7 @@ __metadata:
"@jupyterlab/services": ^7.2.0-rc.0
"@jupyterlab/settingregistry": ^4.2.0-rc.0
"@lumino/coreutils": ^2.1.2
"@playwright/test": ^1.32.2
"@playwright/test": ^1.43.1
"@stdlib/stats": ~0.0.13
fs-extra: ^10.1.0
json5: ^2.2.3
@@ -5863,19 +5863,14 @@ __metadata:
languageName: node
linkType: hard

"@playwright/test@npm:^1.32.2":
version: 1.32.2
resolution: "@playwright/test@npm:1.32.2"
"@playwright/test@npm:^1.43.1":
version: 1.43.1
resolution: "@playwright/test@npm:1.43.1"
dependencies:
"@types/node": "*"
fsevents: 2.3.2
playwright-core: 1.32.2
dependenciesMeta:
fsevents:
optional: true
playwright: 1.43.1
bin:
playwright: cli.js
checksum: 3e4a9286c2a63c12b55368c3b94e8817fee15146e09e5be549be21d6938b6bcd26a32b0dc295100a3b24f1f0839fdb65be680e7a11a39014f485f36551c6844a
checksum: f9db387b488a03125e5dc22dd7ffed9c661d1f2428188912a35a2235b3bd9d826b390e7600d04998639994f5a96695b9dc9034ca9cb59e261d2fdee93a60df3f
languageName: node
linkType: hard

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

"playwright-core@npm:1.32.2":
version: 1.32.2
resolution: "playwright-core@npm:1.32.2"
"playwright-core@npm:1.43.1":
version: 1.43.1
resolution: "playwright-core@npm:1.43.1"
bin:
playwright-core: cli.js
checksum: 7c96b3a4a4bce2ee22c3cd680c9b0bb9e4bf07ee4b51d1e9a7f47a6489c7b0b960d4b550e530b8f41d1ffeadd26c7c6bb626ae8689dfd90dce1cb8e35ae78ff7
languageName: node
linkType: hard

"playwright@npm:1.43.1":
version: 1.43.1
resolution: "playwright@npm:1.43.1"
dependencies:
fsevents: 2.3.2
playwright-core: 1.43.1
dependenciesMeta:
fsevents:
optional: true
bin:
playwright: cli.js
checksum: ff000cbf280e5d558fe70fd3edf14910a2e86ec68b04e28327176268345be7b3f88a5d22d78e8dae677dd633dce6cd493237df199773b55312f2ae1ab85d711f
checksum: de9db021f93018a18275bbb5af09ebf1804aa0534f47578b35b440064abc774509740205802824afc94a99fc84dd55ffe9e215718ad3ecc691b251ab3882b096
languageName: node
linkType: hard

0 comments on commit caa728b

Please sign in to comment.