(core) Fix for a FreeTeam test

Summary:
FreeTeam test was overlapping with DuplicateDocument test.
It was leaving some documents in personal workspace.

Test Plan: Updated tests

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3632
This commit is contained in:
Jarosław Sadziński 2022-09-16 12:35:25 +02:00
parent 23008038b7
commit 473dcf7c15
2 changed files with 14 additions and 0 deletions

View File

@ -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`);
});
});

View File

@ -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.