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

Add some quick fixes for test flakiness #90

Merged
merged 3 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def test_should_change_iframe_height(page: Page):

locator = page.locator('iframe[title="my_component\\.my_component"]').nth(1)

page.wait_for_timeout(1000)
init_frame_height = locator.bounding_box()['height']
assert init_frame_height != 0

Expand All @@ -75,12 +76,14 @@ def test_should_change_iframe_height(page: Page):

expect(frame.get_by_text("Streamlit Streamlit Streamlit")).to_be_visible()

page.wait_for_timeout(1000)
frame_height = locator.bounding_box()['height']
assert frame_height > init_frame_height

page.set_viewport_size({"width": 150, "height": 150})

expect(frame.get_by_text("Streamlit Streamlit Streamlit")).not_to_be_in_viewport()

page.wait_for_timeout(1000)
frame_height_after_viewport_change = locator.bounding_box()['height']
assert frame_height_after_viewport_change > frame_height
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ def test_should_render_selectable_data_table(page: Page):

first_row_checkbox.uncheck()
expect(root_checkbox).not_to_be_checked()
assert root_checkbox.get_attribute('data-indeterminate') == "true"
expect(root_checkbox).to_have_attribute('data-indeterminate', 'true')

for checkbox in none_root_checkboxes:
checkbox.uncheck()

expect(root_checkbox).not_to_be_checked()
assert root_checkbox.get_attribute('data-indeterminate') == 'false'
expect(root_checkbox).to_have_attribute('data-indeterminate', 'false')

for checkbox in none_root_checkboxes:
checkbox.check()

expect(root_checkbox).to_be_checked()
assert root_checkbox.get_attribute('data-indeterminate') == 'false'
expect(root_checkbox).to_have_attribute('data-indeterminate', 'false')
3 changes: 3 additions & 0 deletions template-reactless/e2e/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def test_should_change_iframe_height(page: Page):

locator = page.locator('iframe[title="my_component\\.my_component"]').nth(1)

page.wait_for_timeout(1000)
init_frame_height = locator.bounding_box()['height']
assert init_frame_height != 0

Expand All @@ -75,12 +76,14 @@ def test_should_change_iframe_height(page: Page):

expect(frame.get_by_text("Streamlit Streamlit Streamlit")).to_be_visible()

page.wait_for_timeout(1000)
frame_height = locator.bounding_box()['height']
assert frame_height > init_frame_height

page.set_viewport_size({"width": 150, "height": 150})

expect(frame.get_by_text("Streamlit Streamlit Streamlit")).not_to_be_in_viewport()

page.wait_for_timeout(1000)
frame_height_after_viewport_change = locator.bounding_box()['height']
assert frame_height_after_viewport_change > frame_height
3 changes: 3 additions & 0 deletions template/e2e/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def test_should_change_iframe_height(page: Page):

locator = page.locator('iframe[title="my_component\\.my_component"]').nth(1)

page.wait_for_timeout(1000)
init_frame_height = locator.bounding_box()['height']
assert init_frame_height != 0

Expand All @@ -75,12 +76,14 @@ def test_should_change_iframe_height(page: Page):

expect(frame.get_by_text("Streamlit Streamlit Streamlit")).to_be_visible()

page.wait_for_timeout(1000)
frame_height = locator.bounding_box()['height']
assert frame_height > init_frame_height

page.set_viewport_size({"width": 150, "height": 150})

expect(frame.get_by_text("Streamlit Streamlit Streamlit")).not_to_be_in_viewport()

page.wait_for_timeout(1000)
frame_height_after_viewport_change = locator.bounding_box()['height']
assert frame_height_after_viewport_change > frame_height
Loading