Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Functional test for ticket http://issues.mediagoblin.org/ticket/689 using Selenium WebDriver.
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']))
@GabiThume

This comment has been minimized.

Copy link
Owner Author

@GabiThume GabiThume commented May 22, 2013

I updated to include Chrome browser. To see xfail message, run pytest with -rx option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment