def setUp(self): super(SSTTestCase, self).setUp() if self.base_url is not None: actions.set_base_url(self.base_url) actions._set_wait_timeout(self.wait_timeout, self.wait_poll) # Ensures sst.actions will find me actions._test = self if self.xserver_headless and self.xvfb is None: # If we need to run headless and no xvfb is already running, start # a new one for the current test, scheduling the shutdown for the # end of the test. self.xvfb = use_xvfb_server(self) config.results_directory = self.results_directory _make_results_dir() self.ensure_non_empty_session_name() self.start_browser() self.addCleanup(self.stop_browser) self.addOnException(self.count_exception) if self.screenshots_on: self.addOnException(self.take_screenshot_and_page_dump) if self.debug_post_mortem: self.addOnException( self.print_exception_and_enter_post_mortem) if self.extended_report: self.addOnException(self.report_extensively)
def setUp(self): super(SSTTestCase, self).setUp() if self.base_url is not None: actions.set_base_url(self.base_url) actions._set_wait_timeout(self.wait_timeout, self.wait_poll) # Ensures sst.actions will find me actions._test = self if self.xserver_headless and self.xvfb is None: # If we need to run headless and no xvfb is already running, start # a new one for the current test, scheduling the shutdown for the # end of the test. self.xvfb = xvfbdisplay.use_xvfb_server(self) config.results_directory = self.results_directory self.browser = None if self.use_proxy: self.start_proxy_for_test(self.id()) self.addCleanup(self.stop_proxy) self.start_browser() self.addCleanup(self.stop_browser) if config.api_test_results: self.addCleanup(self.post_api_test_result) if self.browser_factory.remote_client: self.remote_client = self.browser_factory.remote_client self.addCleanup(self.post_remote_result) if self.screenshots_on: self.addOnException(self.take_screenshot_and_page_dump) if self.debug_post_mortem: self.addOnException( self.print_exception_and_enter_post_mortem) if self.extended_report: self.addOnException(self.report_extensively)
def setUp(self): self._compile_script() # The script may override some settings. The default value for # ASSUME_TRUSTED_CERT_ISSUER is False, so if the user mentions it # in his script, it's to turn them on. Also, getting our hands on # the values used in the script is too hackish. if 'ASSUME_TRUSTED_CERT_ISSUER' in self.code.co_names: self.assume_trusted_cert_issuer = True super(SSTScriptTestCase, self).setUp() # Start with default values actions.reset_base_url() actions._set_wait_timeout(10, 0.1) # Possibly inject parametrization from associated .csv file previous_context = context.store_context() self.addCleanup(context.restore_context, previous_context) context.populate_context(self.context, self.script_path, self.browser.name)
def setUp(self): self.script_path = os.path.join(self.script_dir, self.script_name) sys.path.append(self.script_dir) self.addCleanup(sys.path.remove, self.script_dir) self._compile_script() # The script may override some settings. The default value for # JAVASCRIPT_DISABLED and ASSUME_TRUSTED_CERT_ISSUER are False, so if # the user mentions them in his script, it's to turn them on. Also, # getting our hands on the values used in the script is too hackish ;) if 'JAVASCRIPT_DISABLED' in self.code.co_names: self.javascript_disabled = True if 'ASSUME_TRUSTED_CERT_ISSUER' in self.code.co_names: self.assume_trusted_cert_issuer = True super(SSTScriptTestCase, self).setUp() # Start with default values actions.reset_base_url() actions._set_wait_timeout(10, 0.1) # Possibly inject parametrization from associated .csv file context.populate_context(self.context, self.script_path, self.browser_type, self.javascript_disabled)
def setUp(self): super(SSTTestCase, self).setUp() if self.base_url is not None: actions.set_base_url(self.base_url) actions._set_wait_timeout(self.wait_timeout, self.wait_poll) # Ensures sst.actions will find me actions._test = self if self.xserver_headless and self.xvfb is None: # If we need to run headless and no xvfb is already running, start # a new one for the current test, scheduling the shutdown for the # end of the test. self.xvfb = xvfbdisplay.use_xvfb_server(self) config.results_directory = self.results_directory actions._make_results_dir() self.start_browser() self.addCleanup(self.stop_browser) if self.screenshots_on: self.addOnException(self.take_screenshot_and_page_dump) if self.debug_post_mortem: self.addOnException(self.print_exception_and_enter_post_mortem) if self.extended_report: self.addOnException(self.report_extensively)