Skip to content

Instantly share code, notes, and snippets.

@GabiThume
Last active December 17, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GabiThume/5623233 to your computer and use it in GitHub Desktop.
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.
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
Copy link
Author

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