Skip to content

Commit 815453a

Browse files
authored
Merge pull request #120 from seleniumbase/upgrade-requirements
Upgrade requirements and fix Python 3 issues
2 parents b12a33e + 0e4abe8 commit 815453a

14 files changed

+48
-43
lines changed

examples/example_logs/ReadMe.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ The log files you see here were generated when test_fail.py ran and failed. You
33
Expected Log Files:
44
basic_test_info.txt
55
page_source.html
6-
screenshot.jpg
6+
screenshot.png

examples/gui_test_runner.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def __init__(self, master):
5353
self.run5 = Button(
5454
frame, command=self.run_5,
5555
text=("nosetests my_test_suite.py --with-selenium"
56-
" --browser=chrome --with-testing_base --report")).pack()
56+
" --browser=chrome --with-testing_base "
57+
"--report --show_report")).pack()
5758
self.title6 = Label(
5859
frame,
5960
text="Basic Failing Test Run showing the Multiple-Checks feature:",
@@ -94,7 +95,7 @@ def run_4(self):
9495
def run_5(self):
9596
os.system(
9697
'nosetests my_test_suite.py --with-selenium'
97-
' --browser=chrome --with-testing_base --report')
98+
' --browser=chrome --with-testing_base --report --show_report')
9899

99100
def run_6(self):
100101
os.system(
@@ -109,6 +110,6 @@ def run_7(self):
109110

110111
if __name__ == "__main__":
111112
root = Tk()
112-
root.minsize(612, 444)
113+
root.minsize(700, 444)
113114
app = App(root)
114115
root.mainloop()

requirements.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
pip>=9.0.1
2-
setuptools>=36.2.0
2+
setuptools>=36.3.0
33
ipython==5.4.1
4-
selenium==3.4.3
4+
selenium==3.5.0
55
nose==1.3.7
6-
pytest==3.1.3
7-
pytest-html==1.15.1
6+
pytest==3.2.1
7+
pytest-html==1.15.2
88
six==1.10.0
9-
flake8==3.3.0
10-
requests==2.18.1
9+
flake8==3.4.1
10+
requests==2.18.4
1111
BeautifulSoup4==4.6.0
1212
unittest2==1.1.0
13-
chardet==3.0.2
13+
chardet==3.0.4
1414
boto==2.48.0
1515
ipdb==0.10.2
1616
pyvirtualdisplay==0.2.1

seleniumbase/common/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def function_to_retry(*args, **kwargs):
3131
while local_tries > 1:
3232
try:
3333
return func(*args, **kwargs)
34-
except Exception, e:
34+
except Exception as e:
3535
if local_delay > max_delay:
3636
local_delay = max_delay
3737
logging.exception('%s: Retrying in %d seconds...'

seleniumbase/config/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# Default names for files saved during test failures when logging is turned on.
3939
# (These files will get saved to the "latest_logs/" folder)
4040
# Usage: "--with-testing_base"
41-
SCREENSHOT_NAME = "screenshot.jpg"
41+
SCREENSHOT_NAME = "screenshot.png"
4242
BASIC_INFO_NAME = "basic_test_info.txt"
4343
PAGE_SOURCE_NAME = "page_source.html"
4444

seleniumbase/core/report_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def process_successes(test, test_count, duration):
3333

3434

3535
def process_failures(test, test_count, browser_type, duration):
36-
bad_page_image = "failure_%s.jpg" % test_count
36+
bad_page_image = "failure_%s.png" % test_count
3737
bad_page_data = "failure_%s.txt" % test_count
3838
page_actions.save_screenshot(
3939
test.driver, bad_page_image, folder=LATEST_REPORT_DIR)

seleniumbase/core/s3_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ def upload_file(self, file_name, file_path):
4040
content_type = "text/plain"
4141
if file_name.endswith(".html"):
4242
content_type = "text/html"
43-
if file_name.endswith(".jpg"):
44-
content_type = "image/jpg"
43+
elif file_name.endswith(".jpg"):
44+
content_type = "image/jpeg"
45+
elif file_name.endswith(".png"):
46+
content_type = "image/png"
4547
upload_key.set_contents_from_filename(
4648
file_path,
4749
headers={"Content-Type": content_type})

seleniumbase/fixtures/email_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,15 +466,15 @@ def fixup(text):
466466
# character reference
467467
try:
468468
if text[:3] == "&#x":
469-
return unichr(int(text[3:-1], 16))
469+
return chr(int(text[3:-1], 16))
470470
else:
471-
return unichr(int(text[2:-1]))
471+
return chr(int(text[2:-1]))
472472
except ValueError:
473473
pass
474474
else:
475475
# named entity
476476
try:
477-
text = unichr(htmlentitydefs.name2codepoint[text[1:-1]])
477+
text = chr(htmlentitydefs.name2codepoint[text[1:-1]])
478478
except KeyError:
479479
pass
480480
return text # leave as is

seleniumbase/masterqa/master_qa.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def manual_page_check(self, *args):
111111
"*"))
112112
return 1
113113
else:
114-
bad_page_name = "failed_check_%s.jpg" % self.manual_check_count
114+
bad_page_name = "failed_check_%s.png" % self.manual_check_count
115115
self.save_screenshot(bad_page_name, folder=LATEST_REPORT_DIR)
116116
self.page_results_list.append(
117117
'"%s","%s","%s","%s","%s","%s","%s","%s"' % (
@@ -150,7 +150,7 @@ def add_failure(self, exception=None):
150150
exc_info = '(Unknown Exception)'
151151

152152
self.incomplete_runs += 1
153-
error_page = "automation_failure_%s.jpg" % self.incomplete_runs
153+
error_page = "automation_failure_%s.png" % self.incomplete_runs
154154
self.save_screenshot(error_page, folder=LATEST_REPORT_DIR)
155155
self.page_results_list.append(
156156
'"%s","%s","%s","%s","%s","%s","%s","%s"' % (

seleniumbase/plugins/selenium_plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ def beforeTest(self, test):
157157
os.kill(os.getpid(), 9)
158158
else:
159159
connected = False
160+
error = "(Unknown)"
160161
for i in range(1, 4):
161162
try:
162163
self.driver = self.__select_browser(self.options.browser)
@@ -170,13 +171,14 @@ def beforeTest(self, test):
170171
connected = True
171172
break
172173
except Exception as err:
174+
error = err
173175
print("Attempt #%s to connect to Selenium failed" % i)
174176
if i < 3:
175177
print("Retrying in 3 seconds...")
176178
time.sleep(3)
177179
if not connected:
178180
print("Error starting/connecting to Selenium:")
179-
print(err)
181+
print(error)
180182
print("\n\n")
181183
os.kill(os.getpid(), 9)
182184

server_requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
pip>=9.0.1
2-
setuptools>=36.2.0
2+
setuptools>=36.3.0
33
ipython==5.4.1
44
selenium==2.53.6
55
nose==1.3.7
6-
pytest==3.1.3
7-
pytest-html==1.15.1
6+
pytest==3.2.1
7+
pytest-html==1.15.2
88
six==1.10.0
9-
flake8==3.3.0
10-
requests==2.18.1
9+
flake8==3.4.1
10+
requests==2.18.4
1111
BeautifulSoup4==4.6.0
1212
unittest2==1.1.0
13-
chardet==3.0.2
13+
chardet==3.0.4
1414
boto==2.48.0
1515
ipdb==0.10.2
1616
pyvirtualdisplay==0.2.1

server_setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name='seleniumbase',
11-
version='1.4.4',
11+
version='1.4.5',
1212
description='Test Automation Framework - http://seleniumbase.com',
1313
long_description='Automation Framework for Simple & Reliable Web Testing',
1414
platforms='Mac * Windows * Linux * Docker',
@@ -19,18 +19,18 @@
1919
license='The MIT License',
2020
install_requires=[
2121
'pip>=9.0.1',
22-
'setuptools>=36.2.0',
22+
'setuptools>=36.3.0',
2323
'ipython==5.4.1',
2424
'selenium==2.53.6',
2525
'nose==1.3.7',
26-
'pytest==3.1.3',
27-
'pytest-html==1.15.1',
26+
'pytest==3.2.1',
27+
'pytest-html==1.15.2',
2828
'six==1.10.0',
29-
'flake8==3.3.0',
30-
'requests==2.18.1',
29+
'flake8==3.4.1',
30+
'requests==2.18.4',
3131
'BeautifulSoup4==4.6.0',
3232
'unittest2==1.1.0',
33-
'chardet==3.0.2',
33+
'chardet==3.0.4',
3434
'boto==2.48.0',
3535
'ipdb==0.10.2',
3636
'pyvirtualdisplay==0.2.1',

setup.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name='seleniumbase',
10-
version='1.4.4',
10+
version='1.4.5',
1111
description='Test Automation Framework - http://seleniumbase.com',
1212
long_description='Automation Framework for Simple & Reliable Web Testing',
1313
platforms='Mac * Windows * Linux * Docker',
@@ -18,18 +18,18 @@
1818
license='The MIT License',
1919
install_requires=[
2020
'pip>=9.0.1',
21-
'setuptools>=36.2.0',
21+
'setuptools>=36.3.0',
2222
'ipython==5.4.1',
23-
'selenium==3.4.3',
23+
'selenium==3.5.0',
2424
'nose==1.3.7',
25-
'pytest==3.1.3',
26-
'pytest-html==1.15.1',
25+
'pytest==3.2.1',
26+
'pytest-html==1.15.2',
2727
'six==1.10.0',
28-
'flake8==3.3.0',
29-
'requests==2.18.1',
28+
'flake8==3.4.1',
29+
'requests==2.18.4',
3030
'BeautifulSoup4==4.6.0',
3131
'unittest2==1.1.0',
32-
'chardet==3.0.2',
32+
'chardet==3.0.4',
3333
'boto==2.48.0',
3434
'ipdb==0.10.2',
3535
'pyvirtualdisplay==0.2.1',

0 commit comments

Comments
 (0)