fix: inconsistent tooltip test

This commit is contained in:
Grégoire Cutzach 2024-10-09 11:16:56 +02:00
parent 33c7f4bfdd
commit 6750cfd31d
No known key found for this signature in database
GPG Key ID: AA4155BE23C375E6

View File

@ -1,6 +1,6 @@
import { UserAPI } from "app/common/UserAPI";
//import { assert, By, driver, until } from "mocha-webdriver";
import { assert, driver, WebElementPromise } from "mocha-webdriver";
import { assert, driver, until, WebElementPromise } from "mocha-webdriver";
import * as gu from "test/nbrowser/gristUtils";
import { setupTestSuite } from "test/nbrowser/testUtils";
@ -66,7 +66,9 @@ describe("Document Type Conversion", function () {
// Confirm the choice
await modalConfirm.click();
await driver.sleep(3000);
// Wait for the page to be reloaded
await driver.wait(until.stalenessOf(displayedLabel.element()));
await displayedLabel.wait();
// check that the displayedLabel is now equal to convert destination
assert.equal(await displayedLabel.element().getText(), to);
@ -152,7 +154,9 @@ describe("Document Type Conversion", function () {
// Check that we have an informative tooltip.
await start.mouseMove();
assert.match(await driver.findWait('.test-tooltip', 2000).getText(), /Only available to document owners/);
await gu.waitToPass(async () => {
assert.match(await driver.find('.test-tooltip').getText(), /Only available to document owners/);
});
// Nothing should happen on click. We click the location rather than the element, since the
// element isn't actually clickable.