Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A simple test using the PageElements
from import WebDriverWait
import pages
def test_login_with_invalid_credentials(login_url):
driver = get_browser()
login_page = pages.LoginPage(driver)
# Can't use this method here since we want to actually test the various aspects of
# logging in and failing to log in
# login_page.login() - Use this in other tests where you just need to login to do the
# test
login_page.username = XXXXXXXX
login_page.password = XXXXXXXX
assert(login_page.error_message.text == 'Invalid email or password. Please try again.')
assert(driver.current_url == login_url)
finally:'Quitting browser')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment