def search(self, search_string): "Enter a search" # We can call a mapped element by calling it's lambda function. self.search_field().send_keys(search_string) # The WTF_TIMEOUT_MANAGER is handy for inserting configurable waits. # In this case we're doing a brief pause to allow the type-ahead search to complete. WTF_TIMEOUT_MANAGER.brief_pause()
def search(self, search_string): "Enter a search" # We can call a mapped element by calling it's lambda function. self.search_field().send_keys(search_string) # The WTF_TIMEOUT_MANAGER is handy for inserting configurable waits. # In this case we're doing a brief pause to allow the type-ahead search to complete. WTF_TIMEOUT_MANAGER.brief_pause()
def test_smoke(self): driver = self.driver driver.get(self.base_url + "/src/index.html") WTF_TIMEOUT_MANAGER.brief_pause() res = driver.find_elements_by_xpath("//span[contains(text(), 'Application is Ready')]") self.assertTrue(len(res) > 0, "Application is Not Ready") driver.find_element_by_css_selector("p").click() res = driver.find_elements_by_xpath("//p[contains(text(), 'Text After Click')]") self.assertTrue(len(res) > 0, "Control Did Not Change State")