def clean_slate():
    # Delete all the dashboards
    delete_all_dashboards("test_user", "e2e_password", "login.etherios.com")
    # Log back in
    log_in_clean("test_user", "e2e_password", "login.etherios.com")

    # With no dashboards, logging in should lead to the dashboard setup page.
    assert_that(browser.url, ends_with("#/setup"))
def log_in(*auth):
    delete_all_dashboards(*auth)
    add_empty_dashboard(*auth)

    log_in_clean(*auth)

    splinter_tests.visit("/#/add_widget")

    # Wait a moment for everything to settle
    do_sleep()

    with screenshot_on_exception("log_in_not_add_widget"):
        assert_that(browser.url, ends_with('/#/add_widget'))
def log_in(*auth):
    delete_all_dashboards(*auth)
    add_empty_dashboard(*auth)

    log_in_clean(*auth)

    splinter_tests.visit("/#/add_widget")

    # Wait a moment for everything to settle
    do_sleep()

    with screenshot_on_exception("log_in_not_add_widget"):
        assert_that(browser.url, ends_with('/#/add_widget'))
예제 #4
0
def test_login_good_credentials():
    """
    When the user enters correct credentials, they go to Dashboard
    Creation.
    """
    # First, delete all the user's dashboards.
    utils.delete_all_dashboards('e2e_user', 'e2e_password', 'e2e_fqdn')

    browser = splinter_tests.browser
    # Need to first set the login page to use 'e2e_fqdn' as server URL
    splinter_tests.visit("#/login/e2e_fqdn")

    # Check that no error is on screen yet.
    assert browser.find_by_id("login_error").has_class("hide")

    browser.fill('username', 'e2e_user')
    browser.fill('password', 'e2e_password')

    browser.find_by_css('.btn.login-button').click()

    assert not browser.is_text_present("Username or password was incorrect.")

    assert_that(browser.url, ends_with("#/setup"))

    # Log out. To do this, we must click on the username in the top right, then
    # "Log out". Splinter seems to have trouble finding the link by text, so we
    # will have to find it by CSS...
    dropdown_css = ".nav.navbar-right > li.dropdown > a.dropdown-toggle"
    dropdown = browser.find_by_css(dropdown_css)
    assert not dropdown.is_empty()  # Make sure we found it

    dropdown.click()

    browser.find_link_by_text("Log out").click()

    assert_that(browser.url, ends_with("#/login"))
예제 #5
0
def test_login_good_credentials():
    """
    When the user enters correct credentials, they go to Dashboard
    Creation.
    """
    # First, delete all the user's dashboards.
    utils.delete_all_dashboards('e2e_user', 'e2e_password', 'e2e_fqdn')

    browser = splinter_tests.browser
    # Need to first set the login page to use 'e2e_fqdn' as server URL
    splinter_tests.visit("#/login/e2e_fqdn")

    # Check that no error is on screen yet.
    assert browser.find_by_id("login_error").has_class("hide")

    browser.fill('username', 'e2e_user')
    browser.fill('password', 'e2e_password')

    browser.find_by_css('.btn.login-button').click()

    assert not browser.is_text_present("Username or password was incorrect.")

    assert_that(browser.url, ends_with("#/setup"))

    # Log out. To do this, we must click on the username in the top right, then
    # "Log out". Splinter seems to have trouble finding the link by text, so we
    # will have to find it by CSS...
    dropdown_css = ".nav.navbar-right > li.dropdown > a.dropdown-toggle"
    dropdown = browser.find_by_css(dropdown_css)
    assert not dropdown.is_empty()  # Make sure we found it

    dropdown.click()

    browser.find_link_by_text("Log out").click()

    assert_that(browser.url, ends_with("#/login"))
def clear_dashboards(user="******",
                     password="******",
                     fqdn="e2e_fqdn"):
    delete_all_dashboards(user, password, fqdn)
def clear_dashboards(user="******", password="******",
                     fqdn="e2e_fqdn"):
    delete_all_dashboards(user, password, fqdn)