From 2e63b3f1d91f7a9f6df494cb6169251f8ec8076f Mon Sep 17 00:00:00 2001 From: Emily O'Leary Date: Fri, 13 Sep 2013 17:19:19 -0400 Subject: [PATCH] Reverted changes to upload and collection. Issue existed in login/logout. Fixed. --- tests/util/collection.py | 2 +- tests/util/login.py | 9 +++++---- tests/util/logout.py | 9 +++++---- tests/util/upload.py | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/util/collection.py b/tests/util/collection.py index 7b91607..15ca820 100644 --- a/tests/util/collection.py +++ b/tests/util/collection.py @@ -37,7 +37,7 @@ class Collection(): driver = self.driver tLogin = login.Login() - tLogin.log_in(testharness, data) + tLogin.log_in(self, data) testharness = unittest.FunctionTestCase(self) driver.get(self.base_url + "/") diff --git a/tests/util/login.py b/tests/util/login.py index 041b21c..ec286ac 100644 --- a/tests/util/login.py +++ b/tests/util/login.py @@ -27,6 +27,7 @@ class Login(): self.base_url = external.base_url self.verificationErrors = [] self.accept_next_alert = True + testharness = unittest.FunctionTestCase(self) driver = self.driver driver.get(self.base_url + "/") driver.find_element_by_link_text("Log in").click() @@ -35,11 +36,11 @@ class Login(): driver.find_element_by_id("password").clear() driver.find_element_by_id("password").send_keys(data["password"]) # Warning: verifyTextPresent may require manual changes - try: external.assertRegexpMatches(driver.find_element_by_css_selector("BODY").text, r"^[\s\S]*Log in[\s\S]*$") + try: testharness.assertRegexpMatches(driver.find_element_by_css_selector("BODY").text, r"^[\s\S]*Log in[\s\S]*$") except AssertionError as e: self.verificationErrors.append(str(e)) - external.assertTrue(util.is_element_present(self,By.ID, "username")) - external.assertTrue(util.is_element_present(self,By.ID, "password")) + testharness.assertTrue(util.is_element_present(self,By.ID, "username")) + testharness.assertTrue(util.is_element_present(self,By.ID, "password")) driver.find_element_by_css_selector("input.button_form").click() driver.find_element_by_css_selector("div.button_action.header_dropdown_down").click() - external.assertTrue(util.is_element_present(self,By.LINK_TEXT, data["username"])) + testharness.assertTrue(util.is_element_present(self,By.LINK_TEXT, data["username"])) diff --git a/tests/util/logout.py b/tests/util/logout.py index beff76a..acbe4fa 100644 --- a/tests/util/logout.py +++ b/tests/util/logout.py @@ -27,13 +27,14 @@ class LogOut(): self.base_url = external.base_url self.verificationErrors = [] self.accept_next_alert = True + testharness = unittest.FunctionTestCase(self) driver = self.driver driver.get(self.base_url + "/") - external.assertTrue(util.is_element_present(self,By.CSS_SELECTOR, "div.button_action.header_dropdown_down")) + testharness.assertTrue(util.is_element_present(self,By.CSS_SELECTOR, "div.button_action.header_dropdown_down")) driver.find_element_by_css_selector("div.button_action.header_dropdown_down").click() - external.assertTrue(util.is_element_present(self,By.LINK_TEXT, "Log out")) + testharness.assertTrue(util.is_element_present(self,By.LINK_TEXT, "Log out")) driver.find_element_by_link_text("Log out").click() - try: external.assertTrue(util.is_element_present(self,By.LINK_TEXT, "Create an account at this site")) + try: testharness.assertTrue(util.is_element_present(self,By.LINK_TEXT, "Create an account at this site")) except AssertionError as e: self.verificationErrors.append(str(e)) - try: external.assertTrue(util.is_element_present(self,By.LINK_TEXT, "Log in")) + try: testharness.assertTrue(util.is_element_present(self,By.LINK_TEXT, "Log in")) except AssertionError as e: self.verificationErrors.append(str(e)) diff --git a/tests/util/upload.py b/tests/util/upload.py index e11d909..b62973b 100644 --- a/tests/util/upload.py +++ b/tests/util/upload.py @@ -38,7 +38,7 @@ class UploadFile(): tLogin = login.Login() testharness = unittest.FunctionTestCase(self) - tLogin.log_in(testharness, data) + tLogin.log_in(self, data) driver.get(self.base_url + "/") driver.find_element_by_css_selector("div.button_action.header_dropdown_down").click() testharness.assertTrue(util.is_element_present(self,By.LINK_TEXT, "Add media")) -- 2.1.4