From 16345393846da1dbc8bea512e2086a157a0b6aa6 Mon Sep 17 00:00:00 2001 From: Atif Shaikh Date: Wed, 2 Apr 2014 19:29:02 +0530 Subject: [PATCH] Webtest Fix --- tests/phpunit/CiviTest/CiviSeleniumTestCase.php | 5 ++++- tests/phpunit/WebTest/Event/AddParticipationTest.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index 586d2d6232..3520416eca 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -1818,12 +1818,15 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $this->check($checkId); } } + elseif ($elementType == 'select2') { + $this->select2($elementName, $entityData); + } } //checking for proper custom data which is loading through ajax $this->waitForElementPresent("xpath=//div[contains(@class, 'custom-group-{$customData['cgtitle']}')]", "The on the fly custom group has not been rendered for entity : {$entity} => {$entityData}"); - $this->assertElementPresent("xpath=//div[contains(@class, 'custom-group-{$customData['cgtitle']}')]/[contains(@class, 'crm-accordion-body')]/table/tbody/tr/td[2]/input", + $this->assertElementPresent("xpath=//div[contains(@class, 'custom-group-{$customData['cgtitle']}')]/div[contains(@class, 'crm-accordion-body')]/table/tbody/tr/td[2]/input", "The on the fly custom group field is not present for entity : {$entity} => {$entityData}"); } } diff --git a/tests/phpunit/WebTest/Event/AddParticipationTest.php b/tests/phpunit/WebTest/Event/AddParticipationTest.php index 7ba096020a..f64f8ba916 100644 --- a/tests/phpunit/WebTest/Event/AddParticipationTest.php +++ b/tests/phpunit/WebTest/Event/AddParticipationTest.php @@ -377,7 +377,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $customSets = array( array('entity' => 'ParticipantEventName', 'subEntity' => 'Fall Fundraiser Dinner', - 'triggerElement' => array('name' => "event_id", 'type' => "select")), + 'triggerElement' => array('name' => "event_id", 'type' => "select2")), array('entity' => 'ParticipantRole', 'subEntity' => 'Attendee','triggerElement' => array('type' => "checkbox")) ); $pageUrl = array('url' => "participant/add", 'args' => "reset=1&action=add&context=standalone"); -- 2.25.1