Merge pull request #7940 from seamuslee001/CRM-18181
[civicrm-core.git] / tests / phpunit / WebTest / Contribute / PCPAddTest.php
old mode 100755 (executable)
new mode 100644 (file)
index 2011e10..8f903f2
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2016                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -107,7 +107,10 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase {
 
     $this->click("xpath=//div[@class='crm-section other_amount-section']//div[2]/input");
     $this->type("xpath=//div[@class='crm-section other_amount-section']//div[2]/input", $contributionAmount);
+    $this->typeKeys("xpath=//div[@class='crm-section other_amount-section']//div[2]/input", $contributionAmount);
     $this->type("email-5", $email);
+    $this->click("xpath=//label[text()='Test Processor']");
+    $this->waitForAjaxContent();
 
     $this->webtestAddCreditCardDetails();
     $this->webtestAddBillingDetails($firstName, $middleName, $lastName);
@@ -161,7 +164,10 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase {
     $this->openCiviPage("contribute/transact", "reset=1&id=$pageId&pcpId=$id[1]", "_qf_Main_upload-bottom");
     $this->click("xpath=//div[@class='crm-section other_amount-section']//div[2]/input");
     $this->type("xpath=//div[@class='crm-section other_amount-section']//div[2]/input", $contributionAmount);
+    $this->typeKeys("xpath=//div[@class='crm-section other_amount-section']//div[2]/input", $contributionAmount);
     $this->type("email-5", $donorFirstName . "@example.com");
+    $this->click("xpath=//label[text()='Test Processor']");
+    $this->waitForAjaxContent();
 
     $this->webtestAddCreditCardDetails();
     $this->webtestAddBillingDetails($donorFirstName, $middleName, $donorLastName);
@@ -176,10 +182,10 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase {
     //Find Contribution
     $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
     $this->waitForElementPresent('contribution_pcp_made_through_id');
-    $this->select2('pcp_made_through_id', $lastName . ', ' . $firstName);
+    $this->multiselect2('contribution_pcp_made_through_id', array($pcpTitle));
 
-    $this->clickLink("_qf_Search_refresh", "xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span/a[1][text()='View']");
-    $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span/a[1][text()='View']");
+    $this->clickLink("_qf_Search_refresh", "xpath=//table[@class='selector row-highlight']/tbody/tr[1]//td/span/a[1][text()='View']");
+    $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]//td/span/a[1][text()='View']");
     $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button[3]/span[2]");
 
     // View Contribution Record and test for expected values
@@ -196,7 +202,7 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase {
     $this->verifyText("xpath=//div['PCPView']/div[2]/table[@class='crm-info-panel']/tbody/tr[2]/td[2]/a", preg_quote($softCreditor));
 
     // Check PCP Summary Report
-    $this->openCiviPage('report/instance/16', 'reset=1');
+    $this->openCiviPage('report/instance/17', 'reset=1');
     $this->verifyText("PCP", preg_quote($pcpTitle));
     $this->verifyText("PCP", preg_quote("{$lastName}, {$firstName}"));
   }