File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -23,17 +23,22 @@ def page(py: Pylenium):
2323 return TodoPage (py ).goto ()
2424
2525
26- def test_check_first_item (py : Pylenium ):
27- py .visit ('https://lambdatest.github.io/sample-todo-app/' )
28- checkbox = py .getx ("//*[text()='First Item']" ).parent ().get ('input' )
26+ def test_check_first_item (page : TodoPage ):
27+ checkbox = page .get_todo_by_name ('First Item' ).get ('input' )
2928 checkbox .click ()
3029 assert checkbox .should ().be_checked ()
3130
3231
33- def test_check_many_items (py : Pylenium ):
34- py .visit ('https://lambdatest.github.io/sample-todo-app/' )
35- todos = py .find ("li[ng-repeat*='todo']" )
32+ def test_check_many_items (py : Pylenium , page : TodoPage ):
33+ todos = page .get_all_todos ()
3634 todo2 , todo4 = todos [1 ], todos [3 ]
3735 todo2 .get ('input' ).click ()
3836 todo4 .get ('input' ).click ()
3937 assert py .contains ('3 of 5 remaining' )
38+
39+
40+ def test_check_all_items (py : Pylenium , page : TodoPage ):
41+ for todo in page .get_all_todos ():
42+ todo .get ('input' ).click ()
43+
44+ assert py .contains ('0 of 5 remaining' )
You can’t perform that action at this time.
0 commit comments