Skip to content

Commit

Permalink
Try to make certain integration tests more reliable
Browse files Browse the repository at this point in the history
Some tests are rather flaky, because visibilities may be determined to
be false by Playwright. Maybe, the workaround to first wait for these
elements helps.
  • Loading branch information
c3er committed Aug 18, 2024
1 parent 4c25db2 commit 4768df2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,9 @@ describe("Integration tests with their own app instance each", () => {
const DRAG_DISTANCE = 50

async function displaySeparator() {
await clickMenuItem(toc.SHOW_FOR_ALL_DOCS_MENU_ID)
const separatorLocator = _page.locator(mocking.elements.separator.path)
await clickMenuItem(toc.SHOW_FOR_ALL_DOCS_MENU_ID)
await separatorLocator.waitFor()
assert(await separatorLocator.isVisible())
return separatorLocator
}
Expand Down Expand Up @@ -490,8 +491,10 @@ describe("Integration tests with their own app instance each", () => {
const settings = require("../app/lib/settingsMain")

async function opendDialog() {
const settingsDialogLocator = _page.locator(mocking.elements.settingsDialog.path)
await clickMenuItem(settings.SETTINGS_MENU_ID)
assert(await _page.locator(mocking.elements.settingsDialog.path).isVisible())
await settingsDialogLocator.waitFor()
assert(await settingsDialogLocator.isVisible())
assert(!(await menuItemIsEnabled(settings.SETTINGS_MENU_ID)))
}

Expand Down

0 comments on commit 4768df2

Please sign in to comment.