1
0

test_pagination.py 485 B

12345678910111213141516171819
  1. from nicegui import ui
  2. from nicegui.testing import Screen
  3. def test_pagination(screen: Screen):
  4. p = ui.pagination(1, 10, direction_links=True)
  5. ui.label().bind_text_from(p, 'value', lambda v: f'Page {v}')
  6. screen.open('/')
  7. screen.should_contain('Page 1')
  8. screen.click('7')
  9. screen.should_contain('Page 7')
  10. screen.click('keyboard_arrow_left')
  11. screen.should_contain('Page 6')
  12. screen.click('keyboard_arrow_right')
  13. screen.should_contain('Page 7')