From d99b7938860656a79c89a5de0577b32adc361c7b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 26 Mar 2014 10:50:38 -0400 Subject: [PATCH] Test fix --- tests/phpunit/CiviTest/CiviSeleniumTestCase.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index e0c2d717e9..b0bf51ae9f 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -1823,15 +1823,10 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { } } - //sleep method is used as to wait for custom field div to load - - //we cant use wait for the div element as we are asserting for the same, - //so wait for some time till the div loads - sleep(1); - //checking for proper custom data which is loading through ajax - $this->assertElementPresent("xpath=//div[@id='{$customData['cgtitle']}'][@class='crm-accordion-body']", + $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[@id='{$customData['cgtitle']}'][@class='crm-accordion-body']/table/tbody/tr/td[2]/input", + $this->assertElementPresent("xpath=//div[contains(@class, 'custom-group-{$customData['cgtitle']}')]/[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}"); } } -- 2.25.1