Skip to content

Commit 255359d

Browse files
authored
Merge pull request #354 from seleniumbase/update-examples
Update examples
2 parents c381b52 + a80eb44 commit 255359d

File tree

10 files changed

+28
-39
lines changed

10 files changed

+28
-39
lines changed

examples/basic_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ def test_basic(self):
1111
self.open("https://xkcd.com/353/")
1212
self.click('a[rel="license"]')
1313
self.open("https://xkcd.com/1481/")
14-
self.click("link=Blag")
15-
self.update_text("input#s", "Robots!\n")
14+
self.click("link=Store")
15+
self.update_text("input#top-search-input", "xkcd book\n")
1616
self.open("https://xkcd.com/1319/")

examples/get_ip_with_bing.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/master_qa/basic_masterqa_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ class MasterQATests(MasterQA):
66
def test_masterqa(self):
77
self.open("https://xkcd.com/1700/")
88
self.verify("Do you see a webcomic?")
9-
self.highlight_click('link=Blag')
10-
self.verify('Do you see a blog archive?')
11-
self.highlight_update_text("input#s", "Dragons\n")
12-
self.verify('Do you see "dragons" in the search results?')
9+
self.highlight_click("link=Store")
10+
self.highlight_click('[title="things for walls"]')
11+
self.verify('Do you see posters for sale?')
12+
self.highlight_update_text("input.search-input", "book\n")
13+
self.verify('Do you see books in the search results?')

examples/master_qa/masterqa_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ def test_xkcd(self):
1616
self.verify("Can you find the moon?")
1717
self.click('a[rel="next"]')
1818
self.verify("Do the drones look safe?")
19-
self.click_link_text('Blag')
20-
self.update_text("input#s", "Robots!\n")
21-
self.verify("Does it say 'Hooray robots' on the page?")
19+
self.click_link_text('Store')
20+
self.update_text("input.search-input", "book\n")
21+
self.verify("Do you see books in the search results?")
2222
self.open("https://xkcd.com/213/")
2323
for i in range(5):
2424
self.click('a[rel="prev"]')

examples/my_first_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ def test_basic(self):
1111
self.open("https://xkcd.com/1481/")
1212
title = self.get_attribute("#comic img", "title")
1313
self.assert_true("86,400 seconds per day" in title)
14-
self.click("link=Blag")
15-
self.assert_text("The blag of the webcomic", "h2")
16-
self.update_text("input#s", "Robots!\n")
17-
self.assert_text("Hooray robots!", "#content")
14+
self.click("link=Store")
15+
self.assert_element('[alt="The xkcd store"]')
16+
self.update_text("input.search-input", "xkcd book\n")
17+
self.assert_text("xkcd: volume 0", "h3")
1818
self.open("https://xkcd.com/1319/")
1919
self.assert_exact_text("Automation", "#ctitle")
2020

examples/proxy_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ class MyTestClass(BaseCase):
77
def test_proxy(self):
88
self.open('https://ipinfo.io/')
99
ip_address = self.get_text("div.home-ip-details span.value")[1:-1]
10-
self.open('https://ipinfo.io/%s' % ip_address)
11-
print("\n\nIP Address = %s\n" % ip_address)
10+
print("\n\nMy IP Address = %s\n" % ip_address)
1211
print("Displaying Host Info:")
13-
print(self.get_text('ul.address-list'))
12+
print(self.get_text('div.home-ip-details').split('asn: ')[0])
1413
print("\nThe browser will close automatically in 7 seconds...")
1514
time.sleep(7)

integrations/node_js/my_first_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ def test_basic(self):
1111
self.open("https://xkcd.com/1481/")
1212
title = self.get_attribute("#comic img", "title")
1313
self.assert_true("86,400 seconds per day" in title)
14-
self.click("link=Blag")
15-
self.assert_text("The blag of the webcomic", "h2")
16-
self.update_text("input#s", "Robots!\n")
17-
self.assert_text("Hooray robots!", "#content")
14+
self.click("link=Store")
15+
self.assert_element('[alt="The xkcd store"]')
16+
self.update_text("input.search-input", "xkcd book\n")
17+
self.assert_text("xkcd: volume 0", "h3")
1818
self.open("https://xkcd.com/1319/")
1919
self.assert_exact_text("Automation", "#ctitle")

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ urllib3==1.25.3
1111
requests>=2.22.0
1212
selenium==3.141.0
1313
pluggy>=0.12.0
14-
pytest>=4.6.4;python_version<"3"
14+
pytest>=4.6.5;python_version<"3"
1515
pytest>=5.0.1;python_version>="3"
1616
pytest-cov>=2.7.1
1717
pytest-forked>=1.0.2

seleniumbase/console_scripts/sb_mkdir.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,12 @@ def main():
8888
" title = self.get_attribute(\"#comic img\", \"title\")")
8989
data.append(
9090
" self.assert_true(\"86,400 seconds per day\" in title)")
91-
data.append(' self.click("link=Blag")')
91+
data.append(' self.click("link=Store")')
9292
data.append(
93-
' self.assert_text("The blag of the webcomic", "h2")')
94-
data.append(' self.update_text("input#s", "Robots!\\n")')
95-
data.append(' self.assert_text("Hooray robots!", "#content")')
93+
" self.assert_element('[alt=\"The xkcd store\"]')")
94+
data.append(
95+
' self.update_text("input.search-input", "xkcd book\\n")')
96+
data.append(' self.assert_text("xkcd: volume 0", "h3")')
9697
data.append(' self.open("https://xkcd.com/1319/")')
9798
data.append(' self.assert_exact_text("Automation", "#ctitle")')
9899
data.append("")

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name='seleniumbase',
20-
version='1.27.0',
20+
version='1.27.1',
2121
description='Fast, Easy, and Reliable Browser Automation & Testing.',
2222
long_description=long_description,
2323
long_description_content_type='text/markdown',
@@ -65,7 +65,7 @@
6565
'requests>=2.22.0',
6666
'selenium==3.141.0',
6767
'pluggy>=0.12.0',
68-
'pytest>=4.6.4', # Keep at >=4.6.4 for Python 2 compatibility
68+
'pytest>=4.6.5', # Keep at >=4.6.5 for Python 2 compatibility
6969
'pytest-cov>=2.7.1',
7070
'pytest-forked>=1.0.2',
7171
'pytest-html==1.20.0', # Keep at 1.20.0 (later versions have errors)

0 commit comments

Comments
 (0)