diff --git a/test/nbrowser/DuplicateDocument.ts b/test/nbrowser/DuplicateDocument.ts index 3e32825f..ea838b7f 100644 --- a/test/nbrowser/DuplicateDocument.ts +++ b/test/nbrowser/DuplicateDocument.ts @@ -199,5 +199,9 @@ describe("DuplicateDocument", function() { assert.equal(await driver.find('.test-bc-workspace').getText(), 'Home'); assert.equal(await gu.getCell({col: 'A', rowNum: 1}).getText(), 'hello to duplicates'); assert.notEqual(await gu.getCurrentUrlId(), urlId); + + // Remove document + await driver.find(".test-bc-workspace").click(); + await gu.removeDoc(`DuplicateTest2 ${name} Copy`); }); }); diff --git a/test/nbrowser/gristUtils.ts b/test/nbrowser/gristUtils.ts index 40867ddb..7661f8b6 100644 --- a/test/nbrowser/gristUtils.ts +++ b/test/nbrowser/gristUtils.ts @@ -1575,6 +1575,16 @@ export async function completeCopy(options: {destName?: string, destWorkspace?: await waitForDocToLoad(); } +/** + * Removes document by name from the home page. + */ +export async function removeDoc(docName: string) { + await openDocDropdown(docName); + await driver.find('.test-dm-delete-doc').click(); + await driver.find('.test-modal-confirm').click(); + await driver.wait(async () => !(await driver.find('.test-modal-dialog').isPresent()), 3000); +} + /** * Helper to get the urlId of the current document. Resolves to undefined if called while not * on a document page.