Пример #1
0
def _screenshot(name):
    date_time = time.strftime('%H%M%S', time.localtime(time.time()))
    screenshot = name + '-' + date_time + '.PNG'
    path = os.path.join(ReportPath().get_path(), screenshot)
    driver = BasePage().get_driver()
    driver.screenshot(path)
    return screenshot
Пример #2
0
def _screenshot(name):
    date_time = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))
    screenshot = name + '-' + date_time + '.PNG'
    path = ReportPath().get_path() + '/' + screenshot

    driver = BasePage().get_driver()
    driver.screenshot(path)

    return screenshot
Пример #3
0
def _screenshot_for_gif():
    tmp_path = os.path.join(ReportPath().get_path(), 'tmp')
    if not os.path.exists(tmp_path):
        os.mkdir(tmp_path)
    tmpshot = str(round(time.time() * 1000)) + '.PNG'
    path = os.path.join(tmp_path, tmpshot)
    driver = BasePage().get_driver()
    driver.screenshot(path)
    return path