From a488ca1a5ee8ab5904a9e35491e74766d5920550 Mon Sep 17 00:00:00 2001 From: pratikshad Date: Thu, 16 Apr 2015 18:03:06 +0530 Subject: [PATCH] Fixed Webtest for civi-4.6 --- .../WebTest/Campaign/PetitionUsageScenarioTest.php | 4 ++-- tests/phpunit/WebTest/Contact/AdvancedSearchTest.php | 2 +- .../Contact/AdvancedSearchedRelatedContactTest.php | 2 +- tests/phpunit/WebTest/Event/AddEventTest.php | 4 ++-- tests/phpunit/WebTest/Mailing/ABMailingTest.php | 12 ++++++------ 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php b/tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php index bc4e6ac154..95fd6e7f99 100644 --- a/tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php +++ b/tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php @@ -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 ///////////////////////// diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php index a50faab969..fb4b0e3f65 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php @@ -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"); diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index 89d463114f..011e388453 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -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'); } diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index bc1b0ec390..54b4e374c9 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -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 diff --git a/tests/phpunit/WebTest/Mailing/ABMailingTest.php b/tests/phpunit/WebTest/Mailing/ABMailingTest.php index e86d7847c8..a0bea82fe5 100644 --- a/tests/phpunit/WebTest/Mailing/ABMailingTest.php +++ b/tests/phpunit/WebTest/Mailing/ABMailingTest.php @@ -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)); -- 2.25.1