Skip to content

Commit

Permalink
Write the final test
Browse files Browse the repository at this point in the history
  • Loading branch information
ElSnoMan committed Mar 2, 2021
1 parent 726da7c commit 26c7b0e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ def get_todo_by_name(self, name: str) -> Element:
def get_all_todos(self) -> Elements:
return self.py.find("li[ng-repeat*='todo'] > input")

def add_todo(self, name: str) -> 'TodoPage':
self.py.get('#sampletodotext').type(name)
self.py.get('#addbutton').click()
return self


@pytest.fixture
def page(py: Pylenium):
Expand All @@ -42,3 +47,9 @@ def test_check_all_items(py: Pylenium, page: TodoPage):
todo.click()

assert py.contains('0 of 5 remaining')


def test_add_new_item(py: Pylenium, page: TodoPage):
page.add_todo('Finish the course')
assert page.get_all_todos().should().have_length(6)
assert py.contains('6 of 6 remaining')

0 comments on commit 26c7b0e

Please sign in to comment.