Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test_waits.py add example test_explicity_expected_conditions #1531

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions examples/python/tests/waits/test_waits.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from selenium.common import NoSuchElementException, ElementNotInteractableException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


def test_fails(driver):
Expand Down Expand Up @@ -55,3 +56,13 @@ def test_explicit_options(driver):
wait.until(lambda d : revealed.send_keys("Displayed") or True)

assert revealed.get_property("value") == "Displayed"

def test_explicity_expected_conditions(driver):
driver.get("https://www.selenium.dev/selenium/web/dynamic.html")
revealed=driver.find_element(by=By.ID,value="revealed")
driver.find_element(by=By.ID,value="reveal").click()

wait=WebDriverWait(driver,timeout=2)
wait.until(EC.visibility_of(revealed))
revealed.send_keys("Displayed")
assert revealed.get_property("value")=="Displayed"