1
0

test_events.py 457 B

12345678910111213141516171819202122
  1. import asyncio
  2. from nicegui import ui
  3. from .screen import Screen
  4. def test_event_with_update_before_await(screen: Screen):
  5. @ui.page('/')
  6. def page():
  7. async def update():
  8. ui.label('1')
  9. await asyncio.sleep(1.0)
  10. ui.label('2')
  11. ui.button('update', on_click=update)
  12. screen.open('/')
  13. screen.click('update')
  14. screen.wait_for('1')
  15. screen.should_not_contain('2')
  16. screen.wait_for('2')