def testLandingPageLayout(self): """Test the landing page layout contains the elements we expect. This should include elements inherited from the base page, BASE_PAGE_ELEMENTS (defined in layout.py), as well as elements specific to the landing page, LANDING_PAGE_ELEMENTS. Please add to each list as the UI is modified to ensure this test stays up to date. """ self.driver.get(self.args.server_url + flask.url_for('landing')) landing_page = LandingPage(self.driver) for element_by_id in LandingPage.BASE_PAGE_ELEMENTS: base_page_element = landing_page.get_element(element_by_id) self.assertIsNotNone(base_page_element) self.assertTrue(base_page_element.is_displayed()) self.assertLogoLinksToLandingPage() for element_by_id in LandingPage.LANDING_PAGE_ELEMENTS: landing_page_element = landing_page.get_element(element_by_id) self.assertIsNotNone(landing_page_element) self.assertTrue(landing_page_element.is_displayed())
def testLandingPageLayout(self): """Test the landing page layout contains the elements we expect. This should include elements inherited from the base page, BASE_PAGE_ELEMENTS (defined in layout.py), as well as elements specific to the landing page, LANDING_PAGE_ELEMENTS. Please add to each list as the UI is modified to ensure this test stays up to date. """ self.driver.get(self.args.server_url + flask.url_for('landing')) landing_page = LandingPage(self.driver) for element_by_id in LandingPage.BASE_PAGE_ELEMENTS: base_page_element = landing_page.get_element(element_by_id) self.assertIsNotNone(base_page_element) self.assertTrue(base_page_element.is_displayed()) self.assertLogoLinksToLandingPage() for element_by_id in LandingPage.LANDING_PAGE_ELEMENTS: landing_page_element = landing_page.get_element(element_by_id) self.assertIsNotNone(landing_page_element) self.assertTrue(landing_page_element.is_displayed())
def assertTestServerPresenceOnPage( self, is_present, go_to_landing=True, name=TEST_SERVER_AS_DICT['name']): """Helper to assert whether a server is present on the landing page. Args: is_present: True for the server is present and false for not present. go_to_landing: True to get the landing page again (effectively a refresh if the page is already on the landing) and False to use whatever page the test is already on. name: The name of the server to assert upon, which defaults to the test server. """ if go_to_landing: self.driver.get(self.args.server_url + flask.url_for('landing')) landing_page = LandingPage(self.driver) server_list = landing_page.get_element(LandingPage.SERVER_LIST_ITEM) server_listbox = server_list.find_element(*LandingPage.GENERIC_LISTBOX) test_server_item = landing_page.findItemInListing(server_listbox, name) if is_present: self.assertIsNotNone(test_server_item) self.assertTrue(test_server_item.is_displayed()) else: self.assertIsNone(test_server_item)