Skip to content

Commit

Permalink
fix: inconsistent tooltip test
Browse files Browse the repository at this point in the history
  • Loading branch information
hexaltation committed Oct 9, 2024
1 parent 664bc8b commit 92c4b15
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/nbrowser/DocTypeConversion.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 92c4b15

Please sign in to comment.