Skip to content

Commit 4768df2

Browse files
committed
Try to make certain integration tests more reliable
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.
1 parent 4c25db2 commit 4768df2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/integration.spec.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,9 @@ describe("Integration tests with their own app instance each", () => {
373373
const DRAG_DISTANCE = 50
374374

375375
async function displaySeparator() {
376-
await clickMenuItem(toc.SHOW_FOR_ALL_DOCS_MENU_ID)
377376
const separatorLocator = _page.locator(mocking.elements.separator.path)
377+
await clickMenuItem(toc.SHOW_FOR_ALL_DOCS_MENU_ID)
378+
await separatorLocator.waitFor()
378379
assert(await separatorLocator.isVisible())
379380
return separatorLocator
380381
}
@@ -490,8 +491,10 @@ describe("Integration tests with their own app instance each", () => {
490491
const settings = require("../app/lib/settingsMain")
491492

492493
async function opendDialog() {
494+
const settingsDialogLocator = _page.locator(mocking.elements.settingsDialog.path)
493495
await clickMenuItem(settings.SETTINGS_MENU_ID)
494-
assert(await _page.locator(mocking.elements.settingsDialog.path).isVisible())
496+
await settingsDialogLocator.waitFor()
497+
assert(await settingsDialogLocator.isVisible())
495498
assert(!(await menuItemIsEnabled(settings.SETTINGS_MENU_ID)))
496499
}
497500

0 commit comments

Comments
 (0)