From 42e55bb5e462bea9b01263c1c084ba8a1f586b2c Mon Sep 17 00:00:00 2001 From: Rohan Katkar Date: Thu, 1 Jan 2015 18:57:30 +0530 Subject: [PATCH] Webtests Fixes --- tests/phpunit/WebTest/Contact/AdvancedSearchTest.php | 2 ++ .../OnlineMultiplePaymentProcessorTest.php | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php index e77819b3fd..aa1eccedf1 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php @@ -107,6 +107,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { $this->select2("relationship_type_id", "Employee of"); $this->waitForElementPresent("xpath=//input[@id='related_contact_id'][@placeholder='- select organization -']"); $this->select2("related_contact_id", "Default", TRUE); + $this->waitForAjaxContent(); $this->webtestFillDate("start_date", "-1 day"); $this->webtestFillDate("end_date", "+1 day"); $this->clickAjaxLink('_qf_Relationship_upload-bottom', NULL); @@ -217,6 +218,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { public function submitSearch($firstName) { $this->clickLink("_qf_Advanced_refresh"); // verify unique name + $this->waitForAjaxContent(); $this->waitForText("xpath=//div[@class='crm-search-results']/table/tbody", preg_quote("adv$firstName, $firstName")); // should give 1 result only as we are searching with unique name $this->waitForText("xpath=//div[@id='search-status']/table/tbody/tr/td", preg_quote("1 Contact")); diff --git a/tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php b/tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php index 34c6a10a97..f6b7b67cba 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php @@ -177,20 +177,22 @@ class WebTest_Contribute_OnlineMultiplePaymentProcessorTest extends CiviSelenium $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom"); $payLaterInstructionsText = "Pay later instructions $hash"; - $this->assertTrue($this->isTextPresent($payLaterInstructionsText)); + $this->verifyText("xpath=//div[@class='bold pay_later_receipt-section']/p", $payLaterInstructionsText); $this->click("_qf_Confirm_next-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertTrue($this->isTextPresent($payLaterInstructionsText)); + $this->verifyText("xpath=//div[@id='help']/div/p", $payLaterInstructionsText); //login to check contribution $this->openCiviPage("contribute/search", "reset=1", 'contribution_date_low'); - $this->type('sort_name', "$firstName $lastName"); + $this->type('sort_name', "$lastName $firstName"); $this->check('contribution_test'); - $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->click('_qf_Search_refresh'); + $this->waitForElementPresent("xpath=//div[@id='contributionSearch']/table/tbody/tr[1]/td[11]/span/a[text()='View']"); + $this->click("xpath=//div[@id='contributionSearch']/table/tbody/tr[1]/td[11]/span/a[text()='View']"); + $this->waitForElementPresent("_qf_ContributionView_cancel-bottom"); $expected = array( 'From' => "{$firstName} {$lastName}", 'Financial Type' => 'Donation', -- 2.25.1