コード例 #1
0
    def test_main(self):
        first_name = 'matt'
        last_name = 'boyle'
        with driver_context() as driver:
            # Visit the test page
            test = self.config.get('web_hostname')
            driver.visit(test)

            # Initialize the page object
            hp = ExampleHomePage(driver_wrapper=driver)
            driver.assertion.assert_true(hp.is_page_loaded())

            # Retrieve the LoginForm component.
            lf = hp.get_login_form_component()
            lf.enter_first_name(first_name)
            lf.enter_last_name(last_name)
            lf.click_submit()

            # Confirm that first and last names are displayed
            display_first_name = hp.get_first_name_display()
            display_last_name = hp.get_last_name_display()

            driver.assertion.assert_equals(display_first_name, first_name,
                                           'first names did not match')
            driver.assertion.assert_equals(display_last_name, last_name,
                                           'first names did not match')
 def test_main(self):
     with driver_context() as driver:
         test = self.config.get('web_hostname')
         driver.visit(test)
         hp = ExampleHomePage(driver_wrapper=driver)
         driver.assertion.assert_true(hp.is_page_loaded())
         text = hp.get_hello_world_text()
         driver.assertion.assert_equals(text, "Hello world")
 def test_main(self):
     with driver_context() as driver:
         test = self.config.get('web_hostname')
         driver.visit(test)
         hp = ExampleHomePage(driver_wrapper=driver)
         driver.assertion.assert_true(hp.is_page_loaded())
         text = hp.get_hello_world_text()
         driver.assertion.assert_equals(text, "Hello world")
    def test_main(self):
        with driver_context() as driver:
            test = self.config.get('web_hostname')
            driver.visit(test)
            hp = ExampleHomePage(driver_wrapper=driver)
            driver.assertion.assert_true(hp.is_page_loaded())

            # Let's go to another page.
            # Notice how we interact with hp, then instantiate fp after we land on it
            hp.click_follow_me()
            fp = ExampleFollowPage(driver_wrapper=driver)
            driver.assertion.assert_true(fp.is_page_loaded())

            # Now. let's go back to the home page
            # Notice that we re-instantiate hp, as the original hp now has a stale DOM
            fp.click_go_back_link()
            hp = ExampleHomePage(driver_wrapper=driver)
            driver.assertion.assert_true(hp.is_page_loaded())
コード例 #5
0
    def test_main(self):
        with driver_context() as driver:
            test = self.config.get('web_hostname')
            driver.visit(test)
            hp = ExampleHomePage(driver_wrapper=driver)
            driver.assertion.assert_true(hp.is_page_loaded())

            # Let's go to another page.
            # Notice how we interact with hp, then instantiate fp after we land on it
            hp.click_follow_me()
            fp = ExampleFollowPage(driver_wrapper=driver)
            driver.assertion.assert_true(fp.is_page_loaded())

            # Now. let's go back to the home page
            # Notice that we re-instantiate hp, as the original hp now has a stale DOM
            fp.click_go_back_link()
            hp = ExampleHomePage(driver_wrapper=driver)
            driver.assertion.assert_true(hp.is_page_loaded())
コード例 #6
0
    def test_main(self):
        with driver_context() as driver:
            # Visit the test page
            test = self.config.get('web_hostname')
            driver.visit(test)

            # Initialize the page object
            hp = ExampleHomePage(driver_wrapper=driver)
            driver.assertion.assert_true(hp.is_page_loaded())

            # Demonstrate a failure of confirm_text_visible: we can't see it, because it's
            # currently set to display: none;
            try:
                hp.confirm_text_visible(timeout=5)
            except:
                print("Yep, can't see anything")

            # Click the button to expose the text, then try to read it again
            # This call succeeds.
            hp.click_see_me_button()
            hp.confirm_text_visible(timeout=5)
コード例 #7
0
    def test_main(self):
        first_name = 'matt'
        last_name = 'boyle'
        with driver_context() as driver:
            # Visit the test page
            test = self.config.get('web_hostname')
            driver.visit(test)

            # Initialize the page object
            hp = ExampleHomePage(driver_wrapper=driver)
            driver.assertion.assert_true(hp.is_page_loaded())

            # Retrieve the LoginForm component.
            lf = hp.get_login_form_component()
            lf.enter_first_name(first_name)
            lf.enter_last_name(last_name)
            lf.click_submit()

            # Confirm that first and last names are displayed
            display_first_name = hp.get_first_name_display()
            display_last_name = hp.get_last_name_display()

            driver.assertion.assert_equals(display_first_name, first_name, 'first names did not match')
            driver.assertion.assert_equals(display_last_name, last_name, 'first names did not match')