From ca0cdd20078f7258ba39b30b22bcd8c710ca78fb Mon Sep 17 00:00:00 2001 From: Web Access Date: Thu, 12 Mar 2015 18:39:01 +0530 Subject: [PATCH] Webtest Fixes --- .../Contact/AddContactsToEventAdvancedSearchTest.php | 4 ++-- .../Contact/AdvancedSearchedRelatedContactTest.php | 1 + tests/phpunit/WebTest/Contact/RelationshipAddTest.php | 4 ++-- tests/phpunit/WebTest/Event/AddPricesetTest.php | 10 +++++----- tests/phpunit/WebTest/Event/AdditionalPaymentTest.php | 4 ++-- tests/phpunit/WebTest/Member/ContactContextAddTest.php | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php index 863ad35113..f9aaf0c8a0 100644 --- a/tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php @@ -43,8 +43,8 @@ class WebTest_Contact_AddContactsToEventAdvancedSearchTest extends CiviSeleniumT $this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh'); $this->click('_qf_Advanced_refresh'); - $this->waitForElementPresent('CIVICRM_QFID_ts_all_8'); - $this->click('CIVICRM_QFID_ts_all_8'); + $this->waitForElementPresent("xpath=//div[@id='search-status']/table/tbody/tr[2]/td[2]/input[1]"); + $this->click("xpath=//div[@id='search-status']/table/tbody/tr[2]/td[2]/input[1]"); $this->select('task', "label=Add Contacts to Event"); diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index 7488f11008..a81e280309 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -257,6 +257,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->select('relationship_type_id', "label={$relType}"); //fill in the individual + $this->waitForElementPresent("related_contact_id"); $this->select2('related_contact_id', $relatedName, TRUE); //fill in the relationship start date diff --git a/tests/phpunit/WebTest/Contact/RelationshipAddTest.php b/tests/phpunit/WebTest/Contact/RelationshipAddTest.php index 8955ab137f..7b2207ace8 100644 --- a/tests/phpunit/WebTest/Contact/RelationshipAddTest.php +++ b/tests/phpunit/WebTest/Contact/RelationshipAddTest.php @@ -337,8 +337,8 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { //check the status message $this->waitForText('crm-notification-container', 'Relationship created.'); - $this->waitForElementPresent("xpath=//table[@id='DataTables_Table_2']/tbody/tr/td[9]/span/a[1][text()='View']"); - $this->click("xpath=//table[@id='DataTables_Table_2']/tbody/tr[1]/td[9]/span/a[1][text()='View']"); + $this->waitForElementPresent("xpath=//table[@class='crm-contact-relationship-selector-current dataTable no-footer']/tbody/tr/td[9]/span/a[1][text()='View']"); + $this->click("xpath=//table[@class='crm-contact-relationship-selector-current dataTable no-footer']/tbody/tr/td[9]/span/a[1][text()='View']"); $this->webtestVerifyTabularData( array( diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index d49f3936e8..b26c56621b 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -490,10 +490,10 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { // Is status message correct? $this->waitForText("crm-notification-container", "Event registration for $displayName has been added", "Status message didn't show up after saving!"); - $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->click("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->click("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table/tbody/tr[1]/td[8]/span/a[text()='View']"); $this->waitForElementPresent('_qf_ParticipantView_cancel-bottom'); } @@ -618,9 +618,9 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { // Is status message correct? $this->waitForText("crm-notification-container", "Event registration for $displayName has been added"); - $this->waitForElementPresent("xpath=//form[@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->click("xpath=//form[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->click("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table//tbody/tr[1]/td[8]/span/a[text()='View']"); $this->waitForElementPresent('_qf_ParticipantView_cancel-bottom'); $this->webtestVerifyTabularData( @@ -732,7 +732,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { //check the delete for priceset $this->openCiviPage("admin/price", "reset=1"); - $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/span[2]"); + $this->waitForElementPresent("xpath=//table[@class='display crm-price-set-listing dataTable no-footer']/tbody/tr/td[4]/span[2]"); $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/span[2]/ul/li[3]/a"); // Check confirmation alert. $this->assertTrue((bool) preg_match("/^Are you sure you want to delete this price set?/", diff --git a/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php b/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php index 235d18b9ac..a60249a853 100644 --- a/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php +++ b/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php @@ -109,9 +109,9 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { // Is status message correct? $this->waitForText('crm-notification-container', "Event registration for $displayName has been added"); - $this->waitForElementPresent("xpath=//form[@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->click("xpath=//form[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->click("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table/tbody/tr[1]/td[8]/span/a[text()='View']"); $this->waitForElementPresent('_qf_ParticipantView_cancel-bottom'); $this->webtestVerifyTabularData( diff --git a/tests/phpunit/WebTest/Member/ContactContextAddTest.php b/tests/phpunit/WebTest/Member/ContactContextAddTest.php index 9603ece783..0089f09df6 100644 --- a/tests/phpunit/WebTest/Member/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Member/ContactContextAddTest.php @@ -140,7 +140,7 @@ class WebTest_Member_ContactContextAddTest extends CiviSeleniumTestCase { $this->select("membership_type_id[1]", "label={$lifeTimeMemTypeParams['membership_type']}"); $this->waitForElementPresent("xpath=//form[@id='Membership']/div[2]/div[2]//table/tbody//tr[@class='crm-membership-form-block-end_date']/td[2]"); - $this->click("xpath=//form[@id='Membership']/div[2]/div[2]//table/tbody//tr[@class='crm-membership-form-block-end_date']/td[2]/a[@title='Clear']"); + $this->click("xpath=//form[@id='Membership']/div[2]/div[2]/table/tbody//tr[@class='crm-membership-form-block-end_date']/td[2]/a"); $this->click("_qf_Membership_upload-bottom"); -- 2.25.1