Skip to content

Commit

Permalink
Handle multiple spinners (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Feb 14, 2023
1 parent 4078882 commit 4ce5000
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/jupyterlab/notebook.spec.ts
Expand Up @@ -138,6 +138,10 @@ test.describe("JupyterLab Benchmark", () => {
await page.dblclick(`#filebrowser >> text=${tmpPath}`);

const spinner = page.locator('[role="main"] >> .jp-SpinnerContent');
// Ensure there is no hanging document
while ((await spinner.count()) > 0) {
await spinner.first().waitFor({ state: "hidden" });
}

const openTime = await perf.measure(async () => {
// Open the notebook and wait for the spinner to be hidden
Expand All @@ -147,7 +151,8 @@ test.describe("JupyterLab Benchmark", () => {
]);

if ((await spinner.count()) > 0) {
spinner.waitFor({ state: "hidden" });
// They should be only one document
await spinner.waitFor({ state: "hidden" });
}
});

Expand Down Expand Up @@ -193,8 +198,8 @@ test.describe("JupyterLab Benchmark", () => {
page.dblclick(`#filebrowser >> text=${filename}_copy.ipynb`),
]);

if ((await spinner.count()) > 0) {
spinner.waitFor({ state: "hidden" });
while ((await spinner.count()) > 0) {
await spinner.first().waitFor({ state: "hidden" });
}
}

Expand Down

0 comments on commit 4ce5000

Please sign in to comment.