def test_elements_logs_out_info(): driver = MockDriver() logger = MagicMock() find = Finder(driver, logger) find.elements(PageElement(By.ID, "test-id")) assert_that(logger.info.call_count, equal_to(2), "Two messages should have been logged") logger.info.assert_any_call( "Looking for elements matching PageElement id='test-id'") logger.info.assert_any_call("Found 1 element(s)")
def test_elements(): driver = MockDriver() find = Finder(driver, None) elements = find.elements(PageElement(By.ID, "test-id")) assert_that(elements[0].info, equal_to("elements found by 'id' using value 'test-id'"), "An element list should be found")