Skip to content

Commit

Permalink
Add some flakiness quick fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasMasuch committed Feb 1, 2024
1 parent efd4e02 commit ec3b54d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
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(first_row_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

0 comments on commit ec3b54d

Please sign in to comment.