From 66d3f51b3e3f7819c4366b3976806432a06bd3bf Mon Sep 17 00:00:00 2001 From: Web Access Date: Fri, 18 Dec 2015 18:52:46 +0530 Subject: [PATCH] Tests fix --- tests/phpunit/WebTest/Contact/RelationshipAddTest.php | 4 ++-- .../phpunit/WebTest/Contribute/StandaloneAddTest.php | 11 ++++++----- tests/phpunit/WebTest/Event/AddParticipationTest.php | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/RelationshipAddTest.php b/tests/phpunit/WebTest/Contact/RelationshipAddTest.php index d4e7a1e806..1255f48c82 100644 --- a/tests/phpunit/WebTest/Contact/RelationshipAddTest.php +++ b/tests/phpunit/WebTest/Contact/RelationshipAddTest.php @@ -92,8 +92,8 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { //check the status message $this->waitForText('crm-notification-container', 'Relationship created.'); - $this->waitForElementPresent("xpath=//div[@id='contact-summary-relationship-tab']/div[@class='crm-contact-relationship-current']/div/table/tbody/tr/td[9]//span//a[text()='View']"); - $this->click("xpath=//div[@id='contact-summary-relationship-tab']/div[@class='crm-contact-relationship-current']/div/table/tbody/tr/td[9]//span//a[text()='View']"); + $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]//span//a[text()='View']"); + $this->click("xpath=//div[@class='crm-contact-relationship-current']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]//span//a[text()='View']"); $this->webtestVerifyTabularData( array( diff --git a/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php b/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php index 50483ade16..10b32d45c4 100644 --- a/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php @@ -224,8 +224,8 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { // select group $this->select("financial_type_id", "label={$financialType['name']}"); $this->clickLink("_qf_Search_refresh"); - $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[1]", "2 Result"); - $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[2]", "Financial Type ID In {$financialType['name']}"); + $this->assertElementContainsText("xpath=//div[@class='crm-content-block']//div[@id='search-status']/table/tbody/tr[1]/td[1]", "2 Result"); + $this->assertElementContainsText("xpath=//div[@class='crm-content-block']//div[@id='search-status']/table/tbody/tr[1]/td[2]", "Financial Type ID In {$financialType['name']}"); $this->openCiviPage("contact/search/advanced", "reset=1", "_qf_Advanced_refresh-top"); $this->clickAjaxLink('CiviContribute', "financial_type_id"); @@ -233,8 +233,8 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { // select group $this->select("financial_type_id", "label={$financialType['name']}"); $this->clickLink("_qf_Advanced_refresh-top"); - $this->assertElementContainsText("xpath=//div[@id='search-status']//table/tbody/tr[1]/td[1]", "2 Contacts"); - $this->assertElementContainsText("xpath=//div[@id='search-status']//table/tbody/tr[1]/td[2]", "Financial Type ID In {$financialType['name']}"); + $this->assertElementContainsText("xpath=//div[@class='crm-content-block']//div[@id='search-status']//table/tbody/tr[1]/td[1]", "2 Contacts"); + $this->assertElementContainsText("xpath=//div[@class='crm-content-block']//div[@id='search-status']//table/tbody/tr[1]/td[2]", "Financial Type ID In {$financialType['name']}"); } /** @@ -271,6 +271,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { $this->waitForElementPresent("thankyou_date"); $this->type("note", "This is a test note."); + $this->waitForElementPresent("non_deductible_amount"); $this->type("non_deductible_amount", "10"); $this->type("fee_amount", "0"); $this->type("net_amount", "0"); @@ -278,7 +279,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { $this->webtestFillDate('thankyou_date'); // Clicking save. - $this->clickLink("_qf_Contribution_upload"); + $this->click("_qf_Contribution_upload"); // Is status message correct? $this->checkCRMAlert("The contribution record has been saved."); diff --git a/tests/phpunit/WebTest/Event/AddParticipationTest.php b/tests/phpunit/WebTest/Event/AddParticipationTest.php index 62aafb7987..7dadde372f 100644 --- a/tests/phpunit/WebTest/Event/AddParticipationTest.php +++ b/tests/phpunit/WebTest/Event/AddParticipationTest.php @@ -269,6 +269,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $this->click("xpath=//input[@class='crm-form-radio']"); // Enter amount to be paid (note: this should default to selected fee level amount, s/b fixed during 3.2 cycle) + $this->waitForElementPresent('total_amount'); $this->type('total_amount', '800'); // Select payment method = Check and enter chk number -- 2.25.1