def test_enter_text(): find = MockFinder() interact = Interactor(None, find, None, None, None) page_element = PageElement(By.ID, "test-id") interact.enter_text(page_element, "abcd", False) assert_that(find.mock_element.text, equal_to("abcd"), "Text not sent to element correctly")
def test_enter_text_clears_first(): find = MockFinder() interact = Interactor(None, find, None, None, None) page_element = PageElement(By.ID, "test-id") find.mock_element.text = "1234" interact.enter_text(page_element, "abcd", True) assert_that(find.mock_element.text, equal_to("abcd"), "Text not cleared before sending")