mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 12:07:11 +03:00
Fix whitelist test
This commit is contained in:
@@ -3,7 +3,7 @@ import * as Chrome from "selenium-webdriver/chrome";
|
|||||||
import * as Path from "path";
|
import * as Path from "path";
|
||||||
|
|
||||||
test("Selenium Chrome test", async () => {
|
test("Selenium Chrome test", async () => {
|
||||||
let driver;
|
let driver: WebDriver;
|
||||||
try {
|
try {
|
||||||
driver = await setup();
|
driver = await setup();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -201,8 +201,9 @@ async function toggleWhitelist(driver: WebDriver): Promise<void> {
|
|||||||
await driver.switchTo().frame(popupFrame);
|
await driver.switchTo().frame(popupFrame);
|
||||||
|
|
||||||
const whitelistButton = await driver.findElement(By.id("whitelistButton"));
|
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();
|
const whitelistDisplayed = await whitelistText.isDisplayed();
|
||||||
|
|
||||||
await whitelistButton.click();
|
await whitelistButton.click();
|
||||||
@@ -210,7 +211,6 @@ async function toggleWhitelist(driver: WebDriver): Promise<void> {
|
|||||||
const unwhitelistText = await driver.findElement(By.id("unwhitelistChannel"));
|
const unwhitelistText = await driver.findElement(By.id("unwhitelistChannel"));
|
||||||
await driver.wait(until.elementIsVisible(unwhitelistText));
|
await driver.wait(until.elementIsVisible(unwhitelistText));
|
||||||
} else {
|
} else {
|
||||||
whitelistText = await driver.findElement(By.id("whitelistChannel"));
|
|
||||||
await driver.wait(until.elementIsVisible(whitelistText));
|
await driver.wait(until.elementIsVisible(whitelistText));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user