Fix for Webtest
authorRohan Katkar <rohan.katkar@webaccess.co.in>
Thu, 4 Sep 2014 03:55:47 +0000 (09:25 +0530)
committerRohan Katkar <rohan.katkar@webaccess.co.in>
Thu, 4 Sep 2014 10:17:19 +0000 (15:47 +0530)
tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php
tests/phpunit/WebTest/Contact/RelationshipAddTest.php
tests/phpunit/WebTest/Contribute/AddBatchesTest.php
tests/phpunit/WebTest/Contribute/OnlineContributionTest.php

index 7ab52f600066f8c67685ef3b982c740d761a2a2e..e60eb952b3dbec6608f40c9272ae5dd32833a8ce 100644 (file)
@@ -47,7 +47,7 @@ class WebTest_Contact_AddContactsToEventAdvancedSearchTest extends CiviSeleniumT
     $this->click('CIVICRM_QFID_ts_all_8');
 
     $this->select('task', "label=Add Contacts to Event");
-    $this->click('Go');
+
 
     // Select event. Based on label for now.
     $this->waitForElementPresent('event_id');
index a9d0a6191479e8a28610f93942f094e4ad4fa622..0aa976045349b191912be57b5eb3bd46dcbb995e 100644 (file)
@@ -338,14 +338,14 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase {
     //save the relationship
     //$this->click("_qf_Relationship_upload");
     $this->click("_qf_Relationship_upload-bottom");
-    $this->waitForElementPresent("crm-contact-relationship-selector-current_wrapper");
+    
 
     //check the status message
     $this->waitForText('crm-notification-container', 'Relationship created.');
 
-    $this->waitForElementPresent("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']");
-
+    $this->waitForElementPresent("xpath=//table[@id='DataTables_Table_2']/tbody/tr/td[9]/span/a[1][text()='View']");
+    $this->click("xpath=//table[@id='DataTables_Table_2']/tbody/tr[1]/td[9]/span/a[1][text()='View']");
     $this->webtestVerifyTabularData(
       array(
         'Description' => $description,
@@ -419,12 +419,12 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase {
     //$this->click("_qf_Relationship_upload");
     $this->click('_qf_Relationship_upload-bottom');
     $this->waitForElementPresent("crm-contact-relationship-selector-current_wrapper");
-
+    
     //check the status message
     $this->waitForText('crm-notification-container', 'Relationship created.');
 
-    $this->waitForElementPresent("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']");
+    $this->waitForElementPresent("xpath=//table[@id='DataTables_Table_2']/tbody/tr/td[9]/span/a[1][text()='View']");
+    $this->click("xpath=//table[@id='DataTables_Table_2']/tbody/tr[1]/td[9]/span/a[1][text()='View']");
 
     $this->webtestVerifyTabularData(
       array(
index 1de08ae0d52a085421f5da862b16af76cb7417f1..7f08522cd6f429686dfbaf93489d57bbe466ad9d 100644 (file)
@@ -242,8 +242,9 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase {
    * @param $type
    */
   function _verifyData($data, $type) {
-    $this->waitForElementPresent("xpath=//div[@id='crm-batch-selector_wrapper']//table//tbody/tr[1]/td[7]/span/a[text()='Enter records']");
-    $this->clickLink("xpath=//div[@id='crm-batch-selector_wrapper']//table//tbody/tr[1]/td[7]/span/a[text()='Enter records']", "_qf_Entry_upload");
+    $this->waitForElementPresent("xpath=//table[@id='DataTables_Table_0']/tbody//tr/td[7]/span/a[1][text()='Enter records']");
+    $this->click("xpath=//table[@id='DataTables_Table_0']/tbody//tr/td[7]/span/a[1][text()='Enter records']");
+    $this->waitForElementPresent('_qf_Entry_upload');
     $this->click("_qf_Entry_upload");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     foreach ($data as $value) {
index 2716d90a56013405c513bebf4993692310b5c04d..fb3e6d9657a3e78d098837e95c66d4ffa2d24c9b 100644 (file)
@@ -146,7 +146,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
 
     $this->type("sort_name", "$firstName $lastName");
     $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom");
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom",FALSE);
 
     //View Contribution Record and verify data
     $expected = array(