Beispiel #1
0
        print >>sys.stderr, "(visit %s to diagnose the problem)" % (url)
        browser.quit()
        sys.exit(1)

    button.click()
    time.sleep(3)

    # Grab the viewport element so we know where to put the mouse.
    div = browser.find_element_by_id("viewport")

    # Click-and-drag on the cone to change its position a bit.
    drag = ActionChains(browser)
    drag.move_to_element(div)
    drag.click_and_hold()
    drag.move_by_offset(-300, 100)
    drag.release()
    drag.perform()

    # Give the page some time to update the image.
    time.sleep(1)

    # Take a screenshot.
    shot = "cone-%s.png" % (now())
    browser.save_screenshot(shot)

    # Compare the screenshot with the baseline, and report to stdout.
    print compare_images(shot, "baseline-cone.png")

    # Close the browser window.
    browser.quit()
Beispiel #2
0
    except NoSuchElementException:
        print >>sys.stderr, "fatal error: could not find the 'PhyloTree' button!"
        print >>sys.stderr, "(visit %s to diagnose the problem)" % (url)
        browser.quit()
        sys.exit(1)

    button.click()
    time.sleep(3)

    # Grab the body element to use as a positional reference.
    body = browser.find_element_by_tag_name("body")

    # Double-click on a sub-tree to collapse it.
    dblclick = ActionChains(browser)
    dblclick.move_to_element_with_offset(body, 475, 333)
    dblclick.double_click()
    dblclick.perform()

    # Give the page some time to update the image.
    time.sleep(1)

    # Take a screenshot.
    shot = "phylotree-%s.png" % (now())
    browser.save_screenshot(shot)

    # Compare the screenshot with the baseline, and report to stdout.
    print compare_images(shot, "baseline-phylotree.png")

    # Close the browser window.
    browser.quit()