Skip to content

Commit

Permalink
Fix notebbok cell locator and try to fix the breadcrumbs wait
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Feb 21, 2024
1 parent 0ff70e9 commit 80939f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
21 changes: 6 additions & 15 deletions nbgrader/tests/ui-tests/formgrader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,33 +353,24 @@ test("Load manage assignments", async ({ page, baseURL, request, tmpPath }) => {

// expect the current path in tree tab to be the tmpPath.
await switchTab(page, 'Files');
await page
.locator(`.jp-FileBrowser-crumbs > span.jp-BreadCrumbs-item[title="/${tmpPath}"]`)
.waitFor();
const breadCrumbs = page.locator('.jp-FileBrowser-crumbs');
await breadCrumbs.getByTitle(tmpPath).waitFor();

// click on the "Problem Set 1" link and check if file browser has changed of directory
await switchTab(page, 'Formgrader');

await clickLink(iframe, "Problem Set 1");
await switchTab(page, 'Files');
await page
.locator(
`.jp-FileBrowser-crumbs > span.jp-BreadCrumbs-item[title="/${tmpPath.concat(
"/source/Problem Set 1"
)}"]`
)
await breadCrumbs
.getByTitle(tmpPath.concat("/source/Problem Set 1"))
.waitFor();

// click on preview link and check if file browser has changed of directory
await switchTab(page, 'Formgrader');
await iframe.locator("td.preview .glyphicon").click();
await switchTab(page, 'Files');
await page
.locator(
`.jp-FileBrowser-crumbs > span.jp-BreadCrumbs-item[title="/${tmpPath.concat(
"/release/Problem Set 1"
)}"]`
)
await breadCrumbs
.getByTitle(tmpPath.concat("/release/Problem Set 1"))
.waitFor();

// click on the first number of submissions and check that iframe has change URL
Expand Down
2 changes: 1 addition & 1 deletion nbgrader/tests/ui-tests/validate_assignment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const openNotebook = async (page: IJupyterLabPageFixture, notebook: string) => {
await expect(page.locator("#jp-main-dock-panel .lm-TabBar-tab")).toHaveCount(
tab_count + 1
);
await page.locator(".jp-Notebook-cell").waitFor();
await page.locator(".jp-Notebook-cell").first().waitFor();
};

/*
Expand Down

0 comments on commit 80939f2

Please sign in to comment.