Webtest fixes
authorColeman Watts <coleman@civicrm.org>
Wed, 1 Oct 2014 01:09:33 +0000 (21:09 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 1 Oct 2014 01:09:33 +0000 (21:09 -0400)
tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php
tests/phpunit/WebTest/Campaign/PledgeTest.php

index fbd9b078ef92711f55e65e3d13e7008bae8b8ba7..13174e51e90acc000b818aa5dd874036bd14e425 100644 (file)
@@ -2289,8 +2289,8 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
    */
   function checkForErrorsOnPage() {
     foreach (array('Access denied', 'Page not found') as $err) {
-      if ($this->isElementPresent("xpath=//h1[text()='$err']")) {
-        $this->fail("\"$err\" encountered at " . $this->getLocation());
+      if ($this->isElementPresent("xpath=//h1[contains(., '$err')]")) {
+        $this->fail("'$err' encountered at " . $this->getLocation() . "\nwhile logged in as '{$this->loggedInAs}'");
       }
     }
     if ($this->isElementPresent("xpath=//span[text()='Sorry but we are not able to provide this at the moment.']")) {
index aa797c91933343c4a74c18e5680bbeac438c1055..0694cf14b0553a3b7937407ebff9715cdca1529c 100644 (file)
@@ -36,8 +36,8 @@ class WebTest_Campaign_CampaignDescriptionTest extends CiviSeleniumTestCase {
   }
 
   function testCreateCampaign() {
-
-    $this->webtestLogin();
+    // Fixme: testing a theory that this test was failing due to permissions
+    $this->webtestLogin('admin');
 
     // Create new group
     $title = substr(sha1(rand()), 0, 7);
index a582a1fc8c49b91532a05db7648ee1bdd885f65e..9ca12c268cab5d45d64255f0c31e2203687ffda6 100644 (file)
@@ -49,8 +49,8 @@ class WebTest_Campaign_PledgeTest extends CiviSeleniumTestCase {
     );
     $this->changePermissions($permissions);
 
-    // Log in as demo user
-    $this->webtestLogin();
+    // Fixme: testing a theory that this test was failing due to permissions
+    //$this->webtestLogin();
 
     // Create new group
     $title = substr(sha1(rand()), 0, 7);