From 9a3c0f5c5f6a90c344406d40527ccbba25c827bf Mon Sep 17 00:00:00 2001 From: t4rk1n Date: Fri, 28 Dec 2018 17:19:01 -0500 Subject: [PATCH] :hammer: Improve wait_for_text_to_equal --- test/test_integration.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/test_integration.py b/test/test_integration.py index d0e1cd25b..ee62e7976 100644 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -57,13 +57,13 @@ def wait_for_element_by_css_selector(self, selector): ) def wait_for_text_to_equal(self, selector, assertion_text): + + def text_equal(driver): + return driver.find_element_by_css_selector(selector).text \ + == assertion_text + WebDriverWait(self.driver, TIMEOUT).until( - EC.text_to_be_present_in_element((By.CSS_SELECTOR, selector), - assertion_text) - ) - self.assertEqual( - assertion_text, - self.driver.find_element_by_css_selector(selector).text + text_equal ) def snapshot(self, name):