From ed174dea44592579dc8cd9320febcbdf88125138 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Fri, 25 Apr 2014 17:41:36 +0530 Subject: [PATCH] Web Test Fix --- .../WebTest/Event/AdditionalPaymentTest.php | 20 +++++------ .../WebTest/Event/MultiprofileEventTest.php | 27 ++++++++------- tests/phpunit/WebTest/Event/PCPAddTest.php | 34 ++++++++----------- .../WebTest/Event/ParticipantCountTest.php | 34 +++++++------------ .../WebTest/Event/ParticipantSearchTest.php | 6 ++-- .../phpunit/WebTest/Event/TellAFriendTest.php | 25 +++++++------- 6 files changed, 66 insertions(+), 80 deletions(-) diff --git a/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php b/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php index 6f89ea2501..b028676b15 100644 --- a/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php +++ b/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php @@ -46,7 +46,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { $this->webtestFillAutocomplete($firstName); // Select event. Based on label for now. - $this->select('event_id', "label=regexp:Rain-forest Cup Youth Soccer Tournament."); + $this->select2('event_id', "Rain-forest Cup Youth Soccer Tournament"); // Select role $this->click('role_id[2]'); @@ -69,7 +69,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { // Select an event fee $this->waitForElementPresent('priceset'); - $this->click("xpath=//input[@class='form-radio']"); + $this->click("xpath=//input[@class='crm-form-radio']"); sleep(1); // record payment total amount // amount populated after fee selection @@ -124,7 +124,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { $this->_checkPaymentInfoTable(800.00, 400.00); $balance = 800.00 - 400.00; //click through to the contribution view screen - $this->click("xpath=id('ParticipantView')/div[2]/table[@class='selector']/tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->click("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); $this->waitForElementPresent('_qf_ContributionView_cancel-bottom'); $this->webtestVerifyTabularData( @@ -139,11 +139,11 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { ); $this->click('_qf_ContributionView_cancel-top'); - $this->waitForElementPresent("xpath=id('ParticipantView')/div[2]/table[@class='selector']/tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); // make additional payment // 1 - check for links presence on participant view and edit page - $this->assertElementPresent("xpath=id('Search')/table[@class='selector']/tbody/tr[1]/td[8]/span[2]/ul/li[2]/a[text()='Record Payment']"); - $this->click("xpath=id('Search')/table[@class='selector']/tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->assertElementPresent("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span[2]/ul/li[2]/a[text()='Record Payment']"); + $this->click("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); $this->waitForElementPresent("xpath=id('ParticipantView')"); $this->assertElementPresent("xpath=id('ParticipantView')//td[@id='payment-info']/a/span[contains(text(), 'Record Payment')]"); @@ -172,8 +172,8 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { $this->click('_qf_AdditionalPayment_upload-bottom'); $this->waitForText('crm-notification-container', 'The payment record has been processed.'); - $this->waitForElementPresent("xpath=id('Search')/table[@class='selector']/tbody/tr[1]/td[8]/span/a[text()='View']"); - $this->click("xpath=id('Search')/table[@class='selector']/tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->click("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); $this->waitForElementPresent("_qf_ParticipantView_cancel-top"); $this->webtestVerifyTabularData( @@ -190,7 +190,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { // check for not apprence of record payment button $this->assertFalse($this->isElementPresent("xpath=id('ParticipantView')//td[@id='payment-info']/a/span[contains(text(), 'Record Payment')]")); - $this->click("xpath=id('ParticipantView')/div[2]/table[@class='selector']/tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->click("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); $this->waitForElementPresent('_qf_ContributionView_cancel-bottom'); $this->webtestVerifyTabularData( @@ -215,6 +215,6 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { function _checkPaymentInfoTable($feeAmt, $amtPaid) { $this->assertElementContainsText("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td", "$ {$feeAmt}", 'Missing text: appropriate fee amount'); - $this->assertElementContainsText("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td[2]/a", "$ {$amtPaid}", 'Missing text: appropriate fee amount'); + $this->assertElementContainsText("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td[2]", "$ {$amtPaid}", 'Missing text: appropriate fee amount'); } } \ No newline at end of file diff --git a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php index dc1111884e..3b09c4c3a8 100644 --- a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php +++ b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php @@ -88,7 +88,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->openCiviPage("event/search", "reset=1"); $this->type("sort_name", $firstName); $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']"); - $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top"); + $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top", FALSE); $name = $firstName . " " . $lastName; $status = 'Registered'; @@ -101,7 +101,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->openCiviPage("event/search", "reset=1"); $this->type("sort_name", $participantfname); $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']"); - $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top"); + $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top", FALSE); $name = $participantfname . " " . $participantlname; $status = 'Registered'; @@ -191,7 +191,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->openCiviPage("event/search", "reset=1"); $this->type("sort_name", $firstName); $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']"); - $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top"); + $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top", FALSE); $name = $firstName . " " . $lastName; $status = 'Registered'; @@ -204,7 +204,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->openCiviPage("event/search", "reset=1"); $this->type("sort_name", $participantfname); $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']"); - $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top"); + $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top", FALSE); $name = $participantfname . " " . $participantlname; $status = 'Registered'; @@ -229,7 +229,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->openCiviPage('event/search', "reset=1"); $this->type("sort_name", $firstName2); $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']"); - $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top"); + $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top", FALSE); $name = $firstName2 . " " . $lastName2; $status = 'Registered'; @@ -242,7 +242,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->openCiviPage("event/search", "reset=1"); $this->type("sort_name", $participantfname2); $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']"); - $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top"); + $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top", FALSE); $name = $participantfname2 . " " . $participantlname2; $status = 'Registered'; @@ -317,7 +317,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->click("xpath=//select[@id='additional_custom_post_id_multiple_3']/../span/a[text()='remove profile']"); $this->click("xpath=//select[@id='additional_custom_post_id_multiple_4']/../span/a[text()='remove profile']"); $this->click("_qf_Registration_upload-bottom"); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->waitForElementPresent("_qf_Registration_upload-bottom"); } function _testGetProfileId($customId) { @@ -412,6 +412,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { //Name of profile $this->type('title', $profilename); + $this->click('uf_group_type_Profile'); $this->click('_qf_Group_next-top'); $this->waitForPageToLoad($this->getTimeoutMsec()); $profileId = $this->urlArg('gid'); @@ -477,8 +478,8 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->click("_qf_Location_upload-bottom"); // Wait for "saved" status msg - $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForTextPresent("'Location' information has been saved."); + $this->waitForElementPresent("_qf_Location_upload-bottom"); + $this->waitForTextPresent("'Event Location' information has been saved."); } function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") { @@ -511,8 +512,8 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->click("_qf_Fee_upload-bottom"); // Wait for "saved" status msg - $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForTextPresent("'Fee' information has been saved."); + $this->waitForElementPresent("_qf_Fee_upload-bottom"); + $this->waitForTextPresent("'Fees' information has been saved."); } function _testAddMultipleProfile($profileId) { @@ -576,8 +577,8 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->click("_qf_Registration_upload-bottom"); // Wait for "saved" status msg - $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForText('crm-notification-container', "'Registration' information has been saved."); + $this->waitForElementPresent("_qf_Registration_upload-bottom"); + $this->waitForText('crm-notification-container', "'Online Registration' information has been saved."); return $this->urlArg('id'); } diff --git a/tests/phpunit/WebTest/Event/PCPAddTest.php b/tests/phpunit/WebTest/Event/PCPAddTest.php index c79dde3f83..ba005219b7 100644 --- a/tests/phpunit/WebTest/Event/PCPAddTest.php +++ b/tests/phpunit/WebTest/Event/PCPAddTest.php @@ -175,8 +175,8 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->click("_qf_Location_upload-bottom"); // Wait for "saved" status msg - $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForTextPresent("'Location' information has been saved."); + $this->waitForElementPresent("_qf_Location_upload-bottom"); + $this->waitForTextPresent("'Event Location' information has been saved."); } function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") { @@ -205,8 +205,8 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->click("_qf_Fee_upload-bottom"); // Wait for "saved" status msg - $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForTextPresent("'Fee' information has been saved."); + $this->waitForElementPresent("_qf_Fee_upload-bottom"); + $this->waitForTextPresent("'Fees' information has been saved."); } function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { @@ -230,8 +230,8 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->type("confirm_from_email", "jane.doe@example.org"); $this->click("_qf_Registration_upload-bottom"); - $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForTextPresent("'Registration' information has been saved."); + $this->waitForElementPresent("_qf_Registration_upload-bottom"); + $this->waitForTextPresent("'Online Registration' information has been saved."); } function _testOnlineRegistration($eventTitle, $pageId, $firstName, $lastName, $middleName, $email, $numberRegistrations = 1, $campaignType, $anonymous = TRUE) { @@ -423,8 +423,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->click('_qf_Event_upload-bottom'); $this->waitForElementPresent('_qf_Event_upload-bottom'); - $this->waitForPageToLoad($this->getTimeoutMsec()); - $text = "'Event' information has been saved."; + $text = "'Personal Campaigns' information has been saved."; $this->waitForText('crm-notification-container', $text); // parse URL to grab the contribution page id @@ -435,17 +434,14 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $sortName = $lastNameDonar . ', ' . $firstNameDonar; $this->openCiviPage("event/search", "reset=1"); - $this->type("event_name", $eventName); - $this->click("event_name"); - $this->waitForElementPresent("css=div.ac_results-inner li"); - $this->click("css=div.ac_results-inner li"); + $this->select2("event_id", $eventName); $this->click("_qf_Search_refresh"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->clickLink("xpath=//div[@id='participantSearch']/table/tbody//tr/td[@class='crm-participant-sort_name']/a[text()='{$sortName}']/../../td[11]/span/a[text()='View']", "xpath=//table[@class='selector']/tbody/tr/td[8]/span/a[text()='View']"); - $this->click("xpath=//table[@class='selector']/tbody/tr/td[8]/span/a[text()='View']"); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->clickLink("xpath=//div[@id='participantSearch']/table/tbody/tr[1]/td[@class='crm-participant-sort_name']/a[text()='{$sortName}']/../../td[11]/span/a[text()='View']", "xpath=//table[@class='selector row-highlight']/tbody/tr/td[8]/span/a[text()='View']", FALSE); + $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr/td[8]/span/a[text()='View']"); + $this->waitForElementPresent('_qf_ContributionView_cancel-bottom'); $this->webtestVerifyTabularData( array( @@ -455,7 +451,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { ) ); $softCreditor = "{$firstNameCreator} {$lastNameCreator}"; - $this->verifyText("xpath=//table[@class='crm-info-panel crm-soft-credit-listing']/tbody/tr/td[1]", preg_quote($softCreditor), 'In line ' . __LINE__); + $this->verifyText("xpath=//div[@id='PCPView']/div[2]//table[@class='crm-info-panel']/tbody/tr[2]/td[2]", preg_quote($softCreditor), 'In line ' . __LINE__); } function _testSearchTest($firstName, $lastName, $pcpCreatorFirstName, $pcpCreatorLastName, $amount) { @@ -476,8 +472,8 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); $this->click("css=li#tab_contribute a"); - $this->waitForElementPresent("xpath=//div[@id='Contributions']/div/form[@id='Search']/div[@class='view-content']/table[2]/tbody/tr[@id='rowid']/td/a[text()='$displayName']"); - $this->click("xpath=//div[@id='Contributions']/div/form[@id='Search']/div[@class='view-content']/table[2]/tbody/tr[@id='rowid']/td[7]/a[text()='View']"); + $this->waitForElementPresent("xpath=//form[@id='Search']/div[@class='view-content']/table[2]/tbody/tr[@id='rowid']/td/a[text()='$displayName']"); + $this->click("xpath=//form[@id='Search']/div[@class='view-content']/table[2]/tbody/tr[@id='rowid']/td[8]/a[text()='View']"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->webtestVerifyTabularData( @@ -488,7 +484,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { ) ); $softCreditor = "{$pcpCreatorFirstName} {$pcpCreatorLastName}"; - $this->verifyText("xpath=//table[@class='crm-info-panel crm-soft-credit-listing']/tbody/tr/td[1]", preg_quote($softCreditor), 'In line ' . __LINE__); + $this->verifyText("xpath=//div[@id='PCPView']/div[2]//table[@class='crm-info-panel']/tbody/tr[2]/td[2]", preg_quote($softCreditor), 'In line ' . __LINE__); } } diff --git a/tests/phpunit/WebTest/Event/ParticipantCountTest.php b/tests/phpunit/WebTest/Event/ParticipantCountTest.php index 96fd52db31..8b16442c4b 100644 --- a/tests/phpunit/WebTest/Event/ParticipantCountTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantCountTest.php @@ -65,7 +65,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { // register for event $this->click('link=Register Now'); $this->waitForElementPresent('_qf_Register_upload-bottom'); - $this->click("xpath=//input[@class='form-radio']"); + $this->click("xpath=//input[@class='crm-form-radio']"); $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org'; $this->type('first_name', 'Mary'); @@ -83,7 +83,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->click('link=Register Now'); $this->waitForElementPresent('_qf_Register_upload-bottom'); - $this->click("xpath=//input[@class='form-radio']"); + $this->click("xpath=//input[@class='crm-form-radio']"); $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org'; $this->type('first_name', 'Mary'); $this->type('last_name', 'Jones'. substr(sha1(rand()), 0, 5)); @@ -97,11 +97,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { // Find Participant $this->openCiviPage("event/search", "reset=1", 'participant_fee_amount_low'); - $this->click("event_name"); - $this->type("event_name", $eventTitle); - $this->typeKeys("event_name", $eventTitle); - $this->waitForElementPresent("css=div.ac_results-inner li"); - $this->click("css=div.ac_results-inner li"); + $this->select2("event_id", $eventTitle); $this->click('_qf_Search_refresh'); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -217,7 +213,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->click('link=Register Now'); $this->waitForElementPresent('_qf_Register_upload-bottom'); - $this->type("xpath=//input[@class='form-text four required']", '1'); + $this->type("xpath=//input[@class='four crm-form-text required']", '1'); $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org'; $participants[1] = array( @@ -252,7 +248,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->click('link=Register Now'); $this->waitForElementPresent('_qf_Register_upload-bottom'); - $this->type("xpath=//input[@class='form-text four required']", '2'); + $this->type("xpath=//input[@class='four crm-form-text required']", '2'); $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org'; $participants[2] = array( @@ -284,11 +280,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { // Find Participant $this->openCiviPage('event/search', 'reset=1', 'participant_fee_amount_low'); - $this->click("event_name"); - $this->type("event_name", $eventTitle); - $this->typeKeys("event_name", $eventTitle); - $this->waitForElementPresent("css=div.ac_results-inner li"); - $this->click("css=div.ac_results-inner li"); + $this->select2("event_id", $eventTitle); $this->click('_qf_Search_refresh'); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -306,7 +298,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { // Enter Priceset fields (Title, Used For ...) $this->type('title', $setTitle); $this->check('extends[1]'); - $this->select("css=select.form-select", "label={$financialType}"); + $this->select("css=select.crm-form-select", "label={$financialType}"); $this->type('help_pre', 'This is test priceset.'); $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.'); @@ -370,7 +362,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { } $this->click('_qf_Fee_upload-bottom'); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->waitForElementPresent('_qf_Fee_cancel-top'); // Go to Online Registration tab $this->click('link=Online Registration'); @@ -387,8 +379,8 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->type('confirm_from_email', 'jane.doe@example.org'); $this->click('_qf_Registration_upload-bottom'); - $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForTextPresent("'Registration' information has been saved."); + $this->waitForElementPresent('_qf_Registration_upload-bottom'); + $this->waitForTextPresent("'Online Registration' information has been saved."); // verify event input on info page // start at Manage Events listing @@ -435,16 +427,16 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $tdnum = 2; foreach ($tableHeaders as $header) { - $this->verifyText("xpath=//form[@id='Custom']//div[@class='crm-search-results']//table[@class='selector']/thead/tr[1]/th[$tdnum]", $header); + $this->verifyText("xpath=//form[@id='Custom']//div[@class='crm-search-results']//table[@class='selector row-highlight']/thead/tr[1]/th[$tdnum]", $header); $tdnum++; } foreach ($participants as $participantNum => $participant) { $tdnum = 4; - $this->verifyText("xpath=//form[@id='Custom']//div[@class='crm-search-results']//table[@class='selector']/tbody/tr[{$participantNum}]/td[{$tdnum}]", preg_quote("{$participant['first_name']} {$participant['last_name']}")); + $this->verifyText("xpath=//form[@id='Custom']//div[@class='crm-search-results']//table[@class='selector row-highlight']/tbody/tr[{$participantNum}]/td[{$tdnum}]", preg_quote("{$participant['first_name']} {$participant['last_name']}")); foreach ($priceFieldOptionCounts[$participantNum] as $priceFieldOptionCount) { $tdnum++; - $this->verifyText("xpath=//form[@id='Custom']//div[@class='crm-search-results']//table[@class='selector']/tbody/tr[{$participantNum}]/td[{$tdnum}]", preg_quote($priceFieldOptionCount)); + $this->verifyText("xpath=//form[@id='Custom']//div[@class='crm-search-results']//table[@class='selector row-highlight']/tbody/tr[{$participantNum}]/td[{$tdnum}]", preg_quote($priceFieldOptionCount)); } } } diff --git a/tests/phpunit/WebTest/Event/ParticipantSearchTest.php b/tests/phpunit/WebTest/Event/ParticipantSearchTest.php index f18000d909..5851befbad 100644 --- a/tests/phpunit/WebTest/Event/ParticipantSearchTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantSearchTest.php @@ -100,8 +100,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->openCiviPage("event/search", "reset=1"); $eventName = "Fall Fundraiser Dinner"; - $this->type("event_name", $eventName); - $this->type("event_id", 1); + $this->select2("event_id", $eventName); $this->click("_qf_Search_refresh"); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -152,8 +151,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->webtestFillDate('event_end_date_high', '+1 year'); $eventTypeName = 'Fundraiser'; - $this->type("event_type", $eventTypeName); - $this->type("event_type_id", 3); + $this->select2("event_type_id", $eventTypeName); $this->click("_qf_Search_refresh"); $this->waitForPageToLoad($this->getTimeoutMsec()); diff --git a/tests/phpunit/WebTest/Event/TellAFriendTest.php b/tests/phpunit/WebTest/Event/TellAFriendTest.php index 065f84fd27..aba084c2ca 100644 --- a/tests/phpunit/WebTest/Event/TellAFriendTest.php +++ b/tests/phpunit/WebTest/Event/TellAFriendTest.php @@ -135,32 +135,31 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->openCiviPage("contact/search", "reset=1", '_qf_Basic_refresh'); $this->type('sort_name', $firstName); $this->click('_qf_Basic_refresh '); - $this->waitForElementPresent('Print'); + $this->waitForElementPresent('Go'); $this->assertTrue($this->isTextPresent('1 Contact')); // Verify Activity created $this->openCiviPage("activity/search", "reset=1", '_qf_Search_refresh'); $this->type('sort_name', $firstName1); $this->click('_qf_Search_refresh'); - $this->waitForElementPresent("_qf_Search_next_print"); - $this->click("xpath=//div[@class='crm-search-results']//table[@class='selector']/tbody/tr[2]/td[9]/span/a[text()='View']"); + $this->waitForElementPresent("Go"); + $this->click("xpath=//div[@class='crm-search-results']//table[@class='selector row-highlight']/tbody/tr[2]/td[9]/span/a[text()='View']"); $this->waitForElementPresent('_qf_Activity_cancel-bottom'); - - $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[1]/td[2]", + $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[1]/td[2]/span/a[1]", preg_quote("$lastName, $firstName") ); - $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/a[1]", + $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/span/a[1]", preg_quote("$lastName1, $firstName1") ); - $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/a[2]", + $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/span/a[2]", preg_quote("$lastName2, $firstName2") ); - $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/a[3]", + $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/span/a[3]", preg_quote("$lastName3, $firstName3") ); - $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[4]/td[2]", + $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[4]/td[2]/span", preg_quote("Tell a Friend:") ); } @@ -206,8 +205,8 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->click("_qf_Location_upload-bottom"); // Wait for "saved" status msg - $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForTextPresent("'Location' information has been saved."); + $this->waitForElementPresent("_qf_Location_upload-bottom"); + $this->waitForTextPresent("'Event Location' information has been saved."); } function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { @@ -230,8 +229,8 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->type("confirm_from_email", "jane.doe@example.org"); $this->click("_qf_Registration_upload-bottom"); - $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForTextPresent("'Registration' information has been saved."); + $this->waitForElementPresent("_qf_Registration_upload-bottom"); + $this->waitForTextPresent("'Online Registration' information has been saved."); } function _testAddTellAFriend($subject, $thankYouMsg, $eventTitle) { -- 2.25.1