Fetching contributors…
Cannot retrieve contributors at this time
26 lines (18 sloc) 924 Bytes
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at
import selenium
class BrowserID(object):
VERIFY_URL_REGEX = 'https?:\/\/(\S+)\/verify_email_address\?token=(.{48})'
CONFIRM_URL_REGEX = 'https?:\/\/(\S+)\/confirm\?token=(.{48})'
RESET_URL_REGEX = 'https?:\/\/(\S+)\/reset_password\?token=(.{48})'
INCLUDE_URL_REGEX = '(https?:\/\/(\S+))\/include\.js'
def __init__(self, selenium, timeout=60):
self.selenium = selenium
self.timeout = timeout
def sign_in(self, email, password):
"""Signs in using the specified email address and password."""
from pages.sign_in import SignIn
sign_in = SignIn(self.selenium, timeout=self.timeout, expect='new')
sign_in.sign_in(email, password)