From 0c171b8bc6914d7ffda22859fbcf9eebde04562a Mon Sep 17 00:00:00 2001 From: Marc Christensen Date: Mon, 27 Sep 2010 14:49:57 -0600 Subject: [PATCH] Fixes for failed tests --- .../apache/blogengine/be_0400_createUserTest.py | 8 +++++++- .../be_1100_ChangeUserProfileAsMonoUserTest.py | 13 +++++++++---- selenium/apache/blogengine/be_1200_cleanUpTest.py | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) mode change 100644 => 100755 selenium/apache/blogengine/be_1100_ChangeUserProfileAsMonoUserTest.py diff --git a/selenium/apache/blogengine/be_0400_createUserTest.py b/selenium/apache/blogengine/be_0400_createUserTest.py index 4992e1c..7aa72d1 100755 --- a/selenium/apache/blogengine/be_0400_createUserTest.py +++ b/selenium/apache/blogengine/be_0400_createUserTest.py @@ -27,7 +27,13 @@ class be_0400_createUserTest(apacheTestCase): sel.type("ctl00_cphAdmin_CreateUserWizard1_ctl02_Password", "mono") sel.type("ctl00_cphAdmin_CreateUserWizard1_ctl02_ConfirmPassword", "mono") sel.type("ctl00_cphAdmin_CreateUserWizard1_ctl02_Email", "mono@example.com") - sel.click("ctl00_cphAdmin_CreateUserWizard1_CustomNavContainer0_StepNextButtonButton") + if sel.is_element_present("ctl00_cphAdmin_CreateUserWizard1_CustomNavContainer0_StepNextButtonButton"): + element = "ctl00_cphAdmin_CreateUserWizard1_CustomNavContainer0_StepNextButtonButton" + elif sel.is_element_present("ctl00_cphAdmin_CreateUserWizard1_CustomNavigationTemplateContainerID0_StepNextButtonButton"): + element = "ctl00_cphAdmin_CreateUserWizard1_CustomNavigationTemplateContainerID0_StepNextButtonButton" + else: + element = "ctl00_cphAdmin_CreateUserWizard1_CustomNavContainer0_StepNextButtonButton" + sel.click(element) sel.wait_for_page_to_load("30000") except Exception,e: diff --git a/selenium/apache/blogengine/be_1100_ChangeUserProfileAsMonoUserTest.py b/selenium/apache/blogengine/be_1100_ChangeUserProfileAsMonoUserTest.py old mode 100644 new mode 100755 index e46d16e..4cf1217 --- a/selenium/apache/blogengine/be_1100_ChangeUserProfileAsMonoUserTest.py +++ b/selenium/apache/blogengine/be_1100_ChangeUserProfileAsMonoUserTest.py @@ -23,18 +23,23 @@ class be_1100_ChangeUserProfileAsMonoUserTest(apacheTestCase): sel.wait_for_page_to_load("30000") for i in range(60): try: - if sel.is_element_present("//a/span[text()='profiles']"): break + if sel.is_element_present("//a/span[text()='profiles']"): + element_1 = "//a/span[text()='profiles']" + break + elif sel.is_element_present("//a/span[text()='Profiles']") : + element_1 = "//a/span[text()='Profiles']" + break except: pass time.sleep(1) - else: self.fail("time out") - sel.click("//a/span[text()='profiles']") + else: self.fail("time out" + "Could not find element" + element_1) + sel.click(element_1) sel.wait_for_page_to_load("30000") for i in range(60): try: if sel.is_element_present("//input[@id='ctl00_cphAdmin_tbDisplayName']"): break except: pass time.sleep(1) - else: self.fail("time out") + else: self.fail("time out" + "Could not find element //input[@id='ctl00_cphAdmin_tbDisplayName']") sel.type("//input[@id='ctl00_cphAdmin_tbDisplayName']", "Mono User") sel.type("ctl00_cphAdmin_tbFirstName", "Mono") sel.type("ctl00_cphAdmin_tbFirstName", "Rupert") diff --git a/selenium/apache/blogengine/be_1200_cleanUpTest.py b/selenium/apache/blogengine/be_1200_cleanUpTest.py index 72820b0..5df4bc9 100755 --- a/selenium/apache/blogengine/be_1200_cleanUpTest.py +++ b/selenium/apache/blogengine/be_1200_cleanUpTest.py @@ -56,7 +56,7 @@ class be_1200_cleanUpTest(apacheTestCase): else: self.fail("time out") sel.click("//a/span[text()='Categories']") sel.wait_for_page_to_load("30000") - sel.click("//table[@class='category']/tbody/tr/td[normalize-space(text())='Mono']/preceding-sibling::td/a[text()='Delete']") + sel.click("//tbody/tr/td[normalize-space(text())='Mono']/preceding-sibling::td/a[text()='Delete']") sel.wait_for_page_to_load("30000") ############ mono.log("Delete the Mono Page")