From 6e64f99d4260c221d424042994292733b0bffe33 Mon Sep 17 00:00:00 2001 From: Ravish Nair Date: Thu, 21 Mar 2013 18:54:20 +0530 Subject: [PATCH] -- webtest fixes --- .../phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php | 8 ++++---- tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php | 2 +- tests/phpunit/WebTest/Import/MatchExternalIdTest.php | 2 +- tests/phpunit/WebTest/Import/ParticipantTest.php | 2 +- tests/phpunit/WebTest/Mailing/MailingTest.php | 1 - 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php b/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php index 63c1e470b6..cb90400d18 100644 --- a/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php +++ b/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php @@ -214,7 +214,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->waitForElementPresent("_qf_Reserve_done_reserve-bottom"); $this->click("_qf_Reserve_done_reserve-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForText('crm-notification-container', "2"); + $this->waitForText('crm-notification-container', "2 Contact\(s\) have been reserved"); // Interview Respondents $this->openCiviPage("survey/search", "reset=1&op=interview", "_qf_Search_refresh"); @@ -272,7 +272,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->waitForElementPresent("_qf_Reserve_done_reserve-bottom"); $this->click("_qf_Reserve_done_reserve-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForText('crm-notification-container', "Contact(s) have been reserved"); + $this->waitForText('crm-notification-container', "1 Contact\(s\) have been reserved"); // Release Respondents $this->openCiviPage("survey/search", "reset=1&op=release", "_qf_Search_refresh"); @@ -283,7 +283,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->click("_qf_Search_refresh"); $this->waitForElementPresent("Go"); - $this->click("xpath=id('mark_x_$id[1]')"); + $this->click("xpath=id('mark_x_$id')"); $this->waitForElementPresent("Go"); $this->clickLink("Go", "_qf_Release_done-bottom"); @@ -488,7 +488,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_Reserve_done_reserve-bottom'); $this->clickLink('_qf_Reserve_done_reserve-bottom', 'access'); - $this->waitForText('crm-notification-container', "2"); + $this->waitForText('crm-notification-container', "2 Contact\(s\) have been reserved"); $this->openCiviPage("report/survey/detail", "reset=1", '_qf_SurveyDetails_submit'); diff --git a/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php b/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php index 534f692230..d214d8c72f 100644 --- a/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php +++ b/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php @@ -57,7 +57,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { // Advanced Search by Tag $this->click("css=ul#civicrm-menu li.crm-Search"); $this->click("css=ul#civicrm-menu li.crm-Advanced_Search a"); - $this->waitForElementPresent('_qf_Advanced_refresh'); + $this->waitForElementPresent('css=select#crmasmSelect3'); $this->click('crmasmSelect3'); $this->select('crmasmSelect3', 'label=Major Donor'); $this->waitForElementPresent("//ul[@id='crmasmList3']/li/span"); diff --git a/tests/phpunit/WebTest/Import/MatchExternalIdTest.php b/tests/phpunit/WebTest/Import/MatchExternalIdTest.php index e5e07e39ef..343f95f77c 100644 --- a/tests/phpunit/WebTest/Import/MatchExternalIdTest.php +++ b/tests/phpunit/WebTest/Import/MatchExternalIdTest.php @@ -343,7 +343,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$params['title']); $this->click("_qf_SearchEvent_refresh"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->clickLink("link=" . $params['title']); + $this->clickLink("link=" . $params['title'], NULL); $params['event_id'] = $this->urlArg('id'); diff --git a/tests/phpunit/WebTest/Import/ParticipantTest.php b/tests/phpunit/WebTest/Import/ParticipantTest.php index 47f31c22d1..08f063afb0 100644 --- a/tests/phpunit/WebTest/Import/ParticipantTest.php +++ b/tests/phpunit/WebTest/Import/ParticipantTest.php @@ -321,7 +321,7 @@ class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase { // verify event input on info page // start at Manage Events listing $this->openCiviPage('event/manage', 'reset=1'); - $this->clickLink("link=" . $params['title']); + $this->clickLink("link=" . $params['title'], NULL); $params['event_id'] = $this->urlArg('id');; diff --git a/tests/phpunit/WebTest/Mailing/MailingTest.php b/tests/phpunit/WebTest/Mailing/MailingTest.php index daea8e9c70..e51d92a8ad 100644 --- a/tests/phpunit/WebTest/Mailing/MailingTest.php +++ b/tests/phpunit/WebTest/Mailing/MailingTest.php @@ -248,7 +248,6 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); $this->assertElementContainsText('css=div.messages', 'Mailing is forwarded successfully to 2 email addresses'); - $this->waitForPageToLoad($this->getTimeoutMsec()); $this->webtestLogin(); $this->openCiviPage("mailing/browse/scheduled", "reset=1&scheduled=true"); -- 2.25.1