1
0

test_carousel.py 620 B

1234567891011121314151617181920
  1. from nicegui import ui
  2. from nicegui.testing import Screen
  3. def test_carousel(screen: Screen):
  4. with ui.carousel(arrows=True).props('control-color=primary'):
  5. for name in ['Alice', 'Bob', 'Carol']:
  6. with ui.carousel_slide():
  7. ui.label(name).classes('w-32')
  8. screen.open('/')
  9. screen.should_contain('Alice')
  10. screen.click('chevron_right')
  11. screen.should_contain('Bob')
  12. screen.click('chevron_right')
  13. screen.should_contain('Carol')
  14. screen.click('chevron_left')
  15. screen.should_contain('Bob')
  16. screen.click('chevron_left')
  17. screen.should_contain('Alice')