Last active
December 17, 2015 14:19
-
-
Save GabiThume/5623233 to your computer and use it in GitHub Desktop.
Functional test for ticket http://issues.mediagoblin.org/ticket/689 using Selenium WebDriver.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
from selenium import webdriver | |
def test_forgot_password(): | |
drivers = [] | |
drivers.append(webdriver.Firefox()) | |
drivers.append(webdriver.Chrome()) | |
for driver in drivers: | |
driver.get("http://127.0.0.1:6543/auth/login") | |
assert "MediaGoblin" in driver.title | |
forgot_password = driver.find_element_by_id('forgot_password') | |
forgot_password.click() | |
driver.close() | |
try: | |
assert "http://127.0.0.1:6543/auth/forgot_password/?username" in driver.current_url | |
except Exception: | |
pytest.xfail("Problem while testing forgot_password form using %s browser" %(driver.capabilities['browserName'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I updated to include Chrome browser. To see xfail message, run pytest with -rx option.