diff --git a/nbgrader/tests/ui-tests/create_assignement.spec.ts b/nbgrader/tests/ui-tests/create_assignment.spec.ts similarity index 93% rename from nbgrader/tests/ui-tests/create_assignement.spec.ts rename to nbgrader/tests/ui-tests/create_assignment.spec.ts index 7e42c3761..dc32183ba 100644 --- a/nbgrader/tests/ui-tests/create_assignement.spec.ts +++ b/nbgrader/tests/ui-tests/create_assignment.spec.ts @@ -79,6 +79,7 @@ test.afterEach(async ({ request, page, tmpPath }) => { await page.notebook.close(); } } + await page.kernel.shutdownAll(); const contents = galata.newContentsHelper(request, page); await contents.deleteDirectory(tmpPath); @@ -221,7 +222,8 @@ test("manual cell", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/blank.ipynb`); } else { - await page.filebrowser.open("blank.ipynb"); + await page.notebook.open("blank.ipynb"); + await page.notebook.activate("blank.ipynb"); } await activateToolbar(page); @@ -262,7 +264,8 @@ test("task cell", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/task.ipynb`); } else { - await page.filebrowser.open("task.ipynb"); + await page.notebook.open("task.ipynb"); + await page.notebook.activate("task.ipynb"); } await activateToolbar(page); @@ -302,7 +305,8 @@ test("solution cell", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/blank.ipynb`); } else { - await page.filebrowser.open("blank.ipynb"); + await page.notebook.open("blank.ipynb"); + await page.notebook.activate("blank.ipynb"); } await activateToolbar(page); @@ -338,7 +342,8 @@ test("tests cell", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/blank.ipynb`); } else { - await page.filebrowser.open("blank.ipynb"); + await page.notebook.open("blank.ipynb"); + await page.notebook.activate("blank.ipynb"); } await activateToolbar(page); @@ -379,7 +384,8 @@ test("tests to solution cell", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/blank.ipynb`); } else { - await page.filebrowser.open("blank.ipynb"); + await page.notebook.open("blank.ipynb"); + await page.notebook.activate("blank.ipynb"); } await activateToolbar(page); @@ -428,7 +434,8 @@ test("locked cell", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/blank.ipynb`); } else { - await page.filebrowser.open("blank.ipynb"); + await page.notebook.open("blank.ipynb"); + await page.notebook.activate("blank.ipynb"); } await activateToolbar(page); @@ -465,7 +472,8 @@ test("tab key", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/blank.ipynb`); } else { - await page.filebrowser.open("blank.ipynb"); + await page.notebook.open("blank.ipynb"); + await page.notebook.activate("blank.ipynb"); } await activateToolbar(page); @@ -494,7 +502,8 @@ test("total points", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/blank.ipynb`); } else { - await page.filebrowser.open("blank.ipynb"); + await page.notebook.open("blank.ipynb"); + await page.notebook.activate("blank.ipynb"); } await activateToolbar(page); @@ -548,7 +557,8 @@ test("task total points", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/task.ipynb`); } else { - await page.filebrowser.open("task.ipynb"); + await page.notebook.open("task.ipynb"); + await page.notebook.activate("task.ipynb"); } await activateToolbar(page); @@ -602,7 +612,8 @@ test("cell ids", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/blank.ipynb`); } else { - await page.filebrowser.open("blank.ipynb"); + await page.notebook.open("blank.ipynb"); + await page.notebook.activate("blank.ipynb"); } await activateToolbar(page); @@ -640,7 +651,8 @@ test("task cell ids", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/task.ipynb`); } else { - await page.filebrowser.open("task.ipynb"); + await page.notebook.open("task.ipynb"); + await page.notebook.activate("task.ipynb"); } await activateToolbar(page); @@ -678,7 +690,8 @@ test("negative points", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/blank.ipynb`); } else { - await page.filebrowser.open("blank.ipynb"); + await page.notebook.open("blank.ipynb"); + await page.notebook.activate("blank.ipynb"); } await activateToolbar(page); @@ -707,7 +720,8 @@ test("task negative points", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/task.ipynb`); } else { - await page.filebrowser.open("task.ipynb"); + await page.notebook.open("task.ipynb"); + await page.notebook.activate("task.ipynb"); } await activateToolbar(page); @@ -735,7 +749,8 @@ test("schema version", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/old-schema.ipynb`); } else { - await page.filebrowser.open("old-schema.ipynb"); + await page.notebook.open("old-schema.ipynb"); + await page.notebook.activate("old-schema.ipynb"); } // activate toolbar should show an error modal @@ -752,7 +767,8 @@ test("invalid nbgrader cell type", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/blank.ipynb`); } else { - await page.filebrowser.open("blank.ipynb"); + await page.notebook.open("blank.ipynb"); + await page.notebook.activate("blank.ipynb"); } await activateToolbar(page); diff --git a/nbgrader/tests/ui-tests/formgrader.spec.ts b/nbgrader/tests/ui-tests/formgrader.spec.ts index 221897c43..a16037962 100644 --- a/nbgrader/tests/ui-tests/formgrader.spec.ts +++ b/nbgrader/tests/ui-tests/formgrader.spec.ts @@ -63,7 +63,6 @@ test.beforeEach(async ({ request, tmpPath }) => { if (await contents.fileExists("nbgrader_config.py")){ await contents.deleteFile("nbgrader_config.py"); } - await contents.uploadFile( path.resolve(__dirname, "./files/nbgrader_config.py"), "nbgrader_config.py" diff --git a/nbgrader/tests/ui-tests/validate_assignment.spec.ts b/nbgrader/tests/ui-tests/validate_assignment.spec.ts index 25e38c70d..c84ea8e90 100644 --- a/nbgrader/tests/ui-tests/validate_assignment.spec.ts +++ b/nbgrader/tests/ui-tests/validate_assignment.spec.ts @@ -94,6 +94,7 @@ test.afterEach(async ({ request, page, tmpPath }) => { await page.notebook.close(); } } + await page.kernel.shutdownAll(); const contents = galata.newContentsHelper(request, page); await contents.deleteDirectory(tmpPath); @@ -108,7 +109,8 @@ test("Validation success", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/submitted-changed.ipynb`); } else { - await page.filebrowser.open("submitted-changed.ipynb"); + await page.notebook.open("submitted-changed.ipynb"); + await page.notebook.activate("submitted-changed.ipynb"); } // click on validate, and expect a success modal @@ -128,7 +130,8 @@ test("Validation failure", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/submitted-unchanged.ipynb`); } else { - await page.filebrowser.open("submitted-unchanged.ipynb"); + await page.notebook.open("submitted-unchanged.ipynb"); + await page.notebook.activate("submitted-unchanged.ipynb"); } // click on validate, and expect an error modal @@ -150,7 +153,8 @@ test("Validation grade cell changed", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/submitted-grade-cell-changed.ipynb`); } else { - await page.filebrowser.open("submitted-grade-cell-changed.ipynb"); + await page.notebook.open("submitted-grade-cell-changed.ipynb"); + await page.notebook.activate("submitted-grade-cell-changed.ipynb"); } // click on validate, and expect an error modal @@ -172,7 +176,8 @@ test("Validation locked cell changed", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/submitted-locked-cell-changed.ipynb`); } else { - await page.filebrowser.open("submitted-locked-cell-changed.ipynb"); + await page.notebook.open("submitted-locked-cell-changed.ipynb"); + await page.notebook.activate("submitted-locked-cell-changed.ipynb"); } // click on validate, and expect an error modal @@ -194,7 +199,8 @@ test("Validation open relative file", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/open_relative_file.ipynb`); } else { - await page.filebrowser.open("open_relative_file.ipynb"); + await page.notebook.open("open_relative_file.ipynb"); + await page.notebook.activate("open_relative_file.ipynb"); } // click on validate, and expect a success modal @@ -216,7 +222,8 @@ test("Validation grade cell type changed", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/submitted-grade-cell-type-changed.ipynb`); } else { - await page.filebrowser.open("submitted-grade-cell-type-changed.ipynb"); + await page.notebook.open("submitted-grade-cell-type-changed.ipynb"); + await page.notebook.activate("submitted-grade-cell-type-changed.ipynb"); } // click on validate, and expect an error modal @@ -238,7 +245,8 @@ test("Validation answer cell type changed", async ({ page, tmpPath }) => { if (isNotebook) { await page.goto(`notebooks/${tmpPath}/submitted-answer-cell-type-changed.ipynb`); } else { - await page.filebrowser.open("submitted-answer-cell-type-changed.ipynb"); + await page.notebook.open("submitted-answer-cell-type-changed.ipynb"); + await page.notebook.activate("submitted-answer-cell-type-changed.ipynb"); } // click on validate, and expect an error modal