CRM-18454: webtest fixes
[civicrm-core.git] / tests / phpunit / WebTest / Contribute / ContributionPageAddTest.php
index 1af159cd85f26c9d396f70a299b8bcd31ceee0c2..9263fade25c051c831f97d973a3cd2b553a27d0e 100644 (file)
@@ -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.                                    |
  |                                                                    |
@@ -259,8 +259,9 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("financial_type_id");
     $this->type("sort_name", $firstName);
     $this->select('financial_type_id', "label=Donation");
-    $this->clickLink('_qf_Search_refresh', "xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span/a[1][text()='View']", FALSE);
-    $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span/a[1][text()='View']");
+    $this->clickLink('_qf_Search_refresh', "xpath=//table[@class='selector row-highlight']/tbody/tr/td[4][text()='Donation']/../td[10]/span//a[text()='View']", FALSE);
+    $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr/td[4][text()='Donation']/../td[10]/span//a[text()='View']");
+    $this->waitForElementPresent("xpath=//table/tbody/tr/td[text()='From']/following-sibling::td");
     $this->waitForAjaxContent();
     $expected = array(
       'From' => "{$firstName} {$lastName}",
@@ -274,7 +275,8 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     $this->openCiviPage("member/search", "reset=1", 'member_source');
     $this->type('sort_name', "$lastName $firstName");
     $this->clickLink('_qf_Search_refresh', "xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span//a[text()='View']", FALSE);
-    $this->clickLink("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span//a[text()='View']", '_qf_MembershipView_cancel-bottom', FALSE);
+    $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span//a[text()='View']");
+    $this->waitForAjaxContent();
 
     //View Membership Record
     $expected = array(