From 663b8f0b4ad0c93c1a20c23d39f0deedce5928bd Mon Sep 17 00:00:00 2001 From: Michael Mintz <mdmintz@gmail.com> Date: Tue, 16 Feb 2016 01:47:17 -0500 Subject: [PATCH 1/3] Log all options by default when individual ones are not specified --- seleniumbase/plugins/base_plugin.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/seleniumbase/plugins/base_plugin.py b/seleniumbase/plugins/base_plugin.py index 823fbc60537..3dedac3898a 100755 --- a/seleniumbase/plugins/base_plugin.py +++ b/seleniumbase/plugins/base_plugin.py @@ -11,6 +11,7 @@ from nose.plugins import Plugin from nose.exc import SkipTest from seleniumbase.config import settings +from seleniumbase.core import log_helper from seleniumbase.fixtures import constants, errors @@ -75,12 +76,31 @@ def beforeTest(self, test): test.test.data = self.options.data test.test.args = self.options + def __log_all_options_if_none_specified(self, test): + """ + When testing_base is specified, but none of the log options to save are + specified (basic_test_info, screen_shots, page_source), then save them + all by default. Otherwise, save only selected ones from their plugins. + """ + if ((not self.options.enable_plugin_basic_test_info) and + (not self.options.enable_plugin_screen_shots) and + (not self.options.enable_plugin_page_source)): + test_logpath = self.options.log_path + "/" + test.id() + log_helper.log_screenshot(test_logpath, test.driver) + log_helper.log_test_failure_data( + test_logpath, test.driver, test.browser) + log_helper.log_page_source(test_logpath, test.driver) + + def addFailure(self, test, err, capt=None): + self.__log_all_options_if_none_specified(test) + def addError(self, test, err, capt=None): """ Since Skip, Blocked, and Deprecated are all technically errors, but not error states, we want to make sure that they don't show up in the nose output as errors. """ + self.__log_all_options_if_none_specified(test) if (err[0] == errors.BlockedTest or err[0] == errors.SkipTest or err[0] == errors.DeprecatedTest): From 8e7641bae834ec760406021ee52b8ceaed4bc5fc Mon Sep 17 00:00:00 2001 From: Michael Mintz <mdmintz@gmail.com> Date: Tue, 16 Feb 2016 01:49:01 -0500 Subject: [PATCH 2/3] Version 1.1.26 --- integrations/docker/docker_setup.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/docker/docker_setup.py b/integrations/docker/docker_setup.py index 96f200571ae..76a2d2f2e91 100755 --- a/integrations/docker/docker_setup.py +++ b/integrations/docker/docker_setup.py @@ -8,7 +8,7 @@ setup( name='seleniumbase', - version='1.1.25', + version='1.1.26', author='Michael Mintz', author_email='@mintzworld', maintainer='Michael Mintz', diff --git a/setup.py b/setup.py index 507f1dfa46f..8a42c98b72e 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='seleniumbase', - version='1.1.25', + version='1.1.26', url='https://github.com/mdmintz/SeleniumBase', author='Michael Mintz', author_email='@mintzworld', From 7b25ef25028ddb1ea148e14da39f369ca8ab4012 Mon Sep 17 00:00:00 2001 From: Michael Mintz <mdmintz@gmail.com> Date: Tue, 16 Feb 2016 02:05:38 -0500 Subject: [PATCH 3/3] Don't log on fake error states such as SkipTest. --- seleniumbase/plugins/base_plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seleniumbase/plugins/base_plugin.py b/seleniumbase/plugins/base_plugin.py index 3dedac3898a..214e346a2fb 100755 --- a/seleniumbase/plugins/base_plugin.py +++ b/seleniumbase/plugins/base_plugin.py @@ -100,13 +100,14 @@ def addError(self, test, err, capt=None): error states, we want to make sure that they don't show up in the nose output as errors. """ - self.__log_all_options_if_none_specified(test) if (err[0] == errors.BlockedTest or err[0] == errors.SkipTest or err[0] == errors.DeprecatedTest): print err[1].__str__().split('''-------------------- >> ''' '''begin captured logging''' ''' << --------------------''', 1)[0] + else: + self.__log_all_options_if_none_specified(test) def handleError(self, test, err, capt=None): """