Browse Source

try to improve robustness of some pytests

Falko Schindler 1 năm trước cách đây
mục cha
commit
2841869dc8
2 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 3 0
      tests/test_page_title.py
  2. 1 0
      tests/test_serving_files.py

+ 3 - 0
tests/test_page_title.py

@@ -11,10 +11,13 @@ def test_page_title(screen: Screen):
         ui.page_title(f'Title: {title}')
 
     screen.open('/')
+    screen.wait(0.5)
     screen.should_contain('Initial title')
 
     screen.click('Change title')
+    screen.wait(0.5)
     screen.should_contain('"New title"')
 
     screen.open('/test')
+    screen.wait(0.5)
     screen.should_contain('Title: test')

+ 1 - 0
tests/test_serving_files.py

@@ -81,6 +81,7 @@ def test_auto_serving_file_from_video_source(screen: Screen):
     screen.open('/')
     video = screen.find_by_tag('video')
     assert '/_nicegui/auto/media/' in video.get_attribute('src')
+    screen.wait(0.5)
     assert_video_file_streaming(video.get_attribute('src'))