Skip to content

Commit

Permalink
introducing delay in search to reduce flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Jan 30, 2023
1 parent 3533b74 commit 1b23805
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def assert_classes(classes: str) -> None:
f'//*[normalize-space(@class)="{classes}" and text()="Some label"]')

screen.open('/')
screen.wait(0.5)
assert_classes('')

label.classes('one')
Expand Down Expand Up @@ -53,6 +54,7 @@ def assert_style(style: str) -> None:
assert screen.selenium.find_element(By.XPATH, f'//*[normalize-space(@style)="{style}" and text()="Some label"]')

screen.open('/')
screen.wait(0.5)
assert_style('')

label.style('color: red')
Expand Down Expand Up @@ -85,6 +87,7 @@ def assert_props(*props: str) -> None:
assert screen.selenium.find_element(By.XPATH, f'//label[{" and ".join(class_conditions)}]')

screen.open('/')
screen.wait(0.5)
assert_props('standard')

input.props('dark')
Expand Down

0 comments on commit 1b23805

Please sign in to comment.