def find(self, locator): if self.__find_element_by_name(locator): return Element(self) if self.__find_element_by_id(locator): return Element(self) else: return None
def click_button(self, locator): if self.__find_element_by_id(locator): self.current_element.submit() return Element(self) if self.__find_element_by_name(locator): self.current_element.submit() return Element(self) else: return None
def test_set_WhenValidTextIsSet_ThenDriverSetsProperText(self): # arrange stub_driver = FakeDriver() element = Element(stub_driver) # act element.set('valid text') # assert assert_that(stub_driver.stub_set, is_('valid text'))
def test_set_WhenValidTextIsSet_ThenDriverSetsProperText(self): # arrange stub_driver = FakeDriver() element = Element(stub_driver) # act element.set('valid text') # assert assert_that(stub_driver.stub_set, is_('valid text'))
def find(self, locator): element = Element(self) element.id = locator return element
def find(self, locator): element = Element(self) element.id = locator return element
def click_link(self, locator): if self.__find_element_by_link_text(locator): self.current_element.click() return Element(self) else: return None