webtest fix
authorPratik Joshi <pratik.joshi@webaccess.co.in>
Thu, 21 Mar 2013 11:54:41 +0000 (17:24 +0530)
committerPratik Joshi <pratik.joshi@webaccess.co.in>
Thu, 21 Mar 2013 11:54:41 +0000 (17:24 +0530)
tests/phpunit/WebTest/Event/MultiprofileEventTest.php

index f5419f965dbe72a7f6476671355a1a9ec9e4e3b4..ea6602d89c3ccd4f2c4a7c31097f87ea0d011d2a 100644 (file)
@@ -420,7 +420,6 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
     //Add field to profile_testCreateProfile
     foreach ($profilefield as $key => $value) {
       $this->openCiviPage("admin/uf/group/field/add", "reset=1&action=add&gid=$profileId");
-      $this->waitForPageToLoad($this->getTimeoutMsec());
       if (in_array($value, $locationfields)) {
         $this->select("field_name[0]", "value={$type}");
         $this->select("field_name[1]", "value={$value}");
@@ -491,7 +490,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
 
     // select newly created processor
     $xpath = "xpath=//label[text() = '{$processorName}']/preceding-sibling::input[1]";
-    $this->assertTrue($this->isTextPresent($processorName));
+    $this->assertElementContainsText('css=.crm-event-manage-fee-form-block-payment_processor', $processorName);
     $this->check($xpath);
     $this->select("financial_type_id", "label=Event Fee");
     if ($priceSet) {
@@ -738,7 +737,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
 
     $cfId = "";
     //check wheather webtest has created the field
-    if (!$this->isTextPresent("The selected field was not added. It already exists in this profile")) {
+    if($this->assertElementNotContainsText('crm-notification-container', "The selected field was not added. It already exists in this profile")) {
       $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr[8]/td[9]/span/a[text()='Edit']");
       $cfId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr[8]/td[9]/span/a[text()='Edit']/@href"));
       $cfId = $cfId[1];
@@ -752,5 +751,4 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
     $this->click("_qf_Field_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
   }
-}
-
+}
\ No newline at end of file