Skip to content

Commit

Permalink
more stable test
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Oct 31, 2023
1 parent 86af04e commit f7235ab
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/test_get_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ def test_get_all(screen: Screen):
ui.button('button B')
ui.label('label B')

elements = [str(b) for b in ui.get()]
elements = list(ui.get())

screen.open('/')
assert len(elements) == 8
assert elements[0] == '<q-page-container>'
assert elements[1] == '<q-page>'
assert elements[2] == '<div classes="nicegui-content">'
assert elements[3] == '<Button text="button A">'
assert elements[4] == '<Label text="label A">'
assert elements[5] == '<Row classes="nicegui-row, wrap">'
assert elements[6] == '<Button text="button B">'
assert elements[7] == '<Label text="label B">'
assert elements[0].tag == 'q-page-container'
assert elements[1].tag == 'q-page'
assert elements[2]._classes == ['nicegui-content']
assert elements[3].text == 'button A'
assert elements[4].text == 'label A'
assert elements[5].__class__.__name__ == 'Row'
assert elements[6].text == 'button B'
assert elements[7].text == 'label B'


def test_get_by_type(screen: Screen):
Expand Down

0 comments on commit f7235ab

Please sign in to comment.