Webtests fix
authorWeb Access <rohan.katkar@webaccessglobal.com>
Wed, 4 May 2016 13:20:34 +0000 (18:50 +0530)
committerWeb Access <rohan.katkar@webaccessglobal.com>
Wed, 4 May 2016 13:20:34 +0000 (18:50 +0530)
tests/phpunit/WebTest/Campaign/OnlineContributionTest.php
tests/phpunit/WebTest/Contribute/OnlineContributionTest.php
tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php

index 1efe15efb8b0a12438cd26fb32d4f31dbc17a5b2..09ec9e4a1686e92aad19da7ab4b6ac432576d7ce 100644 (file)
@@ -301,7 +301,7 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase {
     $this->clickLink("_qf_Search_refresh", "xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span//a[text()='View']", FALSE);
     $this->clickLink("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span//a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE);
     //View Contribution Record
-    $this->verifyText("xpath=id('ContributionView')/div[2]/table[1]/tbody/tr[11]/td[2]", preg_quote($campaignTitle));
+    $this->assertElementContainsText("xpath=//table[@class='crm-info-panel']/tbody/tr[11]/td[2]", $campaignTitle);
   }
 
 }
index 8e01aa29766391e303bfdbcbb3f376cd258c4d4b..93bcb4f1ed9a675baba5b377cb22b799f2123ce7 100644 (file)
@@ -131,17 +131,16 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
     $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
-
-    $this->waitForElementPresent("xpath=//div[@class='crm-section no-label billing_name-section']");
-    $this->assertElementContainsText("xpath=//div[@class='crm-section no-label billing_name-section']", $firstName . "billing");
-    $this->assertElementContainsText("xpath=//div[@class='crm-section no-label billing_name-section']", $lastName . "billing");
+    $this->waitForElementPresent("xpath=//div[@class='crm-group billing_name_address-group']//div[@class='crm-section no-label billing_name-section']");
+    $this->assertElementContainsText("xpath=//div[@class='crm-group billing_name_address-group']//div[@class='crm-section no-label billing_name-section']", $firstName . "billing");
+    $this->assertElementContainsText("xpath=//div[@class='crm-group billing_name_address-group']//div[@class='crm-section no-label billing_name-section']", $lastName . "billing");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->waitForElementPresent("xpath=//div[@class='crm-section no-label billing_name-section']");
-    $this->assertElementContainsText("xpath=//div[@class='crm-section no-label billing_name-section']", $firstName . "billing");
-    $this->assertElementContainsText("xpath=//div[@class='crm-section no-label billing_name-section']", $lastName . "billing");
+    $this->waitForElementPresent("xpath=//div[@class='crm-group billing_name_address-group']//div[@class='crm-section no-label billing_name-section']");
+    $this->assertElementContainsText("xpath=//div[@class='crm-group billing_name_address-group']//div[@class='crm-section no-label billing_name-section']", $firstName . "billing");
+    $this->assertElementContainsText("xpath=//div[@class='crm-group billing_name_address-group']//div[@class='crm-section no-label billing_name-section']", $lastName . "billing");
 
     //login to check contribution
 
@@ -490,6 +489,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
     $this->type("sort_name", "$lastName $firstName");
     $this->multiselect2('contribution_product_id', array('Coffee Mug'));
     $this->click("_qf_Search_refresh");
+    $this->waitForAjaxContent();
     $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']/tbody//tr/td[10]/span//a[text()='View']");
     $this->click("xpath=//table[@class='selector row-highlight']/tbody//tr/td[2]/a[text()='{$lastName}, {$firstName}']/../../td[10]/span//a[text()='View']");
     $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]");
index 8ebd8dc4296438a33e2c252ef04a3297e00161c6..9da465dae259883da204ee3dccff7721b88e37e1 100644 (file)
@@ -44,6 +44,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium
     $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
 
     $this->type("sort_name", "Individual");
+    $this->waitForElementPresent("contribution_status_id");
     $this->multiselect2('contribution_status_id', array("Pending"));
     $this->clickLink("_qf_Search_refresh");
 
@@ -51,6 +52,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium
     $this->waitForAjaxContent();
     $this->select('task', "label=Update pending contribution status");
     $this->waitForAjaxContent();
+    $this->waitForElementPresent("contribution_status_id");
     $this->select('contribution_status_id', 'label=Completed');
     $this->waitForAjaxContent();
     $this->click('_qf_Status_next');
@@ -60,6 +62,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium
     $this->waitForElementPresent("contribution_date_low");
 
     $this->type("sort_name", "Individual");
+    $this->waitForElementPresent("contribution_status_id");
     $this->multiselect2('contribution_status_id', array("Completed"));
     $this->click("_qf_Search_refresh");
 
@@ -200,6 +203,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium
     $this->select("financial_type_id", "value=1");
 
     //Contribution status
+    $this->waitForElementPresent("contribution_status_id");
     $this->select("contribution_status_id", "label=Pending");
 
     // total amount