Skip to content

Commit 832287d

Browse files
authored
Flaky Playwright test - notebook split cell #14450 (#14457)
1 parent a0a453d commit 832287d

File tree

4 files changed

+31
-22
lines changed

4 files changed

+31
-22
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ dependency-check-summary.txt*
3535
/performance-result.json
3636
*.vsix
3737
/scripts/native-dependencies-*
38+
allure-results

examples/playwright/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"src"
3232
],
3333
"dependencies": {
34-
"@playwright/test": "^1.37.1",
34+
"@playwright/test": "^1.47.0",
3535
"fs-extra": "^9.0.8"
3636
},
3737
"devDependencies": {

examples/playwright/src/tests/theia-notebook-editor.test.ts

+15-7
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { TheiaNotebookCell } from '../theia-notebook-cell';
2121
import { TheiaNotebookEditor } from '../theia-notebook-editor';
2222
import { TheiaWorkspace } from '../theia-workspace';
2323
import path = require('path');
24+
import fs = require('fs');
2425

2526
// See .github/workflows/playwright.yml for preferred python version
2627
const preferredKernel = process.env.CI ? 'Python 3.11' : 'Python 3';
@@ -39,7 +40,9 @@ test.describe('Theia Notebook Editor interaction', () => {
3940
});
4041

4142
test.afterAll(async () => {
42-
await app.page.close();
43+
if (app.page) {
44+
await app.page.close();
45+
}
4346
});
4447

4548
test.afterEach(async () => {
@@ -110,9 +113,11 @@ test.describe('Theia Notebook Editor interaction', () => {
110113
<|>print("Line-2")
111114
*/
112115
const line = await cell.editor.lineByLineNumber(1);
113-
await line?.waitForElementState('visible');
114-
await line?.click();
115-
await line?.press('ArrowRight');
116+
expect(line, { message: 'Line number 1 should exists' }).toBeDefined();
117+
const box = await line?.boundingBox();
118+
console.log(`Split cell test: visible = ${await line?.isVisible()}, box = {${box?.x},${box?.y},${box?.width},${box?.height}}`);
119+
await line!.click();
120+
await line!.press('ArrowRight');
116121

117122
// split cell
118123
await cell.splitCell();
@@ -134,7 +139,9 @@ test.describe('Theia Notebook Cell interaction', () => {
134139
});
135140

136141
test.afterAll(async () => {
137-
await app.page.close();
142+
if (app.page) {
143+
await app.page.close();
144+
}
138145
});
139146

140147
test.beforeEach(async () => {
@@ -309,8 +316,9 @@ async function firstCell(editor: TheiaNotebookEditor): Promise<TheiaNotebookCell
309316

310317
async function loadApp(args: TheiaPlaywrightTestConfig & PlaywrightWorkerArgs): Promise<TheiaApp> {
311318
const workingDir = path.resolve();
312-
// correct WS path. When running from IDE the path is playwright/configs with CLI it's playwright/
313-
const prefix = workingDir.endsWith('playwright/configs') ? '../' : '';
319+
// correct WS path. When running from IDE the path is workspace root or playwright/configs, with CLI it's playwright/
320+
const isWsRoot = fs.existsSync(path.join(workingDir, 'examples', 'playwright'));
321+
const prefix = isWsRoot ? 'examples/playwright/' : (workingDir.endsWith('playwright/configs') ? '../' : '');
314322
const ws = new TheiaWorkspace([prefix + 'src/tests/resources/notebook-files']);
315323
const app = await TheiaAppLoader.load(args, ws);
316324
// auto-save are disabled using settings.json file

yarn.lock

+14-14
Original file line numberDiff line numberDiff line change
@@ -1742,12 +1742,12 @@
17421742
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
17431743
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
17441744

1745-
"@playwright/test@^1.37.1":
1746-
version "1.41.2"
1747-
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.41.2.tgz#bd9db40177f8fd442e16e14e0389d23751cdfc54"
1748-
integrity sha512-qQB9h7KbibJzrDpkXkYvsmiDJK14FULCCZgEcoe2AvFAS64oCirWTwzTlAYEbKaRxWs5TFesE1Na6izMv3HfGg==
1745+
"@playwright/test@^1.47.0":
1746+
version "1.48.2"
1747+
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.48.2.tgz#87dd40633f980872283404c8142a65744d3f13d6"
1748+
integrity sha512-54w1xCWfXuax7dz4W2M9uw0gDyh+ti/0K/MxcCUxChFh37kkdxPdfZDw5QBbuPUJHr1CiHJ1hXgSs+GgeQc5Zw==
17491749
dependencies:
1750-
playwright "1.41.2"
1750+
playwright "1.48.2"
17511751

17521752
"@puppeteer/[email protected]":
17531753
version "2.3.1"
@@ -9961,17 +9961,17 @@ pkg-up@^3.1.0:
99619961
dependencies:
99629962
find-up "^3.0.0"
99639963

9964-
playwright-core@1.41.2:
9965-
version "1.41.2"
9966-
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.41.2.tgz#db22372c708926c697acc261f0ef8406606802d9"
9967-
integrity sha512-VaTvwCA4Y8kxEe+kfm2+uUUw5Lubf38RxF7FpBxLPmGe5sdNkSg5e3ChEigaGrX7qdqT3pt2m/98LiyvU2x6CA==
9964+
playwright-core@1.48.2:
9965+
version "1.48.2"
9966+
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.48.2.tgz#cd76ed8af61690edef5c05c64721c26a8db2f3d7"
9967+
integrity sha512-sjjw+qrLFlriJo64du+EK0kJgZzoQPsabGF4lBvsid+3CNIZIYLgnMj9V6JY5VhM2Peh20DJWIVpVljLLnlawA==
99689968

9969-
playwright@1.41.2:
9970-
version "1.41.2"
9971-
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.41.2.tgz#4e760b1c79f33d9129a8c65cc27953be6dd35042"
9972-
integrity sha512-v0bOa6H2GJChDL8pAeLa/LZC4feoAMbSQm1/jF/ySsWWoaNItvrMP7GEkvEEFyCTUYKMxjQKaTSg5up7nR6/8A==
9969+
playwright@1.48.2:
9970+
version "1.48.2"
9971+
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.48.2.tgz#fca45ae8abdc34835c715718072aaff7e305167e"
9972+
integrity sha512-NjYvYgp4BPmiwfe31j4gHLa3J7bD2WiBz8Lk2RoSsmX38SVIARZ18VYjxLjAcDsAhA+F4iSEXTSGgjua0rrlgQ==
99739973
dependencies:
9974-
playwright-core "1.41.2"
9974+
playwright-core "1.48.2"
99759975
optionalDependencies:
99769976
fsevents "2.3.2"
99779977

0 commit comments

Comments
 (0)