Fix for Webtest
authorRohan Katkar <rohan.katkar@webaccessglobal.com>
Wed, 17 Dec 2014 13:31:55 +0000 (19:01 +0530)
committerRohan Katkar <rohan.katkar@webaccessglobal.com>
Wed, 17 Dec 2014 13:31:55 +0000 (19:01 +0530)
tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php
tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php
tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php

index 401b2e508bba360cd304102a569b383daf845b76..20eab9455b73c2d7a4678c3dee6fd5d5ccf3bc28 100644 (file)
@@ -57,8 +57,8 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     $texts = array(
       "Title - New Membership $hash",
       "This is introductory message for $pageTitle",
-      '$ 50.00 Student',
-      "$ $rand.00 Label $hash",
+      'Student - $ 50.00',
+      "Label $hash - $ $rand.00",
       "Pay later label $hash",
       'Organization Details',
       'Other Amount',
@@ -68,6 +68,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     );
     foreach ($texts as $text) {
       $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
+      $this->waitForAjaxContent();
     }
 
     // Disable and re-enable Other Amounts (verify fix for CRM-15021)
@@ -125,8 +126,8 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     $texts = array(
       "Title - New Membership $hash",
       "This is introductory message for $pageTitle",
-      '$ 50.00 Student',
-      "$ $rand.00 Label $hash",
+      'Student - $ 50.00',
+      "Label $hash - $ $rand.00",
       "Pay later label $hash",
       'Organization Details',
       'Other Amount',
@@ -136,6 +137,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     );
     foreach ($texts as $text) {
       $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
+      $this->waitForAjaxContent();
     }
   }
 
@@ -171,7 +173,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     $texts = array(
       "Title - New Membership $hash",
       "This is introductory message for $pageTitle",
-      "$ $rand.00 Label $hash",
+      "Label $hash - $ $rand.00",
       "Pay later label $hash",
       'Organization Details',
       'Other Amount',
@@ -181,6 +183,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     );
     foreach ($texts as $text) {
       $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
+      $this->waitForAjaxContent();
     }
   }
 
index 85342bfb95f3927c6b0e56d8113deecdf0b83d0b..8c474032e0b9ccf5c06593030e5bcce6e400062d 100644 (file)
@@ -196,7 +196,7 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase {
     // Select membership type 1
     $this->waitForElementPresent("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label");
     if ($memTypeId != 'No thank you') {
-    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'$memTypeId')]");
+    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//div/span/label/span[1][contains(text(),'$memTypeId')]");
     }
 
     else {
index c377eb8dbf87e94c6c21523c6740c3c0ed46fdc1..2704d3e1756119eb9f520489d4ba5e04b91e67e5 100644 (file)
@@ -101,7 +101,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     //Go to online membership signup page
     $this->openCiviPage("contribute/transact", "reset=1&id=2", "_qf_Main_upload-bottom");
 
-    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
+    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]/div[2]/span/label/span[1][contains(text(),'Student')]");
 
     //Type first name and last name and email
     $this->type("first_name", $firstName);
@@ -158,7 +158,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
 
     $this->openCiviPage("contribute/transact", "reset=1&id=2", "_qf_Main_upload-bottom");
 
-    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
+    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]/div[2]/span/label/span[1][contains(text(),'Student')]");
 
     //Type first name and last name and email
     $this->type("first_name", $firstName);
@@ -270,7 +270,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
 
     //Go to online membership signup page
     $this->openCiviPage("contribute/transact", "reset=1&id=2", "_qf_Main_upload-bottom");
-    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'General')]");
+    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]/div[1]/span/label/span[1][contains(text(),'General')]");
     //Type first name and last name
     $this->type("first_name", $firstName);
     $this->type("last_name", $lastName);
@@ -322,7 +322,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
       );
     }
     $this->openCiviPage("contribute/transact", "reset=1&id=2", "_qf_Main_upload-bottom");
-    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
+    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]/div[2]/span/label/span[1][contains(text(),'Student')]");
 
     //Credit Card Info
     $this->select("credit_card_type", "value=Visa");
@@ -479,7 +479,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
 
     //get Url for Live Contribution Page
     $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", '_qf_Main_upload-bottom');
-    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'$membershipTypeTitle')]");
+    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]/div/span/label/span[1][contains(text(),'$membershipTypeTitle')]");
     $firstName = 'Eia' . substr(sha1(rand()), 0, 4);
     $lastName = 'Ande' . substr(sha1(rand()), 0, 4);
     $name = $firstName . ' ' . $lastName;
@@ -574,7 +574,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
 
     $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom");
 
-    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'$membershipTypeTitle')]");
+    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]/div/span/label/span[1][contains(text(),'$membershipTypeTitle')]");
     $this->type("email-5", $email);
     $this->click('is_for_organization');
     $this->type('onbehalf_organization_name', $organisationName);