@@ -12,10 +12,10 @@ def goto(self) -> 'TodoPage':
1212 return self
1313
1414 def get_todo_by_name (self , name : str ) -> Element :
15- return self .py .getx (f"//*[text()='{ name } ']" ).parent ()
15+ return self .py .getx (f"//*[text()='{ name } ']" ).parent (). get ( 'input' )
1616
1717 def get_all_todos (self ) -> Elements :
18- return self .py .find ("li[ng-repeat*='todo']" )
18+ return self .py .find ("li[ng-repeat*='todo'] > input " )
1919
2020
2121@pytest .fixture
@@ -24,21 +24,21 @@ def page(py: Pylenium):
2424
2525
2626def test_check_first_item (page : TodoPage ):
27- checkbox = page .get_todo_by_name ('First Item' ). get ( 'input' )
27+ checkbox = page .get_todo_by_name ('First Item' )
2828 checkbox .click ()
2929 assert checkbox .should ().be_checked ()
3030
3131
3232def test_check_many_items (py : Pylenium , page : TodoPage ):
3333 todos = page .get_all_todos ()
3434 todo2 , todo4 = todos [1 ], todos [3 ]
35- todo2 .get ( 'input' ). click ()
36- todo4 .get ( 'input' ). click ()
35+ todo2 .click ()
36+ todo4 .click ()
3737 assert py .contains ('3 of 5 remaining' )
3838
3939
4040def test_check_all_items (py : Pylenium , page : TodoPage ):
4141 for todo in page .get_all_todos ():
42- todo .get ( 'input' ). click ()
42+ todo .click ()
4343
4444 assert py .contains ('0 of 5 remaining' )
0 commit comments