From bfc3faa22b7695c066bc5ff6775f721cbbfeb140 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Tue, 3 Mar 2015 18:35:36 +0530 Subject: [PATCH] webtest fixes 4.6 --- .../WebTest/Case/ActivityToCaseTest.php | 9 +++--- .../WebTest/Contact/AdvanceSearchPaneTest.php | 32 +++++++++---------- .../WebTest/Contact/AdvancedSearchTest.php | 10 +++--- .../Member/DefaultMembershipPricesetTest.php | 6 ++-- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php index e1a6223fb1..32cf470fc8 100644 --- a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php +++ b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php @@ -320,14 +320,13 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { $this->click("xpath=//span[@class='ui-button-icon-primary ui-icon ui-icon-closethick']"); $this->waitForElementPresent("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody/tr[1]/td[2]"); - $this->click("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/a[text()='{$subject}']/../../td[6]/a[text()='Scheduled']"); + $this->click("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/a[text()='{$subject}']/../../td[6]/div[text()='Scheduled']"); - $this->waitForElementPresent("xpath=//html/body/div[7]"); - $this->waitForElementPresent('activity_change_status'); + $this->waitForElementPresent("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/a[text()='{$subject}']/../../td[6]/div/form/select"); // change activity status - $this->select('activity_change_status', 'value=2'); - $this->click("xpath=//div[@class='ui-dialog-buttonset']/button[1]/span[2]"); + $this->select("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/a[text()='{$subject}']/../../td[6]/div/form/select", 'value=2'); + $this->click("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/a[text()='{$subject}']/../../td[6]/div/form/button[@type='submit']"); $this->openCiviPage('case', 'reset=1'); $this->click("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[9]/span/a[text()='Manage']"); $this->waitForElementPresent('_qf_CaseView_cancel-bottom'); diff --git a/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php b/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php index 6de786b159..f3acb888ce 100644 --- a/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php +++ b/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php @@ -215,13 +215,9 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { 'title' => 'Activities', 'fields' => array( 'Activity Type' => array( - 'type' => 'checkbox', - 'values' => array( - 'activity_type_id[6]', - 'activity_type_id[3]', - 'activity_type_id[5]', - 'activity_type_id[7]', - ), + 'type' => 'multiselect2', + 'locator' => 'activity_type_id', + 'values' => array(array('Contribution', 'Email', 'Event Registration', 'Membership Signup')), ), 'Activity Subject' => array( 'type' => 'text', @@ -229,8 +225,9 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { 'values' => array('Test Subject'), ), 'Activity Status' => array( - 'type' => 'checkbox', - 'values' => array('activity_status[1]', 'activity_status[2]'), + 'type' => 'multiselect2', + 'locator' => 'status_id', + 'values' => array(array('Scheduled', 'Completed')), ), ), ), @@ -253,7 +250,7 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { ), 'demographics' => array( 'headerLocator' => 'div#demographics', - 'bodyLocator' => 'input#birth_date_low_display', + 'bodyLocator' => 'input#birth_date_low', 'title' => 'Demographics', 'fields' => array( 'Birth Date Range' => array( @@ -318,8 +315,9 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { 'values' => array('Donation'), ), 'Contribution Status' => array( - 'type' => 'checkbox', - 'values' => array('contribution_status_id[1]', 'contribution_status_id[2]'), + 'type' => 'multiselect2', + 'locator' => 'contribution_status_id', + 'values' => array(array('Completed', 'Pending')), ), ), ), @@ -344,12 +342,14 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { 'title' => 'Events', 'fields' => array( 'Participant Status' => array( - 'type' => 'checkbox', - 'values' => array('participant_status_id[1]', 'participant_status_id[2]'), + 'type' => 'multiselect2', + 'locator' => 'participant_status_id', + 'values' => array(array('Registered', 'Attended')), ), 'Participant Role' => array( - 'type' => 'checkbox', - 'values' => array('participant_role_id[1]', 'participant_role_id[2]'), + 'type' => 'multiselect2', + 'locator' => 'participant_role_id', + 'values' => array(array('Attendee', 'Volunteer')), ), ), ), diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php index 2df1dacd67..0a9eb7fb55 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php @@ -355,7 +355,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { // check for completed $this->multiselect2("contribution_status_id", array('Completed')); // enter check number - $this->select2("payment_instrument_id", "Check"); + $this->select("payment_instrument_id", "Check"); $this->type("contribution_check_number", "chqNo$firstName"); // fill transaction id $this->type("contribution_trxn_id", "trid$firstName"); @@ -373,10 +373,10 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { $this->select2("event_id", "Fall Fundraiser Dinner"); // fill event type $this->select2("event_type_id", "Fundraiser"); - // check participant status (registered) - $this->click("xpath=//div[@id='participantForm']/table/tbody//tr/td/label[text()='Participant Status']/../div//div/label[text()='Registered']"); - // check participant role (Volunteer) - $this->click("xpath=//div[@id='participantForm']/table/tbody//tr/td/label[text()='Participant Role']/../div//div/label[text()='Volunteer']"); + // select participant status (registered) + $this->multiselect2('participant_status_id', array('Registered')); + // select participant role (Volunteer) + $this->multiselect2('participant_role_id', array('Volunteer')); // fill participant fee level (couple) $this->select2("participant_fee_id", "Couple"); // fill amount range diff --git a/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php b/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php index a89416b7d3..7930983004 100755 --- a/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php +++ b/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php @@ -220,17 +220,17 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase elseif (!$defaultPriceSet) { $memTypeParams1 = $this->webtestAddMembershipType(); $memTypeTitle1 = $memTypeParams1['membership_type']; - $memTypeId1 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[text()='{$memTypeTitle1}']/../td[12]/span/a[3]@href")); + $memTypeId1 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td/div[text()='{$memTypeTitle1}']/../../td[12]/span/a[3]@href")); $memTypeId1 = $memTypeId1[1]; $memTypeParams2 = $this->webtestAddMembershipType(); $memTypeTitle2 = $memTypeParams2['membership_type']; - $memTypeId2 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[text()='{$memTypeTitle2}']/../td[12]/span/a[3]@href")); + $memTypeId2 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td/div[text()='{$memTypeTitle2}']/../../td[12]/span/a[3]@href")); $memTypeId2 = $memTypeId2[1]; $memTypeParams3 = $this->webtestAddMembershipType(); $memTypeTitle3 = $memTypeParams3['membership_type']; - $memTypeId3 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[text()='{$memTypeTitle3}']/../td[12]/span/a[3]@href")); + $memTypeId3 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td/div[text()='{$memTypeTitle3}']/../../td[12]/span/a[3]@href")); $memTypeId3 = $memTypeId3[1]; } -- 2.25.1