From 47aea6bbd8cad818ec6b958de85d5d4bd7c018bf Mon Sep 17 00:00:00 2001 From: Rohan Katkar Date: Thu, 4 Sep 2014 09:25:47 +0530 Subject: [PATCH] Fix for Webtest --- .../AddContactsToEventAdvancedSearchTest.php | 2 +- .../WebTest/Contact/RelationshipAddTest.php | 14 +++++++------- .../phpunit/WebTest/Contribute/AddBatchesTest.php | 5 +++-- .../WebTest/Contribute/OnlineContributionTest.php | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php index 7ab52f6000..e60eb952b3 100644 --- a/tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php @@ -47,7 +47,7 @@ class WebTest_Contact_AddContactsToEventAdvancedSearchTest extends CiviSeleniumT $this->click('CIVICRM_QFID_ts_all_8'); $this->select('task', "label=Add Contacts to Event"); - $this->click('Go'); + // Select event. Based on label for now. $this->waitForElementPresent('event_id'); diff --git a/tests/phpunit/WebTest/Contact/RelationshipAddTest.php b/tests/phpunit/WebTest/Contact/RelationshipAddTest.php index a9d0a61914..0aa9760453 100644 --- a/tests/phpunit/WebTest/Contact/RelationshipAddTest.php +++ b/tests/phpunit/WebTest/Contact/RelationshipAddTest.php @@ -338,14 +338,14 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { //save the relationship //$this->click("_qf_Relationship_upload"); $this->click("_qf_Relationship_upload-bottom"); - $this->waitForElementPresent("crm-contact-relationship-selector-current_wrapper"); + //check the status message $this->waitForText('crm-notification-container', 'Relationship created.'); - $this->waitForElementPresent("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); - $this->click("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); - + $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->webtestVerifyTabularData( array( 'Description' => $description, @@ -419,12 +419,12 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { //$this->click("_qf_Relationship_upload"); $this->click('_qf_Relationship_upload-bottom'); $this->waitForElementPresent("crm-contact-relationship-selector-current_wrapper"); - + //check the status message $this->waitForText('crm-notification-container', 'Relationship created.'); - $this->waitForElementPresent("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); - $this->click("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); + $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->webtestVerifyTabularData( array( diff --git a/tests/phpunit/WebTest/Contribute/AddBatchesTest.php b/tests/phpunit/WebTest/Contribute/AddBatchesTest.php index 1de08ae0d5..7f08522cd6 100644 --- a/tests/phpunit/WebTest/Contribute/AddBatchesTest.php +++ b/tests/phpunit/WebTest/Contribute/AddBatchesTest.php @@ -242,8 +242,9 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase { * @param $type */ function _verifyData($data, $type) { - $this->waitForElementPresent("xpath=//div[@id='crm-batch-selector_wrapper']//table//tbody/tr[1]/td[7]/span/a[text()='Enter records']"); - $this->clickLink("xpath=//div[@id='crm-batch-selector_wrapper']//table//tbody/tr[1]/td[7]/span/a[text()='Enter records']", "_qf_Entry_upload"); + $this->waitForElementPresent("xpath=//table[@id='DataTables_Table_0']/tbody//tr/td[7]/span/a[1][text()='Enter records']"); + $this->click("xpath=//table[@id='DataTables_Table_0']/tbody//tr/td[7]/span/a[1][text()='Enter records']"); + $this->waitForElementPresent('_qf_Entry_upload'); $this->click("_qf_Entry_upload"); $this->waitForPageToLoad($this->getTimeoutMsec()); foreach ($data as $value) { diff --git a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php index 2716d90a56..fb3e6d9657 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php @@ -146,7 +146,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase { $this->type("sort_name", "$firstName $lastName"); $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']"); - $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom"); + $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom",FALSE); //View Contribution Record and verify data $expected = array( -- 2.25.1