Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple spinners #136

Merged
merged 1 commit into from
Feb 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions tests/jupyterlab/notebook.spec.ts
Original file line number Diff line number Diff line change
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