From fb34b4f5366ee1a11a54b492b4cfae67f27e4e71 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Wed, 18 Nov 2015 19:24:20 +0530 Subject: [PATCH] webtest fixes --- .../WebTest/Campaign/OnlineEventRegistrationTest.php | 4 ++-- .../Contribute/UpdatePendingContributionTest.php | 12 ++++++------ tests/phpunit/WebTest/Profile/SearchTest.php | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php b/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php index 791153271d..eebc1cc24a 100644 --- a/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php +++ b/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php @@ -258,7 +258,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase } $this->click("xpath=//div[@id='registration_screen']/table/tbody/tr[1]/td[2]/div[@class='replace-plain']"); - $this->fillRichTextField("cke_wysiwyg_frame", $registerIntro); + $this->fillRichTextField('intro_text', $registerIntro, 'CKEditor', TRUE); // enable confirmation email $this->click("CIVICRM_QFID_1_is_email_confirm"); @@ -360,7 +360,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase $this->waitForElementPresent("xpath=//div[@id='participantSearch']"); $this->click("xpath=//div[@id='participantSearch']/table/tbody/tr/td[11]/span[1]/a[2][text()='Edit']"); $this->waitForElementPresent("_qf_Participant_cancel-bottom"); - $this->assertElementContainsText("xpath=//form[@id='Participant']//div/div/table/tbody//tr/td[2]/select", "$campaignTitle"); + $this->assertElementContainsText("xpath=//div[@id='s2id_campaign_id']", "$campaignTitle"); } } diff --git a/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php index 90f471d352..7c3cc09c0e 100644 --- a/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php @@ -44,21 +44,21 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC //Online Pay Later Contribution $this->_testOnlineContribution($contact); $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low"); - $this->click("xpath=//tr/td[1]/label[contains(text(), 'Contribution is a Test?')]/../../td[2]/label[contains(text(), 'Yes')]/preceding-sibling::input[1]"); + $this->click("xpath=//tr/td[1]/label[contains(text(), 'Contribution is a Test?')]/../../td[2]/label[contains(text(), 'Yes')]/../a[1]"); $this->type("sort_name", $contact['sort_name']); $this->click("_qf_Search_refresh"); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->click('radio_ts', 'ts_all'); $contriIDOff = explode('&', $this->getAttribute("xpath=//div[@id='contributionSearch']/table/tbody/tr[1]/td[11]/span/a@href")); - $contriIDOn = explode('&', $this->getAttribute("xpath=//div[@id='contributionSearch']/table/tbody/tr[2]/td[11]/span/a@href")); + $contriIDOn = explode('&', $this->getAttribute("xpath=//div[@id='contributionSearch']/table/tbody/tr[1]/td[11]/span/a@href")); if (!empty($contriIDOff)) { $contriIDOff = substr($contriIDOff[1], (strrpos($contriIDOff[1], '=') + 1)); } if (!empty($contriIDOn)) { $contriIDOn = substr($contriIDOn[1], (strrpos($contriIDOn[1], '=') + 1)); } - $this->select('task', "label=Update Pending Contribution Status"); + $this->select('task', "label=Update pending contribution status"); $this->click("_qf_Search_next_action"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->select('contribution_status_id', 'label=Completed'); @@ -257,8 +257,8 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low"); $this->click("xpath=//tr/td[1]/label[contains(text(), 'Contribution is a Test?')]/../../td[2]/label[contains(text(), 'Yes')]/preceding-sibling::input[1]"); $this->type("sort_name", $contact['sort_name']); - $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[2]/td[11]/span/a[text()='View']", FALSE); - $this->click("xpath=//div[@id='contributionSearch']/table/tbody/tr//td/a[text()='{$contact['sort_name']}']/../td[11]/span/a[text()='View']"); + $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table/tbody/tr[1]/td[11]/span/a[text()='View']", FALSE); + $this->click("xpath=//div[@id='contributionSearch']//table/tbody/tr[1]/td[11]/span/a[text()='View']"); // View Contribution Record and test for expected values $expected = array( 'From' => $contact['display_name'], diff --git a/tests/phpunit/WebTest/Profile/SearchTest.php b/tests/phpunit/WebTest/Profile/SearchTest.php index a1a6286953..bd02df7784 100644 --- a/tests/phpunit/WebTest/Profile/SearchTest.php +++ b/tests/phpunit/WebTest/Profile/SearchTest.php @@ -160,7 +160,7 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase { $this->click('in_selector'); // click on save - $this->clickLink('_qf_Field_next-bottom', "xpath=//div[@id='field_page']/div[1]/a[4]/span[text()=' Use (create mode)']", FALSE); + $this->clickLink('_qf_Field_next-bottom', "xpath=//div[@id='field_page']/div[1]/a[4]/span", FALSE); $uselink = explode('?', $this->getAttribute("xpath=//*[@id='field_page']/div[1]/a[4]@href")); $this->openCiviPage('profile/create', "$uselink[1]", '_qf_Edit_next'); @@ -244,7 +244,7 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase { $this->waitForElementPresent("visibility"); $this->click("xpath=//tr[@id='profile_visibility']/td[1]/a"); $this->waitForElementPresent("xpath=//div[@id='crm-notification-container']/div/div[2]/p[2]"); - $this->waitForText('crm-notification-container', 'Is this field hidden from other users'); + $this->waitForText('crm-notification-container', 'Is this field hidden from public search'); $this->select('visibility', 'value=Public Pages and Listings'); } -- 2.25.1