Exemplo n.º 1
0
def test_google_plus_link(player_wizard, browser):  # noqa
    """As a player, navbar footer links to google +."""
    print('As a player, navbar footer links to google +.')
    footer = Footer(browser)

    WebDriverWait(browser, DEFAULT_WAIT_TIME).until(
        EC.element_to_be_clickable((By.ID, footer.google_plus_id)))

    app_window = browser.window_handles[0]

    footer.google_plus.click()

    WebDriverWait(browser,
                  DEFAULT_WAIT_TIME).until(EC.number_of_windows_to_be(2))

    for handle in browser.window_handles:
        if handle.title() != app_window.title():
            browser.switch_to_window(handle)
            continue

    WebDriverWait(browser, DEFAULT_WAIT_TIME).until(
        url_in_new_tab_matches(
            'https://plus.google.com/105624626079092258118'))

    assert browser.current_url.strip(
    ) == 'https://plus.google.com/105624626079092258118'
Exemplo n.º 2
0
def test_ogl_link(player_wizard, browser):  # noqa
    """As a player, navbar footer links to ogl."""
    print('As a player, navbar footer links to ogl.')
    footer = Footer(browser)

    WebDriverWait(browser, DEFAULT_WAIT_TIME).until(
        EC.element_to_be_clickable((By.ID, footer.ogl_id)))

    app_window = browser.window_handles[0]

    footer.ogl.click()

    WebDriverWait(browser,
                  DEFAULT_WAIT_TIME).until(EC.number_of_windows_to_be(2))

    for handle in browser.window_handles:
        if handle.title() != app_window.title():
            browser.switch_to_window(handle)
            continue

    WebDriverWait(browser, DEFAULT_WAIT_TIME).until(
        url_in_new_tab_matches(
            'http://media.wizards.com/2016/downloads/DND/SRD-OGL_V5.1.pdf'))

    ogl = 'http://media.wizards.com/2016/downloads/DND/SRD-OGL_V5.1.pdf'

    assert browser.current_url.strip() == ogl
Exemplo n.º 3
0
def test_reddit_link(player_wizard, browser):  # noqa
    """As a player, navbar footer links to reddit."""
    print('As a player, navbar footer links to reddit.')
    footer = Footer(browser)

    WebDriverWait(browser, DEFAULT_WAIT_TIME).until(
        EC.element_to_be_clickable((By.ID, footer.reddit_id)))

    app_window = browser.window_handles[0]

    footer.reddit.click()

    WebDriverWait(browser,
                  DEFAULT_WAIT_TIME).until(EC.number_of_windows_to_be(2))

    for handle in browser.window_handles:
        if handle.title() != app_window.title():
            browser.switch_to_window(handle)
            continue

    WebDriverWait(browser, DEFAULT_WAIT_TIME).until(
        url_in_new_tab_matches('https://www.reddit.com/r/adventurerscodex/'))

    assert browser.current_url.strip(
    ) == 'https://www.reddit.com/r/adventurerscodex/'
Exemplo n.º 4
0
def test_rss_link(player_wizard, browser):  # noqa
    """As a player, navbar footer links to rss."""
    print('As a player, navbar footer links to rss.')
    footer = Footer(browser)

    WebDriverWait(browser, DEFAULT_WAIT_TIME).until(
        EC.element_to_be_clickable((By.ID, footer.rss_id)))

    app_window = browser.window_handles[0]

    footer.rss.click()

    WebDriverWait(browser,
                  DEFAULT_WAIT_TIME).until(EC.number_of_windows_to_be(2))

    for handle in browser.window_handles:
        if handle.title() != app_window.title():
            browser.switch_to_window(handle)
            continue

    # safari does not have an rss reader
    if browser.name != 'safari':

        WebDriverWait(browser, DEFAULT_WAIT_TIME).until(
            url_in_new_tab_matches('https://adventurerscodex.com/feed.xml'))

        assert browser.current_url.strip(
        ) == 'https://adventurerscodex.com/feed.xml'
Exemplo n.º 5
0
def test_tiny_letter_link(player_wizard, browser):  # noqa
    """As a player, navbar footer links to tiny letter."""
    print('As a player, navbar footer links to tiny letter.')
    footer = Footer(browser)

    footer.tiny_letter.click()
    WebDriverWait(browser, 20).until(EC.number_of_windows_to_be(2))
    browser.switch_to.window(browser.window_handles[1])
    WebDriverWait(browser, 20).until(
        url_in_new_tab_matches('https://tinyletter.com/adventurerscodex'))

    assert browser.current_url == 'https://tinyletter.com/adventurerscodex'
Exemplo n.º 6
0
def test_patreon_link(player_wizard, browser):  # noqa
    """As a player, navbar footer links to patreon."""
    print('As a player, navbar footer links to patreon.')
    footer = Footer(browser)

    footer.patreon.click()
    WebDriverWait(browser, 20).until(EC.number_of_windows_to_be(2))
    browser.switch_to.window(browser.window_handles[1])
    WebDriverWait(browser, 20).until(
        url_in_new_tab_matches('https://www.patreon.com/bePatron?u=5313385'))

    assert browser.current_url == 'https://www.patreon.com/bePatron?u=5313385'
Exemplo n.º 7
0
def test_google_plus_link(player_wizard, browser):  # noqa
    """As a player, navbar footer links to google +."""
    print('As a player, navbar footer links to google +.')
    footer = Footer(browser)

    footer.google_plus.click()
    WebDriverWait(browser, 20).until(EC.number_of_windows_to_be(2))
    browser.switch_to.window(browser.window_handles[1])
    WebDriverWait(browser, 20).until(
        url_in_new_tab_matches(
            'https://plus.google.com/105624626079092258118'))

    assert browser.current_url == 'https://plus.google.com/105624626079092258118'
Exemplo n.º 8
0
def test_ogl_link(player_wizard, browser):  # noqa
    """As a player, navbar footer links to ogl."""
    print('As a player, navbar footer links to ogl.')
    footer = Footer(browser)

    footer.ogl.click()
    WebDriverWait(browser, 20).until(EC.number_of_windows_to_be(2))
    browser.switch_to.window(browser.window_handles[1])
    WebDriverWait(browser, 20).until(
        url_in_new_tab_matches(
            'http://media.wizards.com/2016/downloads/DND/SRD-OGL_V5.1.pdf'))

    assert browser.current_url == 'http://media.wizards.com/2016/downloads/DND/SRD-OGL_V5.1.pdf'