From 60709d212737547981b79e7be4e9ed077f8f1a8c Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Wed, 30 Jul 2014 18:42:56 +0530 Subject: [PATCH] CRM-15031 Event Webtest Fix --- .../phpunit/CiviTest/CiviSeleniumTestCase.php | 2 +- tests/phpunit/WebTest/Event/AddEventTest.php | 78 ++++++++++--------- .../WebTest/Event/AddParticipationTest.php | 6 +- .../phpunit/WebTest/Event/AddPricesetTest.php | 4 +- .../WebTest/Event/AdditionalPaymentTest.php | 2 +- .../WebTest/Event/ChangeParticipantStatus.php | 25 +++--- .../WebTest/Event/EventListingTest.php | 2 +- .../WebTest/Event/EventWaitListTest.php | 1 + .../WebTest/Event/MultiprofileEventTest.php | 70 ++++++++--------- tests/phpunit/WebTest/Event/PCPAddTest.php | 1 + .../WebTest/Event/ParticipantCountTest.php | 1 + .../WebTest/Event/PricesetMaxCountTest.php | 1 + .../phpunit/WebTest/Event/TellAFriendTest.php | 6 +- 13 files changed, 101 insertions(+), 98 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index 14807d82dc..a8f3853ccb 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -2083,7 +2083,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $fieldLabel = "custom_field_for_{$customSet['entity']}_{$customSet['subEntity']}" . substr(sha1(rand()), 0, 4); $this->type('label', $fieldLabel); - $this->click('_qf_Field_next-bottom'); + $this->click('_qf_Field_next_new-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); $customGroupTitle = preg_replace('/\s/', '_', trim($customGroupTitle)); diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index 267c1a4616..4bef4ef0ee 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -216,12 +216,12 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { function _deleteDiscount($id, $eventTitle, $discount) { $this->openCiviPage("event/manage/fee", "reset=1&action=update&id=$id", "_qf_Fee_upload-bottom"); $this->type("discount_name_2", ""); - $this->click("xpath=//tr[@id='discount_2']/td[3]/span/a"); - $this->click("xpath=//tr[@id='discount_2']/td[4]/span/a"); + $this->click("xpath=//tr[@id='discount_2']/td[3]/a"); + $this->click("xpath=//tr[@id='discount_2']/td[4]/a"); $this->type("discounted_value_1_2", ""); $this->type("discounted_value_2_2", ""); $this->click("_qf_Fee_upload-bottom"); - $this->waitForPageToLoad(); + $this->waitForText('crm-notification-container', "'Fees' information has been saved."); //Assertions $this->openCiviPage("admin/price", "reset=1"); $this->assertStringsPresent($discount[1]); @@ -316,8 +316,9 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->waitForElementPresent("_qf_Fee_upload-bottom"); $this->assertChecked('is_pay_later'); $this->click("CIVICRM_QFID_0_is_monetary"); - $this->clickLink("_qf_Fee_upload-bottom", "_qf_Fee_upload-bottom"); + $this->clickLink("_qf_Fee_upload-bottom", "_qf_Fee_upload-bottom", FALSE); + $this->waitForElementPresent("xpath=//div[@id='event-fees'][@style='display: none;']"); //check if pay later option is disabled $this->click('CIVICRM_QFID_1_is_monetary'); $this->waitForElementPresent('is_pay_later'); @@ -380,7 +381,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->select("template_id", "value={$templateID}"); // Wait for event type to be filled in (since page reloads) - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->waitForElementPresent("event_type_id"); $this->verifySelectedValue("event_type_id", $eventTypeID); // Attendee role s/b selected now. @@ -509,10 +510,16 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->click("link=Online Registration"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); - $this->click("is_online_registration"); + $isChecked = $this->isChecked('is_online_registration'); + if (!$isChecked) { + $this->click("is_online_registration"); + } $this->assertChecked("is_online_registration"); if ($multipleRegistrations) { - $this->click("is_multiple_registrations"); + $isChecked = $this->isChecked('is_multiple_registrations'); + if (!$isChecked) { + $this->click("is_multiple_registrations"); + } $this->assertChecked("is_multiple_registrations"); } @@ -707,13 +714,13 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { 3 => '1 hour after Event Start Date', 4 => 'Registered', 5 => 'Yes', -// Not sure why it's not finding the 6th cell? dgg. -// 6 => 'Yes', + 6 => 'Yes', ); + $this->waitForElementPresent("xpath=//form[@id='ScheduleReminders']//div[@id='option11_wrapper']"); //verify the fields for Event Reminder selector foreach ($verifyText as $key => $value) { - $this->verifyText("xpath=//div['option11_wrapper']/table/tbody/tr/td[$key]", $value); + $this->verifyText("xpath=//form[@id='ScheduleReminders']//div['option11_wrapper']/table/tbody/tr/td[$key]", $value); } } @@ -764,10 +771,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $primaryDisplayName = "{$primaryParticipantInfo['first_name']} {$primaryParticipantInfo['last_name']}"; $this->webtestLogin(); $this->openCiviPage("event/search?reset=1", "reset=1"); - $this->type('event_name', $eventTitle); - $this->click("event_name"); - $this->waitForElementPresent("css=div.ac_results-inner li"); - $this->click("css=div.ac_results-inner li"); + $this->select2("event_id", $eventTitle, FALSE); $this->clickLink('_qf_Search_refresh'); $this->verifyText("xpath=//div[@id='participantSearch']/table/tbody//tr/td[3]/a[contains(text(), '{$secParticipant['last_name']}, {$secParticipant['first_name']}')]/../../td[6]", preg_quote('225.00')); @@ -778,7 +782,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { foreach ($addtlPart as $value) { $this->clickLink("xpath=//div[@id='participantSearch']/table/tbody//tr/td[3]/a[contains(text(), '{$value['last_name']}, {$value['first_name']}')]/../../td[11]/span/a[2][contains(text(), 'Edit')]", - '_qf_Participant_upload-bottom'); + '_qf_Participant_upload-bottom', FALSE); $this->assertTrue( $this->isElementPresent("xpath=//tr[@class='crm-participant-form-block-registered-by']/td[2]/a[contains(text(), '$primaryDisplayName')]"), 'Registered By info is wrong on additional participant edit form'); @@ -797,29 +801,33 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { //unselect the payment processor configured $this->openCiviPage("event/manage/fee", "reset=1&action=update&id={$eventId}", '_qf_Fee_upload-bottom'); $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='Test Processor']"); - $this->clickLink("_qf_Fee_upload-bottom"); + $this->click("_qf_Fee_upload-bottom"); + $this->waitForText('crm-notification-container', "'Fees' information has been saved."); // add participant and 3 additional participant and change status of participant from edit participant $this->_testOnlineRegistration($registerUrl, $numberRegistrations, $anonymous, TRUE); $this->webtestLogin(); $this->openCiviPage("event/search?reset=1", "reset=1"); - $this->type('event_name', $eventTitle); - $this->click("event_name"); - $this->waitForElementPresent("css=div.ac_results-inner li"); - $this->click("css=div.ac_results-inner li"); + $this->select2("event_id", $eventTitle, FALSE); $this->click("xpath=//td[@class='crm-event-form-block-participant_status']/div[@class='listing-box']//div/label[text()='Pending from pay later']"); $this->click('_qf_Search_refresh'); $this->waitForPageToLoad($this->getTimeoutMsec()); + $uRL = $this->getAttribute("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='Edit']@href"); + $participantName = $this->getText("xpath=//div[@id='participantSearch']/table/tbody//tr/td[3]/a"); $this->click("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='Edit']"); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->waitForElementPresent("status_id"); $this->select('status_id', 'label=Registered'); + $this->waitForElementPresent("record_contribution"); $this->click('record_contribution'); + $this->waitForElementPresent("contribution_status_id"); $this->select('contribution_status_id', 'label=Completed'); - $pID = $this->urlArg('id'); + $pID = $this->urlArg('id', $uRL); $contributionID = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment', $pID, 'contribution_id', 'participant_id'); $this->click('_qf_Participant_upload-top'); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->waitForElementPresent("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='Edit']"); + $this->click("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='View']"); + $this->waitForElementPresent("_qf_ParticipantView_cancel-top"); $this->verifyFinancialRecords($contributionID); // add participant and 3 additional participant and change status of participant from edit contribution @@ -827,22 +835,19 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->webtestLogin(); $this->openCiviPage("event/search?reset=1", "reset=1"); - $this->type('event_name', $eventTitle); - $this->click("event_name"); - $this->waitForElementPresent("css=div.ac_results-inner li"); - $this->click("css=div.ac_results-inner li"); + $this->select2("event_id", $eventTitle, FALSE); $this->click("xpath=//td[@class='crm-event-form-block-participant_status']/div[@class='listing-box']//div/label[text()='Pending from pay later']"); $this->click('_qf_Search_refresh'); $this->waitForPageToLoad($this->getTimeoutMsec()); + $uRL = $this->getAttribute("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='View']@href"); $this->click("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='View']"); - $this->waitForPageToLoad($this->getTimeoutMsec()); - $pID = $this->urlArg('id'); + $pID = $this->urlArg('id', $uRL); $contributionID = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment', $pID, 'contribution_id', 'participant_id'); + $this->waitForElementPresent("xpath=//tr[@id='rowid$contributionID']/td[8]/span//a[text()='Edit']"); $this->click("xpath=//tr[@id='rowid$contributionID']/td[8]/span//a[text()='Edit']"); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->waitForElementPresent("_qf_Contribution_upload-bottom"); $this->select('contribution_status_id', 'label=Completed'); - $this->click('_qf_Contribution_upload-bottom'); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->clickLink('_qf_Contribution_upload-bottom', '_qf_ParticipantView_cancel-bottom', FALSE); $this->verifyFinancialRecords($contributionID); } @@ -917,7 +922,7 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'"; $this->type("value[2]",'1000.00'); $this->check('default'); $this->click('_qf_Fee_upload-bottom'); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->waitForText('crm-notification-container', "'Fees' information has been saved."); // intro text for registration page $registerIntro = 'Fill in all the fields below and click Continue.'; @@ -965,10 +970,9 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'"; */ function _testEnableParticipantStatuses($status) { // enable participant status - if ($this->isElementPresent("xpath=//td[@class='crm-particpant-label'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']")){ - $this->click("xpath=//td[@class='crm-particpant-label'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']"); - $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']"); - $this->click("xpath=//div[@class='ui-dialog-buttonset']/button[2]"); + if ($this->isElementPresent("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']")) { + $this->click("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']"); + $this->waitForElementPresent("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Disable']"); } } } diff --git a/tests/phpunit/WebTest/Event/AddParticipationTest.php b/tests/phpunit/WebTest/Event/AddParticipationTest.php index 4799f7a879..00590e6d8d 100644 --- a/tests/phpunit/WebTest/Event/AddParticipationTest.php +++ b/tests/phpunit/WebTest/Event/AddParticipationTest.php @@ -195,7 +195,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $this->click('is_searchable'); //clicking save - $this->click('_qf_Field_next'); + $this->click('_qf_Field_done-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created? @@ -236,7 +236,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $this->click('is_searchable'); //clicking save - $this->click('_qf_Field_next'); + $this->click('_qf_Field_done-bottom'); $this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", "_qf_Participant_upload-bottom"); @@ -376,7 +376,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $customSets = array( array('entity' => 'ParticipantEventName', 'subEntity' => 'Fall Fundraiser Dinner', 'triggerElement' => array('name' => "event_id", 'type' => "select2")), - array('entity' => 'ParticipantRole', 'subEntity' => 'Attendee','triggerElement' => array('type' => "checkbox")) + array('entity' => 'ParticipantRole', 'subEntity' => 'Attendee','triggerElement' => array('name' => 'role_id', 'type' => "select")) ); $pageUrl = array('url' => "participant/add", 'args' => "reset=1&action=add&context=standalone"); $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl); diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index 45343b8118..376aea867b 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -275,6 +275,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->check('is_online_registration'); $this->assertChecked('is_online_registration'); + $this->click('intro_text-plain'); $this->fillRichTextField('intro_text', $registerIntro); // enable confirmation email @@ -435,6 +436,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->check('is_online_registration'); $this->assertChecked('is_online_registration'); + $this->click('intro_text-plain'); $this->fillRichTextField('intro_text', $registerIntro); // enable confirmation email @@ -666,10 +668,10 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { 'Contribution Status' => 'Completed', 'Paid By' => 'Check', 'Check Number' => '1044', - 'Total Amount' => '$ 2,705.00', 'Received Into' => 'Deposit Bank Account', ) ); + $this->verifyText("xpath=//td[text()='Contribution Amount']/following-sibling::td//div/div", preg_quote('Contribution Total: $ 2,705.00')); } diff --git a/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php b/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php index 19604c8eef..bccd4c51a9 100644 --- a/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php +++ b/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php @@ -53,7 +53,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { $this->select2('event_id', "Rain-forest Cup Youth Soccer Tournament"); // Select role - $this->select('role_id', "value=2"); + $this->multiselect2('role_id', array('Volunteer')); // Choose Registration Date. // Using helper webtestFillDate function. diff --git a/tests/phpunit/WebTest/Event/ChangeParticipantStatus.php b/tests/phpunit/WebTest/Event/ChangeParticipantStatus.php index 5ee2be1f3a..86322ef4bc 100644 --- a/tests/phpunit/WebTest/Event/ChangeParticipantStatus.php +++ b/tests/phpunit/WebTest/Event/ChangeParticipantStatus.php @@ -54,13 +54,8 @@ class WebTest_Event_ChangeParticipantStatus extends CiviSeleniumTestCase { // Search the participants $this->openCiviPage("event/search", "reset=1", '_qf_Search_refresh'); - $eventName = 'Rain'; - $this->click("event_name"); - $this->type("event_name", $eventName); - $this->typeKeys("event_name", $eventName); - $this->waitForElementPresent("css=div.ac_results-inner li"); - $this->click("css=div.ac_results-inner li"); - $this->assertContains($eventName, $this->getValue("event_name"), "autocomplete expected $eventName but didn’t find it in " . $this->getValue("event_name")); + $eventName = 'Rain-forest Cup Youth Soccer Tournament'; + $this->select2("event_id", $eventName); $this->click('_qf_Search_refresh'); $this->waitForElementPresent("xpath=//div[@id='participantSearch']/table/tbody//tr/td[3]/a[text()='$sortName1']"); @@ -74,12 +69,10 @@ class WebTest_Event_ChangeParticipantStatus extends CiviSeleniumTestCase { // Change participant status for selected participants $this->select('task', "label=Change Participant Status"); - $this->click('Go'); $this->waitForElementPresent('_qf_ParticipantStatus_next'); $this->select('status_change', "label=Attended"); - $this->click('_qf_ParticipantStatus_next'); - $this->waitForElementPresent('Go'); + $this->clickLink('_qf_ParticipantStatus_next'); $this->assertTrue($this->isTextPresent('The updates have been saved.'), "Status message didn't show up after saving!" ); @@ -112,10 +105,10 @@ class WebTest_Event_ChangeParticipantStatus 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]'); + $this->multiselect2('role_id', array('Volunteer')); // Choose Registration Date. // Using helper webtestFillDate function. @@ -134,7 +127,7 @@ class WebTest_Event_ChangeParticipantStatus extends CiviSeleniumTestCase { // Select an event fee $this->waitForElementPresent('priceset'); - $this->click("xpath=//input[@class='form-radio']"); + $this->click("xpath=//input[@class='crm-form-radio']"); // Select 'Record Payment' $this->click('record_contribution'); @@ -155,9 +148,9 @@ class WebTest_Event_ChangeParticipantStatus extends CiviSeleniumTestCase { "Status message didn't show up after saving!" ); - $this->waitForElementPresent("xpath=//div[@id='Events']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); //click through to the participant view screen - $this->click("xpath=//div[@id='Events']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->click("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); $this->waitForElementPresent('_qf_ParticipantView_cancel-bottom'); $this->webtestVerifyTabularData( @@ -166,9 +159,9 @@ class WebTest_Event_ChangeParticipantStatus extends CiviSeleniumTestCase { 'Participant Role' => 'Attendee', 'Status' => 'Registered', 'Event Source' => 'Event StandaloneAddTest Webtest', - 'Event Fees' => '$ 800.00', ) ); + $this->verifyText("xpath=//td[text()='Selections']/following-sibling::td//div/div", preg_quote('Event Total: $ 800.00')); } } diff --git a/tests/phpunit/WebTest/Event/EventListingTest.php b/tests/phpunit/WebTest/Event/EventListingTest.php index 535b776d27..dde4a8004d 100644 --- a/tests/phpunit/WebTest/Event/EventListingTest.php +++ b/tests/phpunit/WebTest/Event/EventListingTest.php @@ -160,7 +160,7 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase { // Wait for "saved" status msg $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForTextPresent("'Location' information has been saved."); + $this->waitForText("crm-notification-container", "'Event Location' information has been saved."); } } diff --git a/tests/phpunit/WebTest/Event/EventWaitListTest.php b/tests/phpunit/WebTest/Event/EventWaitListTest.php index de410f61fa..ad3a7a5133 100644 --- a/tests/phpunit/WebTest/Event/EventWaitListTest.php +++ b/tests/phpunit/WebTest/Event/EventWaitListTest.php @@ -123,6 +123,7 @@ class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase { $this->assertChecked("is_multiple_registrations"); } + $this->click('intro_text-plain'); $this->fillRichTextField("intro_text", $registerIntro); // enable confirmation email diff --git a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php index 128f65d76e..cbca03844a 100644 --- a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php +++ b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php @@ -297,7 +297,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->type("label", $field3); $this->check("is_searchable"); - $this->click("_qf_Field_next-bottom"); + $this->click("_qf_Field_done-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); // get id of custom fields @@ -324,10 +324,10 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { // Go to Online Contribution tab $this->click("link=Online Registration"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); - $this->click("xpath=//select[@id='additional_custom_post_id_multiple_1']/../span/a[text()='remove profile']"); - $this->click("xpath=//select[@id='additional_custom_post_id_multiple_2']/../span/a[text()='remove profile']"); - $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("xpath=//*[@id='additional_custom_post_id_multiple_1']/parent::td/span/a[text()='remove profile']"); + $this->click("xpath=//*[@id='additional_custom_post_id_multiple_2']/parent::td/span/a[text()='remove profile']"); + $this->click("xpath=//*[@id='additional_custom_post_id_multiple_3']/parent::td/span/a[text()='remove profile']"); + $this->click("xpath=//*[@id='additional_custom_post_id_multiple_4']/parent::td/span/a[text()='remove profile']"); $this->click("_qf_Registration_upload-bottom"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); } @@ -563,54 +563,54 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->waitForElementPresent("_qf_Registration_upload-bottom"); $this->click("is_online_registration"); $this->check("is_multiple_registrations"); - $this->select("custom_pre_id", "value=1"); - $this->select("custom_post_id", "value=" . $profileId[3]); - $this->select("additional_custom_post_id", "label=- same as for main contact -"); + $this->select("xpath=//*[@id='custom_pre_id']/parent::td/div[1]/div/span/select[@class='select2-offscreen']", "value=1"); + $this->select("xpath=//*[@id='custom_post_id']/parent::td/div[1]/div/span/select[@class='select2-offscreen']", "value=" . $profileId[3]); + $this->select("xpath=//*[@id='additional_custom_post_id']/parent::td/div[1]/div/span/select[@class='select2-offscreen']", "- same as for main contact -"); - $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); - $this->click("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); + $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); + $this->click("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); $this->waitForElementPresent("custom_post_id_multiple_1"); - $this->select("custom_post_id_multiple_1", "value=" . $profileId[2]); + $this->select("xpath=//*[@id='custom_post_id_multiple_1']/parent::td/div[1]/div/span/select[@class='select2-offscreen']", "value=" . $profileId[2]); - $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); - $this->click("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); + $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); + $this->click("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); $this->waitForElementPresent("custom_post_id_multiple_2"); - $this->select("custom_post_id_multiple_2", "value=" . $profileId[1]); + $this->select("xpath=//*[@id='custom_post_id_multiple_2']/parent::td/div[1]/div/span/select[@class='select2-offscreen']", "value=" . $profileId[1]); - $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); - $this->click("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); + $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); + $this->click("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); $this->waitForElementPresent("custom_post_id_multiple_3"); - $this->select("custom_post_id_multiple_3", "value=" . $profileId[4]); + $this->select("xpath=//*[@id='custom_post_id_multiple_3']/parent::td/div[1]/div/span/select[@class='select2-offscreen']", "value=" . $profileId[4]); - $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); - $this->click("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); + $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); + $this->click("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); $this->waitForElementPresent("custom_post_id_multiple_4"); - $this->select("custom_post_id_multiple_4", "value=" . $profileId[5]); + $this->select("xpath=//*[@id='custom_post_id_multiple_4']/parent::td/div[1]/div/span/select[@class='select2-offscreen']", "value=" . $profileId[5]); - $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); - $this->click("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); + $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); + $this->click("xpath=//div[@id='registration_screen']/table[2]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); $this->waitForElementPresent("custom_post_id_multiple_5"); - $this->select("custom_post_id_multiple_5", "value=" . $profileId[6]); + $this->select("xpath=//*[@id='custom_post_id_multiple_5']/parent::td/div[1]/div/span/select[@class='select2-offscreen']", "value=" . $profileId[6]); - $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); - $this->click("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); + $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); + $this->click("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); $this->waitForElementPresent("additional_custom_post_id_multiple_1"); - $this->select("additional_custom_post_id_multiple_1", "value=" . $profileId[5]); + $this->select("xpath=//*[@id='additional_custom_post_id_multiple_1']/parent::td/div[1]/div/span/select[@class='select2-offscreen']", "value=" . $profileId[5]); - $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); - $this->click("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); + $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); + $this->click("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); $this->waitForElementPresent("additional_custom_post_id_multiple_2"); - $this->select("additional_custom_post_id_multiple_2", "value=" . $profileId[1]); + $this->select("xpath=//*[@id='additional_custom_post_id_multiple_2']/parent::td/div[1]/div/span/select[@class='select2-offscreen']", "value=" . $profileId[1]); - $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); - $this->click("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); + $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); + $this->click("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); $this->waitForElementPresent("additional_custom_post_id_multiple_3"); - $this->select("additional_custom_post_id_multiple_3", "value=" . $profileId[2]); + $this->select("xpath=//*[@id='additional_custom_post_id_multiple_3']/parent::td/div[1]/div/span/select[@class='select2-offscreen']", "value=" . $profileId[2]); - $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); - $this->click("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add profile']"); + $this->waitForElementPresent("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); + $this->click("xpath=//div[@id='registration_screen']/table[3]//tbody/tr[2]/td[2]/span/a[text()='add another profile (bottom of page)']"); $this->waitForElementPresent("additional_custom_post_id_multiple_4"); - $this->select("additional_custom_post_id_multiple_4", "value=" . $profileId[3]); + $this->select("xpath=//*[@id='additional_custom_post_id_multiple_4']/parent::td/div[1]/div/span/select[@class='select2-offscreen']", "value=" . $profileId[3]); $this->click("CIVICRM_QFID_1_is_email_confirm"); $this->type("confirm_from_name", "TestEvent"); diff --git a/tests/phpunit/WebTest/Event/PCPAddTest.php b/tests/phpunit/WebTest/Event/PCPAddTest.php index ffe3057827..310d00df63 100644 --- a/tests/phpunit/WebTest/Event/PCPAddTest.php +++ b/tests/phpunit/WebTest/Event/PCPAddTest.php @@ -251,6 +251,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->assertChecked("is_multiple_registrations"); } + $this->click('intro_text-plain'); $this->fillRichTextField("intro_text", $registerIntro); // enable confirmation email diff --git a/tests/phpunit/WebTest/Event/ParticipantCountTest.php b/tests/phpunit/WebTest/Event/ParticipantCountTest.php index 6a4ba804c3..945e1e59df 100644 --- a/tests/phpunit/WebTest/Event/ParticipantCountTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantCountTest.php @@ -387,6 +387,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->check('is_online_registration'); $this->assertChecked('is_online_registration'); + $this->click('intro_text-plain'); $this->fillRichTextField('intro_text', 'Fill in all the fields below and click Continue.'); // enable confirmation email diff --git a/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php b/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php index 65062f9b39..eb664fdb55 100644 --- a/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php +++ b/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php @@ -1204,6 +1204,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { $this->click('is_multiple_registrations'); } + $this->click('intro_text-plain'); $this->fillRichTextField('intro_text', 'Fill in all the fields below and click Continue.'); // enable confirmation email diff --git a/tests/phpunit/WebTest/Event/TellAFriendTest.php b/tests/phpunit/WebTest/Event/TellAFriendTest.php index 1528e8f4cd..f74209f420 100644 --- a/tests/phpunit/WebTest/Event/TellAFriendTest.php +++ b/tests/phpunit/WebTest/Event/TellAFriendTest.php @@ -141,14 +141,13 @@ 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('Go'); - $this->assertTrue($this->isTextPresent('1 Contact')); + $this->waitForTextPresent('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("Go"); + $this->waitForElementPresent("xpath=//div[@class='crm-search-results']//table[@class='selector row-highlight']/tbody/tr[2]/td[9]/span/a[text()='View']"); $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]/span/a[1]", @@ -238,6 +237,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->assertChecked("is_multiple_registrations"); } + $this->click('intro_text-plain'); $this->fillRichTextField("intro_text", $registerIntro); // enable confirmation email -- 2.25.1