Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/example_logs/ReadMe.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ The log files you see here were generated when test_fail.py ran and failed. You
Expected Log Files:
basic_test_info.txt
page_source.html
screenshot.jpg
screenshot.png
7 changes: 4 additions & 3 deletions examples/gui_test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def __init__(self, master):
self.run5 = Button(
frame, command=self.run_5,
text=("nosetests my_test_suite.py --with-selenium"
" --browser=chrome --with-testing_base --report")).pack()
" --browser=chrome --with-testing_base "
"--report --show_report")).pack()
self.title6 = Label(
frame,
text="Basic Failing Test Run showing the Multiple-Checks feature:",
Expand Down Expand Up @@ -94,7 +95,7 @@ def run_4(self):
def run_5(self):
os.system(
'nosetests my_test_suite.py --with-selenium'
' --browser=chrome --with-testing_base --report')
' --browser=chrome --with-testing_base --report --show_report')

def run_6(self):
os.system(
Expand All @@ -109,6 +110,6 @@ def run_7(self):

if __name__ == "__main__":
root = Tk()
root.minsize(612, 444)
root.minsize(700, 444)
app = App(root)
root.mainloop()
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
pip>=9.0.1
setuptools>=36.2.0
setuptools>=36.3.0
ipython==5.4.1
selenium==3.4.3
selenium==3.5.0
nose==1.3.7
pytest==3.1.3
pytest-html==1.15.1
pytest==3.2.1
pytest-html==1.15.2
six==1.10.0
flake8==3.3.0
requests==2.18.1
flake8==3.4.1
requests==2.18.4
BeautifulSoup4==4.6.0
unittest2==1.1.0
chardet==3.0.2
chardet==3.0.4
boto==2.48.0
ipdb==0.10.2
pyvirtualdisplay==0.2.1
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/common/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def function_to_retry(*args, **kwargs):
while local_tries > 1:
try:
return func(*args, **kwargs)
except Exception, e:
except Exception as e:
if local_delay > max_delay:
local_delay = max_delay
logging.exception('%s: Retrying in %d seconds...'
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# Default names for files saved during test failures when logging is turned on.
# (These files will get saved to the "latest_logs/" folder)
# Usage: "--with-testing_base"
SCREENSHOT_NAME = "screenshot.jpg"
SCREENSHOT_NAME = "screenshot.png"
BASIC_INFO_NAME = "basic_test_info.txt"
PAGE_SOURCE_NAME = "page_source.html"

Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/core/report_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def process_successes(test, test_count, duration):


def process_failures(test, test_count, browser_type, duration):
bad_page_image = "failure_%s.jpg" % test_count
bad_page_image = "failure_%s.png" % test_count
bad_page_data = "failure_%s.txt" % test_count
page_actions.save_screenshot(
test.driver, bad_page_image, folder=LATEST_REPORT_DIR)
Expand Down
6 changes: 4 additions & 2 deletions seleniumbase/core/s3_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ def upload_file(self, file_name, file_path):
content_type = "text/plain"
if file_name.endswith(".html"):
content_type = "text/html"
if file_name.endswith(".jpg"):
content_type = "image/jpg"
elif file_name.endswith(".jpg"):
content_type = "image/jpeg"
elif file_name.endswith(".png"):
content_type = "image/png"
upload_key.set_contents_from_filename(
file_path,
headers={"Content-Type": content_type})
Expand Down
6 changes: 3 additions & 3 deletions seleniumbase/fixtures/email_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,15 +466,15 @@ def fixup(text):
# character reference
try:
if text[:3] == "&#x":
return unichr(int(text[3:-1], 16))
return chr(int(text[3:-1], 16))
else:
return unichr(int(text[2:-1]))
return chr(int(text[2:-1]))
except ValueError:
pass
else:
# named entity
try:
text = unichr(htmlentitydefs.name2codepoint[text[1:-1]])
text = chr(htmlentitydefs.name2codepoint[text[1:-1]])
except KeyError:
pass
return text # leave as is
Expand Down
4 changes: 2 additions & 2 deletions seleniumbase/masterqa/master_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def manual_page_check(self, *args):
"*"))
return 1
else:
bad_page_name = "failed_check_%s.jpg" % self.manual_check_count
bad_page_name = "failed_check_%s.png" % self.manual_check_count
self.save_screenshot(bad_page_name, folder=LATEST_REPORT_DIR)
self.page_results_list.append(
'"%s","%s","%s","%s","%s","%s","%s","%s"' % (
Expand Down Expand Up @@ -150,7 +150,7 @@ def add_failure(self, exception=None):
exc_info = '(Unknown Exception)'

self.incomplete_runs += 1
error_page = "automation_failure_%s.jpg" % self.incomplete_runs
error_page = "automation_failure_%s.png" % self.incomplete_runs
self.save_screenshot(error_page, folder=LATEST_REPORT_DIR)
self.page_results_list.append(
'"%s","%s","%s","%s","%s","%s","%s","%s"' % (
Expand Down
4 changes: 3 additions & 1 deletion seleniumbase/plugins/selenium_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def beforeTest(self, test):
os.kill(os.getpid(), 9)
else:
connected = False
error = "(Unknown)"
for i in range(1, 4):
try:
self.driver = self.__select_browser(self.options.browser)
Expand All @@ -170,13 +171,14 @@ def beforeTest(self, test):
connected = True
break
except Exception as err:
error = err
print("Attempt #%s to connect to Selenium failed" % i)
if i < 3:
print("Retrying in 3 seconds...")
time.sleep(3)
if not connected:
print("Error starting/connecting to Selenium:")
print(err)
print(error)
print("\n\n")
os.kill(os.getpid(), 9)

Expand Down
12 changes: 6 additions & 6 deletions server_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
pip>=9.0.1
setuptools>=36.2.0
setuptools>=36.3.0
ipython==5.4.1
selenium==2.53.6
nose==1.3.7
pytest==3.1.3
pytest-html==1.15.1
pytest==3.2.1
pytest-html==1.15.2
six==1.10.0
flake8==3.3.0
requests==2.18.1
flake8==3.4.1
requests==2.18.4
BeautifulSoup4==4.6.0
unittest2==1.1.0
chardet==3.0.2
chardet==3.0.4
boto==2.48.0
ipdb==0.10.2
pyvirtualdisplay==0.2.1
Expand Down
14 changes: 7 additions & 7 deletions server_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='seleniumbase',
version='1.4.4',
version='1.4.5',
description='Test Automation Framework - http://seleniumbase.com',
long_description='Automation Framework for Simple & Reliable Web Testing',
platforms='Mac * Windows * Linux * Docker',
Expand All @@ -19,18 +19,18 @@
license='The MIT License',
install_requires=[
'pip>=9.0.1',
'setuptools>=36.2.0',
'setuptools>=36.3.0',
'ipython==5.4.1',
'selenium==2.53.6',
'nose==1.3.7',
'pytest==3.1.3',
'pytest-html==1.15.1',
'pytest==3.2.1',
'pytest-html==1.15.2',
'six==1.10.0',
'flake8==3.3.0',
'requests==2.18.1',
'flake8==3.4.1',
'requests==2.18.4',
'BeautifulSoup4==4.6.0',
'unittest2==1.1.0',
'chardet==3.0.2',
'chardet==3.0.4',
'boto==2.48.0',
'ipdb==0.10.2',
'pyvirtualdisplay==0.2.1',
Expand Down
16 changes: 8 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='seleniumbase',
version='1.4.4',
version='1.4.5',
description='Test Automation Framework - http://seleniumbase.com',
long_description='Automation Framework for Simple & Reliable Web Testing',
platforms='Mac * Windows * Linux * Docker',
Expand All @@ -18,18 +18,18 @@
license='The MIT License',
install_requires=[
'pip>=9.0.1',
'setuptools>=36.2.0',
'setuptools>=36.3.0',
'ipython==5.4.1',
'selenium==3.4.3',
'selenium==3.5.0',
'nose==1.3.7',
'pytest==3.1.3',
'pytest-html==1.15.1',
'pytest==3.2.1',
'pytest-html==1.15.2',
'six==1.10.0',
'flake8==3.3.0',
'requests==2.18.1',
'flake8==3.4.1',
'requests==2.18.4',
'BeautifulSoup4==4.6.0',
'unittest2==1.1.0',
'chardet==3.0.2',
'chardet==3.0.4',
'boto==2.48.0',
'ipdb==0.10.2',
'pyvirtualdisplay==0.2.1',
Expand Down