From 2815a5aafc51c31cad67fd789076cbdb666bb5d0 Mon Sep 17 00:00:00 2001 From: Web Access Date: Mon, 14 Dec 2015 18:47:21 +0530 Subject: [PATCH] Webtests fixes --- .../WebTest/Contact/AdvancedSearchedRelatedContactTest.php | 3 +++ tests/phpunit/WebTest/Contribute/OnlineContributionTest.php | 2 +- tests/phpunit/WebTest/Event/AddParticipationTest.php | 6 +++--- tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php | 4 ++-- tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php | 1 - 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index 0b6cd61567..20788b3598 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -109,6 +109,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->openCiviPage('contact/search/advanced', 'reset=1'); + $this->waitForElementPresent("sort_name"); $this->type("sort_name", $sortName); $this->click('_qf_Advanced_refresh'); $this->waitForPageToLoad(2 * $this->getTimeoutMsec()); @@ -117,7 +118,9 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->assertElementContainsText('search-status', '1 Contact'); $this->click('css=div.crm-advanced_search_form-accordion div.crm-accordion-header'); + $this->waitForElementPresent("component_mode"); $this->select("component_mode", "label=Related Contacts"); + $this->waitForElementPresent("display_relationship_type"); $this->select("display_relationship_type", $relType); $this->click('_qf_Advanced_refresh'); $this->waitForPageToLoad(2 * $this->getTimeoutMsec()); diff --git a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php index 84c51dd813..8cab4b14d8 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php @@ -145,7 +145,7 @@ 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=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span//a[text()='View']"); - $this->clickLink("xpath=xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span//a[text()='View']", "_qf_ContributionView_cancel-bottom", 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 and verify data $expected = array( diff --git a/tests/phpunit/WebTest/Event/AddParticipationTest.php b/tests/phpunit/WebTest/Event/AddParticipationTest.php index b8b8d0fb5d..62aafb7987 100644 --- a/tests/phpunit/WebTest/Event/AddParticipationTest.php +++ b/tests/phpunit/WebTest/Event/AddParticipationTest.php @@ -264,7 +264,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent('Source for this registration (if applicable).')); // Select an event fee - $this->waitForElementPresent('priceset'); + $this->waitForElementPresent("xpath=//div[@class='crm-event-form-fee-block']"); $this->click("xpath=//input[@class='crm-form-radio']"); @@ -282,9 +282,9 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { // Is status message correct? $this->checkCRMAlert("Event registration for $displayName has been added"); - $this->waitForElementPresent("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table/tbody/tr[1]/td[8]/span/a[text()='View']"); //click through to the participant view screen - $this->clickAjaxLink("xpath=//*[@id='Search']/table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom'); + $this->clickAjaxLink("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom'); $this->webtestVerifyTabularData( array( diff --git a/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php b/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php index 76c4359464..a5aa507134 100644 --- a/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php +++ b/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php @@ -80,10 +80,10 @@ class WebTest_Mailing_AddMessageTemplateTest extends CiviSeleniumTestCase { $this->waitForText('crm-notification-container', "The Message Template '$msgTitle' has been saved."); // Verify text. - $this->assertTrue($this->isElementPresent("xpath=id('user')/div[2]/div/table/tbody//tr/td[1][contains(text(), '$msgTitle')]"), + $this->assertTrue($this->isElementPresent("xpath=id('user')/div[2]/div[1]/table/tbody//tr/td[1][contains(text(), '$msgTitle')]"), 'Message Template Title not found!'); if (!$useTokens) { - $this->assertTrue($this->isElementPresent("xpath=id('user')/div[2]/div/table/tbody//tr/td[2][contains(text(), '$msgSubject')]"), + $this->assertTrue($this->isElementPresent("xpath=id('user')/div[2]/div[1]/table/tbody//tr/td[2][contains(text(), '$msgSubject')]"), 'Message Subject not found!'); } } diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php index d7aa11aa2c..e33a5ad798 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php @@ -923,7 +923,6 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase { $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom"); $this->assertTrue($this->isTextPresent("I want to contribute this amount every month.")); $this->click("_qf_Confirm_next-bottom"); - sleep(10); $this->waitForPageToLoad($this->getTimeoutMsec()); $expectedParams = array( -- 2.25.1