示例#1
0
def test_translations(web_fixture, translation_example_fixture):
    """The user can choose between languages. The text for which translations exist change accordingly."""

    browser = translation_example_fixture.browser
    browser.open('/')
    assert browser.is_element_present(XPath.heading(1).with_text("Addresses"))
    assert browser.is_element_present(XPath.label().with_text("Name"))

    #go to the the translated page
    browser.click(XPath.link().with_text('Afrikaans'))
    assert browser.is_element_present(XPath.heading(1).with_text("Adresse"))
    assert browser.is_element_present(XPath.label().with_text("Naam"))
 def heading_is_displayed(self):
     return self.browser.is_element_present(
         XPath.heading(1).with_text('Addresses'))
示例#3
0
 def check(browser):
     assert browser.is_element_present(
         XPath.heading(1).with_text('An error occurred:').inside_of(
             XPath.div()))
示例#4
0
 def check(browser):
     assert browser.is_element_present(
         XPath.heading(1).with_text('My custom error page'))
示例#5
0
 def with_custom_error_page(self):
     self.root_ui = BreakingUIWithCustomErrorPage
     self.expected_error_text = 'Oops, something broke'
     self.error_element = XPath.heading(1)