Skip to content

Commit b7cc0b0

Browse files
committed
Update the example tests
1 parent e9edb65 commit b7cc0b0

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

examples/parameterized_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from seleniumbase import BaseCase
21
from parameterized import parameterized
2+
from seleniumbase import BaseCase
33

44

55
class GoogleTests(BaseCase):

examples/test_hack_search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ def test_hack_search(self):
2121
self.highlight_click(help_docs_install_link)
2222
self.assert_text("Install SeleniumBase", "h1")
2323
self.click_link_text("GitHub branch")
24-
self.highlight_click('a[href*="github.com/seleniumbase/SeleniumBase"]')
24+
self.highlight_click('a[href*="/seleniumbase/SeleniumBase"]')
2525
self.assert_element('[href="/seleniumbase/SeleniumBase"]')
2626
self.assert_true("seleniumbase/SeleniumBase" in self.get_current_url())
27-
self.click('a[title="examples"]')
27+
self.highlight_click('a[title="examples"]')
2828
self.assert_text("examples", "strong.final-path")
2929
self.highlight_click('[title="test_hack_search.py"]')
3030
self.assert_text("test_hack_search.py", "strong.final-path")

examples/test_skype_site.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Usage: pytest test_skype_site.py --mobile --browser=edge
44
55
Default mobile settings for User Agent and Device Metrics if not specified:
6-
User Agent: --agent="Mozilla/5.0 (Linux; Android 9; Pixel 3 XL)"
6+
User Agent: --agent="Mozilla/5.0 (Linux; Android 11; Pixel 4 XL)"
77
CSS Width, CSS Height, Pixel-Ratio: --metrics="411,731,3"
88
"""
99
from seleniumbase import BaseCase
@@ -16,8 +16,6 @@ def test_skype_mobile_site(self):
1616
print(' (Use "--mobile" to run this test in Mobile Mode!)')
1717
self.skip('Use "--mobile" to run this test in Mobile Mode!')
1818
self.open("https://www.skype.com/en/")
19-
self.assert_text("Install Skype", "div.appInfo")
20-
self.highlight("div.appBannerContent")
2119
self.highlight('[itemprop="url"]')
2220
self.highlight("h1")
2321
self.highlight('[data-bi-area="meet-now-home-page"]')

examples/test_todomvc.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from parameterized import parameterized
2+
from seleniumbase import BaseCase
3+
4+
5+
class TodoMVC(BaseCase):
6+
@parameterized.expand(
7+
[
8+
["angularjs"],
9+
["mithril"],
10+
["react"],
11+
["vue"],
12+
]
13+
)
14+
def test_todomvc(self, framework):
15+
self.open("https://todomvc.com/")
16+
self.clear_local_storage()
17+
self.click('a[href="examples/%s"]' % framework)
18+
self.assert_element("section.todoapp")
19+
new_todo_input = "input.new-todo"
20+
todo_count_span = "span.todo-count"
21+
self.type(new_todo_input, "Learn Python\n")
22+
self.type(new_todo_input, "Learn JavaScript\n")
23+
self.type(new_todo_input, "Learn SeleniumBase\n")
24+
self.assert_text("3 items left", todo_count_span)
25+
self.check_if_unchecked("ul.todo-list li input")
26+
self.check_if_unchecked("ul.todo-list li:nth-of-type(2) input")
27+
self.check_if_unchecked("ul.todo-list li:nth-of-type(3) input")
28+
self.assert_text("0 items left", todo_count_span)
29+
self.click('label[for="toggle-all"]')
30+
self.assert_text("3 items left", todo_count_span)

0 commit comments

Comments
 (0)