From ae23bfffe1f6a2e0de9a8e08e72d9e0399f283ff Mon Sep 17 00:00:00 2001 From: Ajay Date: Sat, 18 Jun 2022 11:34:37 -0400 Subject: [PATCH] Fix whitelist test --- test/selenium.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/selenium.test.ts b/test/selenium.test.ts index 279fc57e..6d522f03 100644 --- a/test/selenium.test.ts +++ b/test/selenium.test.ts @@ -3,7 +3,7 @@ import * as Chrome from "selenium-webdriver/chrome"; import * as Path from "path"; test("Selenium Chrome test", async () => { - let driver; + let driver: WebDriver; try { driver = await setup(); } catch (e) { @@ -201,8 +201,9 @@ async function toggleWhitelist(driver: WebDriver): Promise { await driver.switchTo().frame(popupFrame); const whitelistButton = await driver.findElement(By.id("whitelistButton")); + await driver.wait(until.elementIsVisible(whitelistButton)); - let whitelistText = await driver.findElement(By.id("whitelistChannel")); + const whitelistText = await driver.findElement(By.id("whitelistChannel")); const whitelistDisplayed = await whitelistText.isDisplayed(); await whitelistButton.click(); @@ -210,7 +211,6 @@ async function toggleWhitelist(driver: WebDriver): Promise { const unwhitelistText = await driver.findElement(By.id("unwhitelistChannel")); await driver.wait(until.elementIsVisible(unwhitelistText)); } else { - whitelistText = await driver.findElement(By.id("whitelistChannel")); await driver.wait(until.elementIsVisible(whitelistText)); }