Skip to content

Commit eee72fe

Browse files
authored
Update TS target (#132)
* Update TS target * Fix target in extension * Revert change * Wait for hidden spinner only * Wait for a cell * Improve selector * Yet another selector * Ensure the spinner is gone * Fix selector following Lumino 2 beta upgrade * More menu selector fixes
1 parent 4d2ad03 commit eee72fe

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

experiments/jlab-cell-boxpanel/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"resolveJsonModule": true,
2626
"sourceMap": true,
2727
"strictNullChecks": true,
28-
"target": "es2017",
28+
"target": "es2018",
2929
"types": []
3030
}
3131
}

experiments/jlab-cell-contain/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"resolveJsonModule": true,
2626
"sourceMap": true,
2727
"strictNullChecks": true,
28-
"target": "es2017",
28+
"target": "es2018",
2929
"types": []
3030
}
3131
}

experiments/jlab-cell-py/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"resolveJsonModule": true,
2525
"sourceMap": true,
2626
"strictNullChecks": true,
27-
"target": "es2017",
27+
"target": "es2018",
2828
"types": []
2929
}
3030
}

experiments/jlab-cell/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"resolveJsonModule": true,
2626
"sourceMap": true,
2727
"strictNullChecks": true,
28-
"target": "es2017",
28+
"target": "es2018",
2929
"types": []
3030
}
3131
}

experiments/lumino-div-boxpanel/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"resolveJsonModule": true,
2626
"sourceMap": true,
2727
"strictNullChecks": true,
28-
"target": "es2017",
28+
"target": "es2018",
2929
"types": []
3030
}
3131
}

extensions/fixed-data-table/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"rootDir": "src",
1818
"strict": true,
1919
"strictNullChecks": true,
20-
"target": "es2017",
20+
"target": "es2018",
2121
"types": []
2222
},
2323
"include": ["src/*"]

tests/jupyterlab/notebook.spec.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,18 @@ test.describe("JupyterLab Benchmark", () => {
137137
await page.click("#filebrowser >> .jp-BreadCrumbs-home");
138138
await page.dblclick(`#filebrowser >> text=${tmpPath}`);
139139

140+
const spinner = page.locator('[role="main"] >> .jp-SpinnerContent');
141+
140142
const openTime = await perf.measure(async () => {
141-
// Open the notebook and wait for the spinner
143+
// Open the notebook and wait for the spinner to be hidden
142144
await Promise.all([
143-
page.waitForSelector('[role="main"] >> .jp-SpinnerContent'),
145+
page.getByRole('main').locator('.jp-Notebook').locator('visible=true').waitFor(),
144146
page.dblclick(`#filebrowser >> text=${filename}.ipynb`),
145147
]);
146148

147-
// Wait for spinner to be hidden
148-
await page.waitForSelector('[role="main"] >> .jp-SpinnerContent', {
149-
state: "hidden",
150-
});
149+
if ((await spinner.count()) > 0) {
150+
spinner.waitFor({ state: "hidden" });
151+
}
151152
});
152153

153154
// Check the notebook is correctly opened
@@ -186,16 +187,15 @@ test.describe("JupyterLab Benchmark", () => {
186187
);
187188

188189
if (STEPS.includes("switch-with-copy")) {
189-
// Open copied notebook
190+
// Open copied notebook to be hidden
190191
await Promise.all([
191-
page.waitForSelector('[role="main"] >> .jp-SpinnerContent'),
192+
page.getByRole('main').locator('.jp-Notebook').locator('visible=true').waitFor(),
192193
page.dblclick(`#filebrowser >> text=${filename}_copy.ipynb`),
193194
]);
194195

195-
// Wait for spinner to be hidden
196-
await page.waitForSelector('[role="main"] >> .jp-SpinnerContent', {
197-
state: "hidden",
198-
});
196+
if ((await spinner.count()) > 0) {
197+
spinner.waitFor({ state: "hidden" });
198+
}
199199
}
200200

201201
// Switch to test notebook
@@ -338,7 +338,7 @@ test.describe("JupyterLab Benchmark", () => {
338338
const searchWord = generators[file].search;
339339
if (searchWord && STEPS.includes("search")) {
340340
await page.click('li[role="menuitem"]:has-text("Edit")');
341-
await page.click('ul[role="menu"] >> text=Find…');
341+
await page.click('.lm-Menu ul[role="menu"] >> text=Find…');
342342

343343
// Force searching in cell outputs
344344
await page.click('button[title="Show Search Filters"]');
@@ -401,14 +401,14 @@ test.describe("JupyterLab Benchmark", () => {
401401

402402
// Shutdown the kernel to be sure it does not get in our way (especially for the close action)
403403
await page.click('li[role="menuitem"]:has-text("Kernel")');
404-
await page.click('ul[role="menu"] >> text=Shut Down All Kernels…');
404+
await page.click('.lm-Menu ul[role="menu"] >> text=Shut Down All Kernels…');
405405
await page.click('.jp-Dialog-footer >> button:has-text("Shut Down All")');
406406

407407
if (STEPS.includes("close")) {
408408
// Close notebook
409409
await page.click('li[role="menuitem"]:has-text("File")');
410410
const closeTime = await perf.measure(async () => {
411-
await page.click('ul[role="menu"] >> text=Close Tab');
411+
await page.click('.lm-Menu ul[role="menu"] >> text=Close Tab');
412412
// Revert changes so we don't measure saving
413413
const dimissButton = page.locator('button:has-text("Discard")');
414414
if (await dimissButton.isVisible({ timeout: 50 })) {

tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"devDependencies": {
2222
"@jupyterlab/galata": "^4.3.5",
23-
"@playwright/test": "^1.16.0",
23+
"@playwright/test": "^1.30.0",
2424
"fkill-cli": "^6.0.1",
2525
"path": "~0.12.7",
2626
"rimraf": "^3.0.2",

0 commit comments

Comments
 (0)