WebtestFix
authoratif-shaikh <shaikh388@gmail.com>
Fri, 13 Mar 2015 13:06:31 +0000 (18:36 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Fri, 13 Mar 2015 13:06:31 +0000 (18:36 +0530)
tests/phpunit/WebTest/Contribute/OfflineContributionTest.php
tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php
tests/phpunit/WebTest/Event/AdditionalPaymentTest.php

index 86fee95dd91c9c676655db8c70d17d1197418054..1c1b90514c1cbee0d5b6e5936c267b26e2081132 100644 (file)
@@ -283,7 +283,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
       'From' => "{$firstName} {$lastName}",
       'Financial Type' => 'Donation',
       'Total Amount' => 123,
-      'Non-deductible Amount' => '0.00',
+      'Non-deductible Amount' => 123,
       'sort_name' => "$lastName, $firstName",
     );
     $this->_verifyAmounts($checkScenario4);
@@ -317,11 +317,11 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
 
     $this->waitForElementPresent("css=li#tab_contribute a");
     $this->click("css=li#tab_contribute a");
-    $this->waitForElementPresent("link=Submit Credit Card Contribution");
+    $this->waitForElementPresent("link=Record Contribution (Check, Cash, EFT ...)");
 
     // since we don't have live credentials we will switch to test mode
-    $url = $this->getAttribute("xpath=//*[@id='Search']/div[2]/div[2]/a[2]@href");
-    $url = str_replace('mode=live', 'mode=test', $url);
+    $url = $this->getAttribute("xpath=//*[@id='Search']/div[2]/div[2]/a[1]@href");
+    $url = $url.'&mode=test';
     $this->open($url);
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -355,7 +355,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
       $this->select("product_name[0]", "label={$params['premium']}");
     }
     // Clicking save.
-    $this->click("_qf_Contribution_upload");
+    $this->click("_qf_Contribution_upload-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Is status message correct?
index 110e622cadbc844fc408b7a41dd4ad2c4c334016..418e27e38b7e9dc2daece4c7567653b0d66b637a 100644 (file)
@@ -51,10 +51,10 @@ class WebTest_Contribute_OfflineRecurContributionTest extends CiviSeleniumTestCa
 
     $this->click('css=li#tab_contribute a');
 
-    $this->waitForElementPresent('link=Submit Credit Card Contribution');
+    $this->waitForElementPresent('link=Record Contribution (Check, Cash, EFT ...)');
     // since we don't have live credentials we will switch to test mode
-    $url = $this->getAttribute("xpath=//*[@id='Search']//a[text()='Submit Credit Card Contribution']@href");
-    $url = str_replace('mode=live', 'mode=test', $url);
+    $url = $this->getAttribute("xpath=//*[@id='Search']/div[2]/div[2]/a[1]@href");
+    $url = $url.'&mode=test';
     $this->open($url);
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
index a60249a853284882391db540a39c2aa6164ed800..43b21610a4e73c2a3468b74aaac288ceadb8add3 100644 (file)
@@ -112,7 +112,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table//tbody/tr[1]/td[8]/span/a[text()='View']");
     //click through to the participant view screen
     $this->click("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table/tbody/tr[1]/td[8]/span/a[text()='View']");
-    $this->waitForElementPresent('_qf_ParticipantView_cancel-bottom');
+    $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]");
 
     $this->webtestVerifyTabularData(
       array(
@@ -128,7 +128,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase {
     $balance = 800.00 - 400.00;
     //click through to the contribution view screen
     $this->click("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
-    $this->waitForElementPresent('_qf_ContributionView_cancel-bottom');
+    $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]");
 
     $this->webtestVerifyTabularData(
       array(
@@ -141,19 +141,14 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase {
       )
     );
 
-    $this->clickAjaxLink('_qf_ContributionView_cancel-top');
+    $this->clickAjaxLink("xpath=//button//span[contains(text(),'Done')]");
     $this->waitForElementPresent("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
     // make additional payment
     // 1 - check for links presence on participant view and edit page
-    $this->assertElementPresent("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span[2]/ul/li[2]/a[text()='Record Payment']");
-    $this->click("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
-    $this->waitForElementPresent("xpath=id('ParticipantView')");
-    $this->waitForElementPresent("xpath=id('ParticipantView')//td[@id='payment-info']/a/span[contains(text(), 'Record Payment')]");
-
+    $this->waitForElementPresent("xpath=id('ParticipantView')//td[@id='payment-info']//a[contains(text(), 'Record Payment')]");
     $this->click("xpath=id('ParticipantView')//div[@class='action-link']/div/a/span[contains(text(), 'Edit')]");
-    $this->waitForElementPresent("xpath=id('Participant')");
-    $this->waitForElementPresent("xpath=id('Participant')//td[@id='payment-info']//a/span[contains(text(), 'Record Payment')]");
-    $this->clickLinkSuppressPopup("xpath=id('Participant')//td[@id='payment-info']/a/span[contains(text(), 'Record Payment')]/../", 'AdditionalPayment');
+    $this->waitForElementPresent("xpath=id('ParticipantView')//td[@id='payment-info']//a[contains(text(), 'Record Payment')]");
+    $this->clickLinkSuppressPopup("xpath=id('ParticipantView')//td[@id='payment-info']//a[contains(text(), 'Record Payment')]", 'AdditionalPayment');
 
     // verify balance
     $text = $this->getText("xpath=id('AdditionalPayment')/div[2]//table/tbody/tr[3]/td[2]");
@@ -168,11 +163,9 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase {
     $this->type('total_amount', $balance);
     $this->click('_qf_AdditionalPayment_upload-bottom');
     $this->checkCRMAlert('The payment record has been processed.');
-
-    $this->waitForElementPresent("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
-    $this->click("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
-    $this->waitForElementPresent("_qf_ParticipantView_cancel-top");
-
+    $this->waitForElementPresent("xpath=//*[contains(@class, 'CRM_Event_Form_Search')]//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
+    $this->click("xpath=//*[contains(@class, 'CRM_Event_Form_Search')]//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
+    $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]");
     $this->webtestVerifyTabularData(
       array(
         'Event' => 'Rain-forest Cup Youth Soccer Tournament',
@@ -185,7 +178,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase {
     $this->_checkPaymentInfoTable(800.00, 800.00);
 
     // check for absence of record payment button
-    $this->assertFalse($this->isElementPresent("xpath=id('ParticipantView')//td[@id='payment-info']//a/span[contains(text(), 'Record Payment')]"));
+    $this->assertFalse($this->isElementPresent("xpath=id('ParticipantView')//td[@id='payment-info']//a[contains(text(), 'Record Payment')]"));
 
     $this->clickAjaxLink("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
 
@@ -199,7 +192,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase {
         'Check Number' => '1044',
       )
     );
-    $this->click('_qf_ContributionView_cancel-bottom');
+    $this->click("xpath=//button//span[contains(text(),'Done')]");
 
     // view transaction popup info check
     $this->waitForElementPresent("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td[2]/a");