From 2917a714a8bb7c85c92d7303b92c64d29b3a4d26 Mon Sep 17 00:00:00 2001 From: Web Access Date: Wed, 4 May 2016 18:50:34 +0530 Subject: [PATCH] Webtests fix --- .../WebTest/Campaign/OnlineContributionTest.php | 2 +- .../WebTest/Contribute/OnlineContributionTest.php | 14 +++++++------- .../UpdateBatchPendingContributionTest.php | 4 ++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php b/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php index 1efe15efb8..09ec9e4a16 100644 --- a/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php @@ -301,7 +301,7 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase { $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); //View Contribution Record - $this->verifyText("xpath=id('ContributionView')/div[2]/table[1]/tbody/tr[11]/td[2]", preg_quote($campaignTitle)); + $this->assertElementContainsText("xpath=//table[@class='crm-info-panel']/tbody/tr[11]/td[2]", $campaignTitle); } } diff --git a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php index 8e01aa2976..93bcb4f1ed 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php @@ -131,17 +131,16 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase { $this->select("billing_state_province_id-5", "value=1004"); $this->type("billing_postal_code-5", "94129"); $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom"); - - $this->waitForElementPresent("xpath=//div[@class='crm-section no-label billing_name-section']"); - $this->assertElementContainsText("xpath=//div[@class='crm-section no-label billing_name-section']", $firstName . "billing"); - $this->assertElementContainsText("xpath=//div[@class='crm-section no-label billing_name-section']", $lastName . "billing"); + $this->waitForElementPresent("xpath=//div[@class='crm-group billing_name_address-group']//div[@class='crm-section no-label billing_name-section']"); + $this->assertElementContainsText("xpath=//div[@class='crm-group billing_name_address-group']//div[@class='crm-section no-label billing_name-section']", $firstName . "billing"); + $this->assertElementContainsText("xpath=//div[@class='crm-group billing_name_address-group']//div[@class='crm-section no-label billing_name-section']", $lastName . "billing"); $this->click("_qf_Confirm_next-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForElementPresent("xpath=//div[@class='crm-section no-label billing_name-section']"); - $this->assertElementContainsText("xpath=//div[@class='crm-section no-label billing_name-section']", $firstName . "billing"); - $this->assertElementContainsText("xpath=//div[@class='crm-section no-label billing_name-section']", $lastName . "billing"); + $this->waitForElementPresent("xpath=//div[@class='crm-group billing_name_address-group']//div[@class='crm-section no-label billing_name-section']"); + $this->assertElementContainsText("xpath=//div[@class='crm-group billing_name_address-group']//div[@class='crm-section no-label billing_name-section']", $firstName . "billing"); + $this->assertElementContainsText("xpath=//div[@class='crm-group billing_name_address-group']//div[@class='crm-section no-label billing_name-section']", $lastName . "billing"); //login to check contribution @@ -490,6 +489,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase { $this->type("sort_name", "$lastName $firstName"); $this->multiselect2('contribution_product_id', array('Coffee Mug')); $this->click("_qf_Search_refresh"); + $this->waitForAjaxContent(); $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']/tbody//tr/td[10]/span//a[text()='View']"); $this->click("xpath=//table[@class='selector row-highlight']/tbody//tr/td[2]/a[text()='{$lastName}, {$firstName}']/../../td[10]/span//a[text()='View']"); $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]"); diff --git a/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php index 8ebd8dc429..9da465dae2 100644 --- a/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php @@ -44,6 +44,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low"); $this->type("sort_name", "Individual"); + $this->waitForElementPresent("contribution_status_id"); $this->multiselect2('contribution_status_id', array("Pending")); $this->clickLink("_qf_Search_refresh"); @@ -51,6 +52,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium $this->waitForAjaxContent(); $this->select('task', "label=Update pending contribution status"); $this->waitForAjaxContent(); + $this->waitForElementPresent("contribution_status_id"); $this->select('contribution_status_id', 'label=Completed'); $this->waitForAjaxContent(); $this->click('_qf_Status_next'); @@ -60,6 +62,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium $this->waitForElementPresent("contribution_date_low"); $this->type("sort_name", "Individual"); + $this->waitForElementPresent("contribution_status_id"); $this->multiselect2('contribution_status_id', array("Completed")); $this->click("_qf_Search_refresh"); @@ -200,6 +203,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium $this->select("financial_type_id", "value=1"); //Contribution status + $this->waitForElementPresent("contribution_status_id"); $this->select("contribution_status_id", "label=Pending"); // total amount -- 2.25.1