示例#1
0
def test_signup():

    browser.open('/')
    page = Page()
    assert page.offers_signup_link
    page.click_signup_link()

    page = Signup()
    assert page.offers_signup_form
    foo = page.signup_form
    foo.fill(dict(username='******', password='******'))
    foo.submit()
    assert not page.offers_signup_link
示例#2
0
def test_home_loads():
    browser.open('/')
    page = Page()
    assert 'Cockerel' in page.title

    assert page.offers_signup_link
    assert page.offers_login_link
示例#3
0
class UserDetailsPage(Page):
    PATH = "/users/{0}"

    ROOT = {"method": By.XPATH, "key": Page.get_xpath_visible('//div[@id="user-page"]')}

    def __init__(self, driver, nickname):
        Page.__init__(self, driver)
        self.open(nickname)

    @property
    def form(self):
        return UserDetailsSubscribeForm(self.driver)
示例#4
0
def test_login():
    browser.open('/')
    page = Page()
    assert page.offers_login_link
    page.click_login_link()
    page = Login()
    assert page.offers_login_form
    login = page.login_form
    login.fill(dict(username='******', password='******'))
    page.click_submit()
    assert not page.offers_login_form
示例#5
0
class BoardPage(Page):
    PATH = "/board/{0}"

    ROOT = {
        "method": By.XPATH,
        "key": Page.get_xpath_visible('//div[@id="board-page"]'),
    }

    def __init__(self, driver, board_id):
        Page.__init__(self, driver)
        self.open(board_id)

    @property
    def form(self):
        return BoardForm(self.driver)
示例#6
0
class PinDetailsPage(Page):
    PATH = "/pin/{0}"

    ROOT = {
        "method": By.XPATH,
        "key": Page.get_xpath_visible('//div[@id="viewpin-page"]'),
    }

    def __init__(self, driver, open=True, pin_id=""):
        Page.__init__(self, driver)
        if open:
            self.open(pin_id)

    @property
    def form(self):
        return PinForm(self.driver)
示例#7
0
def test_login():
    browser.open('/')
    page = Page()
    assert page.offers_login_link
    page.click_login_link()
    page = Login()
    assert page.offers_login_form
    login = page.login_form
    login.fill(dict(username='******',
                    password='******'))
    page.click_submit()
    assert not page.offers_login_form
示例#8
0
class GlobalSearchPage(Page):
    ROOT = {
        "method": By.XPATH,
        "key": Page.get_xpath_visible('//div[@id="search-page"]'),
    }

    def __init__(self, driver, open=True):
        Page.__init__(self, driver)
        if open:
            self.open()

    @property
    def search_form(self):
        return HeaderSearchForm(self.driver)

    @property
    def result_form(self):
        return SearchResultsForm(self.driver)
示例#9
0
class CreatePinPage(Page):
    PATH = "/create_pin"

    ROOT = {
        "method": By.XPATH,
        "key": Page.get_xpath_visible('//div[@id="createpin-page"]'),
    }

    def __init__(self, driver):
        Page.__init__(self, driver)
        self.open()

    @property
    def form_list(self):
        return FindCreatePinForm(self.driver)

    @property
    def form_concrete(self):
        return ConcreteUserMessagesForm(self.driver)
示例#10
0
class ChatPage(Page):
    PATH = "/dialog"

    ROOT = {
        "method": By.XPATH,
        "key": Page.get_xpath_visible('//div[@id="dialogview-page"]'),
    }

    def __init__(self, driver):
        Page.__init__(self, driver)
        self.open()

    @property
    def form_list(self):
        return FindCompanyForm(self.driver)

    @property
    def form_concrete(self):
        return ConcreteUserMessagesForm(self.driver)
示例#11
0
class EditPinPage(Page):
    PATH = "/pin_change/{0}"

    ROOT = {
        "method": By.XPATH,
        "key": Page.get_xpath_visible('//div[@id="pinediting-page"]'),
    }

    def __init__(self, driver, pin_id):
        Page.__init__(self, driver)
        self.open(pin_id)

    @property
    def form_list(self):
        return FindEditPinForm(self.driver)

    @property
    def form_concrete(self):
        return ConcreteUserMessagesForm(self.driver)
示例#12
0
 def __init__(self, driver, pin_id):
     Page.__init__(self, driver)
     self.open(pin_id)
示例#13
0
 def __init__(self, driver, board_id):
     Page.__init__(self, driver)
     self.open(board_id)
示例#14
0
 def __init__(self, driver, open=True):
     Page.__init__(self, driver)
     if open:
         self.open()
示例#15
0
 def __init__(self, driver):
     Page.__init__(self, driver)
     self.open()
示例#16
0
 def __init__(self, driver, nickname):
     Page.__init__(self, driver)
     self.open(nickname)
示例#17
0
 def __init__(self, driver, open=True, pin_id=""):
     Page.__init__(self, driver)
     if open:
         self.open(pin_id)