1
0

test_tabs.py 462 B

1234567891011121314151617181920
  1. from nicegui import ui
  2. from .screen import Screen
  3. def test_tabs(screen: Screen):
  4. with ui.tabs() as tabs:
  5. ui.tab('One')
  6. ui.tab('Two')
  7. with ui.tab_panels(tabs, value='One'):
  8. with ui.tab_panel('One'):
  9. ui.label('First tab')
  10. with ui.tab_panel('Two'):
  11. ui.label('Second tab')
  12. screen.open('/')
  13. screen.should_contain('First tab')
  14. screen.click('Two')
  15. screen.should_contain('Second tab')