Esempio n. 1
0
def process_failures(test, test_count, browser_type, duration):
    bad_page_image = "failure_%s.jpg" % test_count
    bad_page_data = "failure_%s.txt" % test_count
    page_actions.save_screenshot(
        test.driver, bad_page_image, folder=LATEST_REPORT_DIR)
    page_actions.save_test_failure_data(
        test.driver, bad_page_data, browser_type, folder=LATEST_REPORT_DIR)
    exc_info = '(Unknown Failure)'
    exception = sys.exc_info()[1]
    if exception:
        if hasattr(exception, 'msg'):
            exc_info = exception.msg
        elif hasattr(exception, 'message'):
            exc_info = exception.message
        else:
            pass
    return(
        '"%s","%s","%s","%s","%s","%s","%s","%s","%s","%s"' % (
            test_count,
            "FAILED!",
            bad_page_data,
            bad_page_image,
            test.driver.current_url,
            test.browser,
            get_timestamp()[:-3],
            duration,
            test.id(),
            exc_info))
Esempio n. 2
0
def process_failures(test, test_count, browser_type):
    bad_page_image = "failure_%s.jpg" % test_count
    bad_page_data = "failure_%s.txt" % test_count
    page_actions.save_screenshot(
        test.driver, bad_page_image, folder=LATEST_REPORT_DIR)
    page_actions.save_test_failure_data(
        test.driver, bad_page_data, browser_type, folder=LATEST_REPORT_DIR)
    exc_info = '(Unknown Failure)'
    exception = sys.exc_info()[1]
    if exception:
        if hasattr(exception, 'msg'):
            exc_info = exception.msg
        elif hasattr(exception, 'message'):
            exc_info = exception.message
        else:
            pass
    return(
        '"%s","%s","%s","%s","%s","%s","%s","%s","%s"' % (
            test_count,
            "FAILED!",
            bad_page_data,
            bad_page_image,
            test.driver.current_url,
            test.browser,
            get_timestamp()[:-3],
            test.id(),
            exc_info))
Esempio n. 3
0
 def save_screenshot(self, name, folder=None):
     return page_actions.save_screenshot(self.driver, name, folder)
Esempio n. 4
0
 def save_screenshot(self, name, folder=None):
     return page_actions.save_screenshot(self.driver, name, folder)