Fixed Webtest for civi-4.6
authorpratikshad <pratiksha.dubey@webaccess.co.in>
Thu, 16 Apr 2015 12:33:06 +0000 (18:03 +0530)
committerpratikshad <pratiksha.dubey@webaccess.co.in>
Thu, 16 Apr 2015 12:33:06 +0000 (18:03 +0530)
tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php
tests/phpunit/WebTest/Contact/AdvancedSearchTest.php
tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php
tests/phpunit/WebTest/Event/AddEventTest.php
tests/phpunit/WebTest/Mailing/ABMailingTest.php

index bc4e6ac154da7f115909dfcb0ff1434b4aadc7ed..95fd6e7f99798869235f8bc7aa573ed2b3593a42 100644 (file)
@@ -121,8 +121,8 @@ class WebTest_Campaign_PetitionUsageScenarioTest extends CiviSeleniumTestCase {
     $this->type("petition_title", $title);
 
     $this->click("xpath=//div[@class='crm-accordion-body']/table/tbody/tr[2]/td/a[text()='Search']");
-    $this->waitForElementPresent("xpath=//table[@class='petitions dataTable no-footer']/tbody//tr/td[10]/span[2][text()='more']/ul/li[2]/a[text()='Sign']");
-    $url = $this->getAttribute("xpath=//table[@class='petitions dataTable no-footer']/tbody//tr/td[10]/span[2][text()='more']/ul/li[2]/a[text()='Sign']@href");
+    $this->waitForElementPresent("xpath=//div[@id='petitionList']/div/table/tbody//tr//td[@class=' crm-petition-action']//span[text()='more']/ul//li/a[text()='Sign']");
+    $url = $this->getAttribute("xpath=//div[@id='petitionList']/div/table/tbody//tr//td[@class=' crm-petition-action']//span[text()='more']/ul//li/a[text()='Sign']@href");
 
     ////////////// Retrieve Sign Petition Url /////////////////////////
 
index a50faab969590329ce8379a92ff27b29744e8f04..fb4b0e3f65755b4f82fa5ae5a365437a5fffdbab 100644 (file)
@@ -73,7 +73,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("receipt_text");
     $this->multiselect2("role_id", array('Volunteer'));
     // Select $100 fee
-    $this->click("css=input[data-amount=100]");
+    $this->click("xpath=//input[@data-amount='100']");
     $this->check("record_contribution");
     $this->waitForElementPresent("contribution_status_id");
     $this->select("payment_instrument_id", "Check");
index 89d463114f0a94f91028d772011f872dc1bdfa6f..011e388453f9082b1b9308c9d5c877be528019bd 100644 (file)
@@ -301,7 +301,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->waitForElementPresent("event_type_id");
     $this->select2("event_type_id", "Conference");
     $this->click("_qf_Advanced_refresh");
-    $this->waitForElementPresent('search-status');
+    $this->waitForElementPresent("xpath=id('search-status')");
     $this->assertElementContainsText('search-status', '2 Contacts');
   }
 
index bc1b0ec3907202c57d0a9e17365bd4938977f975..54b4e374c9464b66ba309b85a526ed14a655274d 100644 (file)
@@ -770,9 +770,9 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
     $this->select2("event_id", $eventTitle, FALSE);
     $this->clickLink('_qf_Search_refresh');
     $this->waitForElementPresent("xpath=//div[@id='participantSearch']/table/tbody//tr/td[3]/a");
-    $this->verifyText("xpath=//div[@id='participantSearch']/table/tbody//tr/td[3]/a[contains(text(),
+    $this->verifyText("xpath=//div[@id='participantSearch']/table/tbody//tr/td[@class='crm-participant-sort_name']/a[contains(text(),
      '{$secParticipant['last_name']}, {$secParticipant['first_name']}')]/../../td[6]", preg_quote('225.00'));
-    $this->verifyText("xpath=//div[@id='participantSearch']/table/tbody//tr/td[3]/a[contains(text(),
+    $this->verifyText("xpath=//div[@id='participantSearch']/table/tbody//tr/td[@class='crm-participant-sort_name']/a[contains(text(),
     '{$thirdParticipant['last_name']}, {$thirdParticipant['first_name']}')]/../../td[6]", preg_quote('225.00'));
 
     //CRM-12618 check edit screen of additional participant and ensuring record_contribution not present
index e86d7847c843030d91f1b72856496fedfb0c5707..a0bea82fe5af91ae9676e3a06b06917d794353b8 100644 (file)
@@ -151,13 +151,13 @@ class WebTest_Mailing_ABMailingTest extends CiviSeleniumTestCase {
     //--------- mail delivery verification---------
 
     // click report link of created mailing
-    $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[1][text()='Final ($ABTestName)']/../descendant::a[text()='Report']");
+    $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[@class='crm-mailing-name'][text()='Final ($ABTestName)']/..//td/span/a[text()='Report']");
 
     // directly send schedule mailing -- not working right now
     $this->openCiviPage("mailing/queue", "reset=1");
 
     //click report link of created mailing
-    $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[1][text()='Final ($ABTestName)']/../descendant::a[text()='Report']");
+    $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[@class='crm-mailing-name'][text()='Final ($ABTestName)']/..//td/span/a[text()='Report']");
 
     //get actual number of user for mailing
     $mailedUser = round($totalUser * ($totalUser / 100));
@@ -323,13 +323,13 @@ class WebTest_Mailing_ABMailingTest extends CiviSeleniumTestCase {
     //--------- mail delivery verification---------
 
     // click report link of created mailing
-    $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[1][text()='Final ($ABTestName)']/../descendant::a[text()='Report']");
+    $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[@class='crm-mailing-name'][text()='Final ($ABTestName)']/..//td/span/a[text()='Report']");
 
     // directly send schedule mailing -- not working right now
     $this->openCiviPage("mailing/queue", "reset=1");
 
     //click report link of created mailing
-    $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[1][text()='Final ($ABTestName)']/../descendant::a[text()='Report']");
+    $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[@class='crm-mailing-name'][text()='Final ($ABTestName)']/..//td/span/a[text()='Report']");
 
     //get actual number of user for mailing
     $mailedUser = round($totalUser * ($totalUser / 100));
@@ -500,13 +500,13 @@ class WebTest_Mailing_ABMailingTest extends CiviSeleniumTestCase {
     //--------- mail delivery verification---------
 
     // click report link of created mailing
-    $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[1][text()='Final ($ABTestName)']/../descendant::a[text()='Report']");
+    $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[@class='crm-mailing-name'][text()='Final ($ABTestName)']/..//td/span/a[text()='Report']");
 
     // directly send schedule mailing -- not working right now
     $this->openCiviPage("mailing/queue", "reset=1");
 
     //click report link of created mailing
-    $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[1][text()='Final ($ABTestName)']/../descendant::a[text()='Report']");
+    $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[@class='crm-mailing-name'][text()='Final ($ABTestName)']/..//td/span/a[text()='Report']");
 
     //get actual number of user for mailing
     $mailedUser = round($totalUser * ($totalUser / 100));