diff options
author | Ajay Ramachandran <[email protected]> | 2021-09-06 23:51:26 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2021-09-06 23:51:26 -0400 |
commit | bdedf86d63003feaba70907c9854b6998943f72e (patch) | |
tree | ef71b275c1850e5c13b0b035245a5347e6d292d4 /test | |
parent | 041ccdaf116e8d578a3df16e1ebc53252a56def3 (diff) | |
download | SponsorBlock-bdedf86d63003feaba70907c9854b6998943f72e.tar.gz SponsorBlock-bdedf86d63003feaba70907c9854b6998943f72e.zip |
Fix selenium test to change category
Diffstat (limited to 'test')
-rw-r--r-- | test/selenium.test.ts | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/selenium.test.ts b/test/selenium.test.ts index 3ec4037e..a50e62f1 100644 --- a/test/selenium.test.ts +++ b/test/selenium.test.ts @@ -15,6 +15,7 @@ test("Selenium Chrome test", async () => { await editSegments(driver, 0, "0:04.000", "0:10.330", "5", "13.211", "0:05.000 to 0:13.211", false); await autoskipSegment(driver, 5, 13.211); + await setSegmentCategory(driver, 0, 1, false); await setSegmentActionType(driver, 0, 1, false); await editSegments(driver, 0, "0:05.000", "0:13.211", "5", "7.5", "0:05.000 to 0:07.500", false); await muteSkipSegment(driver, 5, 7.5); @@ -109,6 +110,16 @@ async function editSegments(driver: WebDriver, index: number, expectedStartTimeB await driver.wait(until.elementTextIs(sponsorTimeDisplay, expectedDisplayedTime)); } +async function setSegmentCategory(driver: WebDriver, index: number, categoryIndex: number, openSubmitBox: boolean): Promise<void> { + if (openSubmitBox) { + const submitButton = await driver.findElement(By.id("submitButton")); + await submitButton.click(); + } + + const categorySelection = await driver.findElement(By.css(`#sponsorTimeCategoriesSubmissionNotice${index} > option:nth-child(${categoryIndex + 1})`)); + await categorySelection.click(); +} + async function setSegmentActionType(driver: WebDriver, index: number, actionTypeIndex: number, openSubmitBox: boolean): Promise<void> { if (openSubmitBox) { const submitButton = await driver.findElement(By.id("submitButton")); @@ -116,7 +127,7 @@ async function setSegmentActionType(driver: WebDriver, index: number, actionType } const actionTypeSelection = await driver.findElement(By.css(`#sponsorTimeActionTypesSubmissionNotice${index} > option:nth-child(${actionTypeIndex + 1})`)); - actionTypeSelection.click(); + await actionTypeSelection.click(); } async function autoskipSegment(driver: WebDriver, startTime: number, endTime: number): Promise<void> { |