From 64b211ddc5ae00aa087af96e593f4b7686c16ac9 Mon Sep 17 00:00:00 2001 From: Rohan Katkar Date: Tue, 23 Dec 2014 18:54:28 +0530 Subject: [PATCH] Fix for webtests --- tests/phpunit/WebTest/Contact/SearchBuilderTest.php | 2 +- tests/phpunit/WebTest/Contribute/OnlineContributionTest.php | 2 +- tests/phpunit/WebTest/Event/AddEventTest.php | 6 +++--- tests/phpunit/WebTest/Profile/BatchUpdateTest.php | 4 ++-- .../WebTest/Profile/ProfileGroupSubscriptionTest.php | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php index 3d67c5e334..42904ee041 100644 --- a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php +++ b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php @@ -50,7 +50,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { $this->waitForPageToLoad(); // We should get no results. But check the options are all still set - $this->waitForTextPresent('None found.'); + $this->waitForTextPresent('No matches found for:'); foreach (array($groupName, 'United States', 'Male') as $i => $label) { $this->waitForElementPresent("//span[@id='crm_search_value_1_$i']/select/option[2]"); $this->assertSelectedLabel("//span[@id='crm_search_value_1_$i']/select", $label); diff --git a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php index e58b9a3aeb..65269fff48 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php @@ -302,7 +302,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase { //Find Contribution $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low"); - $this->type("sort_name", "$firstName $lastName"); + $this->type("sort_name", "$lastName $firstName"); $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", FALSE); $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE); diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index b2a06d2737..a4e4062dd2 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -681,7 +681,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->click('css=li#tab_reminder a'); $this->waitForElementPresent("newScheduleReminder"); $this->click("newScheduleReminder"); - $this->waitForElementPresent("_qf_ScheduleReminders_upload-bottom"); + $this->waitForElementPresent("_qf_ScheduleReminders_next-bottom"); $this->type("title", "Event Reminder for " . $eventTitle); $this->select('entity', 'label=Registered'); @@ -701,10 +701,10 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->type("text_message", "This is the test text version here!!!"); //click on save - $this->click('_qf_ScheduleReminders_upload-bottom'); + $this->click('_qf_ScheduleReminders_next-bottom'); $this->waitForElementPresent("link=Add Reminder"); - $this->waitForElementPresent("link=Edit"); + $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[7]/span/a[1]"); $verifyText = array( 1 => 'Event Reminder for ' . $eventTitle, diff --git a/tests/phpunit/WebTest/Profile/BatchUpdateTest.php b/tests/phpunit/WebTest/Profile/BatchUpdateTest.php index 846da53458..7c491f3351 100644 --- a/tests/phpunit/WebTest/Profile/BatchUpdateTest.php +++ b/tests/phpunit/WebTest/Profile/BatchUpdateTest.php @@ -405,8 +405,8 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_Reserve_next_reserveToInterview-top'); $this->clickLink('_qf_Reserve_next_reserveToInterview-top', '_qf_Interview_cancel_interview'); - $this->isElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='{$Name2}']"); - $this->isElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='{$Name1}']"); + $this->isElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[2][text()='{$Name2}']"); + $this->isElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[2][text()='{$Name1}']"); //edition to be done here // selecting first check of profile diff --git a/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php b/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php index 04870f671e..40c63ae76a 100644 --- a/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php +++ b/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php @@ -125,7 +125,7 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase $this->isTextPresent("Your subscription request has been submitted for"); //check if profile is saved - $this->waitForText('crm-notification-container','Your information has been saved.'); + $this->isTextPresent("Your information has been saved."); // delete the profile $this->openCiviPage('admin/uf/group', 'reset=1'); @@ -136,8 +136,8 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase * @param $profileTitle */ function _testdeleteProfile($profileTitle) { - $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[5]/a[text()='Delete']"); - $this->click("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[5]/a[text()='Delete']"); + $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div[1]/table/tbody//tr/td[1]/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[5]/a[text()='Delete']"); + $this->click("xpath=//div[@id='user-profiles']/div/div[1]/table/tbody//tr/td[1]/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[5]/a[text()='Delete']"); $this->waitForElementPresent('_qf_Group_next-bottom'); $this->click('_qf_Group_next-bottom'); $this->waitForElementPresent('newCiviCRMProfile-bottom'); -- 2.25.1