Skip to content

Commit

Permalink
actual speedslider test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Aug 16, 2023
1 parent d3bc8ff commit b27d778
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,30 @@ def Disney_Intro():

# Speed Slider Test
t = driver.find_elements(by=By.ID, value="videoSpeedSlider")
# set value to 20
script = 'document.querySelector("#videoSpeedSlider")?.value = 20'
driver.execute_script(script)

# create oninput event

inputEvent = "document.querySelector('#videoSpeedSlider').dispatchEvent(new Event('input', { bubbles: true,cancelable: true,}));"
driver.execute_script(inputEvent)
video = driver.find_element(by=By.TAG_NAME, value="video")

try:
assert len(t) == 1
assert video.get_property("playbackRate") == 2
print("✅: Speed Slider")
output[5][3] = "✅"
except Exception as e:
print("❌: Speed Slider")
print(e)

script = 'document.querySelector("#videoSpeedSlider")?.value = 10'
driver.execute_script(script)
driver.execute_script(inputEvent)

# Skip Intro Test
video = driver.find_element(by=By.TAG_NAME, value="video")
while video.get_property("currentTime") > 80:
driver.execute_script(
"document.querySelector('.control-icon-btn.rwd-10sec-icon').click()"
Expand Down

0 comments on commit b27d778

Please sign in to comment.