Przeglądaj źródła

test: wait for the dashboard link to be visible in the onlyDashboards test (#1175)

James Read 2 dni temu
rodzic
commit
085c7169a2

+ 3 - 2
integration-tests/tests/onlyDashboards/onlyDashboards.mjs

@@ -1,6 +1,6 @@
 import { describe, it, before, after } from 'mocha'
 import { assert, expect } from 'chai'
-import { By } from 'selenium-webdriver'
+import { By, until } from 'selenium-webdriver'
 import {
   getRootAndWait,
   getActionButtons,
@@ -41,7 +41,8 @@ describe('config: onlyDashboards', function () {
 
     const firstDashboardLink = await webdriver.findElement(By.css('li[title="My Dashboard"]'), 'The first dashboard link should be present')
     assert.isNotNull(firstDashboardLink, 'First dashboard link should not be null')
-    assert.isTrue(await firstDashboardLink.isDisplayed(), 'First dashboard link should be displayed')
+    // The sidebar is marked as shown when it starts opening, so wait for the link to become visible.
+    await webdriver.wait(until.elementIsVisible(firstDashboardLink), 5000, 'First dashboard link should be displayed')
 
     const actionButtonsOnDashboard = await getActionButtons()
     assert.isArray(actionButtonsOnDashboard, 'Action buttons on dashboard should be an array')