From 038f0330149dffffce9ad831ee43d83e2b818966 Mon Sep 17 00:00:00 2001 From: atif-shaikh Date: Wed, 17 Sep 2014 19:00:36 +0530 Subject: [PATCH] WebtestFix --- tests/phpunit/WebTest/Event/AddEventTest.php | 13 +++---------- .../phpunit/WebTest/Event/PricesetMaxCountTest.php | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index a064963a68..d726c76595 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -155,16 +155,9 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { //Add Price Set now $this->openCiviPage("event/manage/fee", "reset=1&action=update&id=$id", "_qf_Fee_upload-bottom"); $this->click("xpath=//a[@id='quickconfig']"); - $this->waitForElementPresent('popupContainer'); - // Because it tends to cause problems, all uses of sleep() must be justified in comments - // Sleep should never be used for wait for anything to load from the server - // Justification for this instance: FIXME - sleep(3); - $this->click("xpath=//div[@class='ui-dialog-buttonset']/button[1]"); - // Because it tends to cause problems, all uses of sleep() must be justified in comments - // Sleep should never be used for wait for anything to load from the server - // Justification for this instance: FIXME - sleep(3); + $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']"); + $this->click("xpath=//div[@class='ui-dialog-buttonset']/button[2]"); + $this->waitForElementPresent("xpath=//a[@id='quickconfig']"); //Assert quick config change and discount deletion $this->openCiviPage("admin/price", "reset=1"); diff --git a/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php b/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php index db7aec4c8b..06945a48bb 100644 --- a/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php +++ b/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php @@ -117,7 +117,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { $pricesetLoc = $this->getLocation(); // get text field Id. - $textFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]@href")); + $textFieldId = explode('&id=', $this->getAttribute("xpath=//div[@class='crm-main-content-wrapper']//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]@href")); $textFieldId = explode('&', $textFieldId[0]); $textFieldId = explode('=', $textFieldId[3]); $textFieldId = $textFieldId[1]; -- 2.25.1