WebtestFix
authoratif-shaikh <shaikh388@gmail.com>
Wed, 17 Sep 2014 13:30:36 +0000 (19:00 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Wed, 17 Sep 2014 13:30:36 +0000 (19:00 +0530)
tests/phpunit/WebTest/Event/AddEventTest.php
tests/phpunit/WebTest/Event/PricesetMaxCountTest.php

index a064963a685b536468df07bb6134b35e74f1c399..d726c76595026a79d9fae2af9ce395a490d7e25e 100644 (file)
@@ -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");
index db7aec4c8bc3a41b2a8d756407b9834808b43d22..06945a48bb6b6e08a57f34c6b51a4dd8ded58c73 100644 (file)
@@ -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];