From 4dc8abb7c064fa46214a5ad28b3b861a71dfb558 Mon Sep 17 00:00:00 2001 From: Web Access Date: Wed, 30 Dec 2015 18:32:13 +0530 Subject: [PATCH] Tests Fixes --- .../Contact/AdvancedSearchedRelatedContactTest.php | 4 ++-- tests/phpunit/WebTest/Contact/SearchBuilderTest.php | 2 +- .../WebTest/Contribute/ContributionPageAddTest.php | 4 ++-- .../WebTest/Contribute/OnlineContributionTest.php | 4 ++-- tests/phpunit/WebTest/Event/AddPricesetTest.php | 3 ++- .../Member/OnlineMembershipAddPricesetTest.php | 4 ++-- .../WebTest/Member/OnlineMembershipCreateTest.php | 4 ++-- .../WebTest/Member/OnlineMembershipRenewTest.php | 12 ++++++------ .../Pledge/ContactContextPledgePaymentAddTest.php | 9 +++++---- 9 files changed, 24 insertions(+), 22 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index 20788b3598..53cd9ba43a 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -303,8 +303,8 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->waitForElementPresent("event_type_id"); $this->select2("event_type_id", "Conference"); $this->click("_qf_Advanced_refresh"); - $this->waitForElementPresent("xpath=id('search-status')"); - $this->assertElementContainsText('search-status', '2 Contacts'); + $this->waitForElementPresent("xpath=//div[@class='crm-content-block']//div[@id='search-status']"); + $this->assertElementContainsText("xpath=//div[@class='crm-content-block']//div[@id='search-status']/table/tbody/tr[1]/td[1]", "2 Contacts"); } public function testAdvanceSearchForLog() { diff --git a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php index 7206d70205..241ff4da80 100644 --- a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php +++ b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php @@ -527,7 +527,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { $this->openCiviPage("member/search", "reset=1", "_qf_Search_refresh"); $this->select2('membership_type_id', $membershipTypes['membership_type'], TRUE); $this->clickLink('_qf_Search_refresh'); - $this->waitForText('search-status', "2 Results"); + $this->assertElementContainsText("xpath=//div[@class='crm-content-block']//div[@id='search-status']/table/tbody/tr[1]/td[1]", "2 Result"); $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']"); $this->multiselect2("membership_status_id", array("New", "Grace")); diff --git a/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php b/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php index 1af159cd85..e2566474e6 100644 --- a/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php +++ b/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php @@ -259,8 +259,8 @@ 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[1]/td[10]/span//a[text()='View']", FALSE); + $this->clickLink("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span//a[text()='View']", '_qf_ContributionView_cancel-bottom', FALSE); $this->waitForAjaxContent(); $expected = array( 'From' => "{$firstName} {$lastName}", diff --git a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php index 8cab4b14d8..ba7b7e0379 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php @@ -366,8 +366,8 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase { $this->type("sort_name", "$lastName $firstName"); $this->click("xpath=//tr/td[1]/label[contains(text(), 'Contribution is a Test?')]/../../td[2]/label[contains(text(), 'Yes')]/preceding-sibling::input[1]"); - $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", FALSE); + $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table[@class='selector row-highlight']//tbody/tr[1]/td[10]/span/a[text()='View']"); + $this->clickLink("xpath=//div[@id='contributionSearch']//table[@class='selector row-highlight']//tbody/tr[1]/td[10]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE); //View Contribution Record and verify data $expected = array( diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index ff36b23417..dadf06bb2f 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -690,7 +690,8 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->openCiviPage('event/search', "reset=1", '_qf_Search_refresh'); $this->select2('participant_fee_id', 'First Night Edited'); $this->click('_qf_Search_refresh'); - $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span//a[text()='View']", "xpath=//span[contains(text(), 'Done')]", FALSE); + $this->waitForAjaxContent(); + $this->clickLink("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']//div[3]/div/div[2]//table//tbody/tr[1]/td[11]/span//a[text()='View']", "xpath=//span[contains(text(), 'Done')]", FALSE); $expectedLineItems[4][1] = 'Evening Sessions - First Night Edited'; $this->_checkLineItems($expectedLineItems); } diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php index a8d7254d9f..5ca168c937 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php @@ -519,8 +519,8 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas ); } //check if the membership amount is correct - $this->waitForElementPresent("xpath=//form[@id='MembershipView']/div[2]/div/div[2]/div[2]/table/tbody/tr/td[1]/span/a"); - $this->assertElementContainsText("xpath=//form[@id='MembershipView']/div[2]/div/div[2]/div[2]/table/tbody/tr/td[1]/span/a", $amount); + $this->waitForElementPresent("xpath=//form[@id='MembershipView']/div[2]/div/div[2]/div[2]/table/tbody/tr/td[1]/a"); + $this->assertElementContainsText("xpath=//form[@id='MembershipView']/div[2]/div/div[2]/div[2]/table/tbody/tr/td[1]/a", $amount); } } diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php index a2b59a9a64..b4d30a770f 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php @@ -457,8 +457,8 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase { $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low"); $this->type("sort_name", "$lastName $firstName"); $this->click("xpath=//tr/td[1]/label[contains(text(), 'Contribution is a Test?')]/../../td[2]/label[contains(text(), 'Yes')]/preceding-sibling::input[1]"); - $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", FALSE); + $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); + $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[10]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE); //View Contribution Record and verify data $expected = array( diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php index e33a5ad798..529ab7d48c 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php @@ -555,8 +555,8 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase { $this->type("sort_name", "$lastName, $firstName"); $this->click("xpath=//tr/td[1]/p/label[contains(text(),'Membership is a Test?')]/../label[contains(text(),'Yes')]/preceding-sibling::input[1]"); - $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item:first-child'); - $this->click('css=#memberSearch table tbody tr td span a.action-item:first-child'); + $this->clickLink("_qf_Search_refresh", "css=#memberSearch table tbody tr td a.action-item:first-child"); + $this->click("css=#memberSearch table tbody tr td a.action-item:first-child"); $this->waitForElementPresent("_qf_MembershipView_cancel-bottom"); //View Membership Record @@ -625,8 +625,8 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase { $this->type("sort_name", "$organisationName"); $this->click("xpath=//tr/td[1]/p/label[contains(text(),'Membership is a Test?')]/../label[contains(text(),'Yes')]/preceding-sibling::input[1]"); - $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item:first-child'); - $this->click('css=#memberSearch table tbody tr td span a.action-item:first-child'); + $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td a.action-item:first-child'); + $this->click('css=#memberSearch table tbody tr td a.action-item:first-child'); $this->waitForElementPresent("_qf_MembershipView_cancel-bottom"); //View Membership Record @@ -646,8 +646,8 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase { $this->type("sort_name", "$lastName, $firstName"); $this->click("xpath=//tr/td[1]/p/label[contains(text(),'Membership is a Test?')]/../label[contains(text(),'Yes')]/preceding-sibling::input[1]"); - $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item:first-child'); - $this->click('css=#memberSearch table tbody tr td span a.action-item:first-child'); + $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td a.action-item:first-child'); + $this->click('css=#memberSearch table tbody tr td a.action-item:first-child'); $this->waitForElementPresent("_qf_MembershipView_cancel-bottom"); //View Membership Record diff --git a/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php b/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php index d883eec0d2..80414a6c91 100644 --- a/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php +++ b/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php @@ -127,7 +127,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest $this->waitForAjaxContent(); $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[1]/a"); - $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[3]/td[8]/a[text()='Record Payment']"); + $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']/tbody/tr[2]/td/div/table/tbody/tr[3]/td[8]/a[text()='Record Payment']"); $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[3]/td[8]/a[text()='Record Payment']"); $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']"); $this->click("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']"); @@ -175,7 +175,8 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); $this->waitForAjaxContent(); - $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[1]/a"); + $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[1]/a"); + $this->waitForAjaxContent(); $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[5]/td[8]/a[text()='Record Payment']"); $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[5]/td[8]/a[text()='Record Payment']"); @@ -413,7 +414,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); $this->waitForAjaxContent(); - $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[1]/a"); + $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[1]/a"); $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[3]/td[8]/a[text()='Record Payment']"); $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[3]/td[8]/a[text()='Record Payment']"); $this->waitForElementPresent("_qf_Contribution_upload"); @@ -422,7 +423,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest $this->waitForText('crm-notification-container', "The contribution record has been saved."); $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); $this->waitForAjaxContent(); - $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[1]/a"); + $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[1]/a"); $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[4]/td[8]/a[text()='Record Payment']"); $this->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[4]/td[8]/a[text()='Record Payment']"); $this->waitForElementPresent("_qf_Contribution_upload"); -- 2.25.1