Skip to content

Commit 624b480

Browse files
committed
Update example tests
1 parent 3eb1a89 commit 624b480

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

examples/boilerplates/boilerplate_test.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
from .base_test_case import BaseTestCase
2-
from .page_objects import Page
1+
try: # Run with "pytest" (relative imports are valid)
2+
from .base_test_case import BaseTestCase
3+
from .page_objects import Page
4+
except (ImportError, ValueError): # Run with "python"
5+
from base_test_case import BaseTestCase
6+
from page_objects import Page
7+
BaseTestCase.main(__name__, __file__)
38

49

510
class MyTestClass(BaseTestCase):

examples/test_todomvc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class TodoMVC(BaseCase):
88
def test_todomvc(self, framework):
99
self.open("https://todomvc.com/")
1010
self.clear_local_storage()
11-
self.click('a[href="examples/%s"]' % framework)
11+
self.click('a[href*="examples/%s/dist"]' % framework)
1212
self.assert_element("section.todoapp")
1313
self.assert_text("todos", "header h1")
1414
self.wait_for_ready_state_complete()
@@ -25,5 +25,5 @@ def test_todomvc(self, framework):
2525
self.check_if_unchecked("ul.todo-list li:nth-of-type(2) input")
2626
self.check_if_unchecked("ul.todo-list li:nth-of-type(3) input")
2727
self.assert_text("0 items left", todo_count_span)
28-
self.click('label[for="toggle-all"]')
29-
self.assert_text("3 items left", todo_count_span)
28+
self.click("button.clear-completed")
29+
self.assert_element_not_visible(todo_count_span)

examples/translations/russian_test_1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class МойТестовыйКласс(ТестНаСелен):
77
def test_пример_1(self):
88
self.открыть("https://ru.wikipedia.org/wiki/")
99
self.подтвердить_элемент('[title="Русский язык"]')
10-
self.подтвердить_текст("Википедия", "h2.main-wikimedia-header")
10+
self.подтвердить_текст("Википедия", "div.main-wikimedia-header")
1111
self.введите("#searchInput", "МГУ")
1212
self.нажмите("#searchButton")
1313
self.подтвердить_текст("университет", "#firstHeading")

0 commit comments

Comments
 (0)