From: Coleman Watts Date: Wed, 1 Oct 2014 01:09:33 +0000 (-0400) Subject: Webtest fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=037454ae764fd42735dde5085fd5bf95c161e5ca;p=civicrm-core.git Webtest fixes --- diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index fbd9b078ef..13174e51e9 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -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.']")) { diff --git a/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php b/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php index aa797c9193..0694cf14b0 100644 --- a/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php +++ b/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php @@ -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); diff --git a/tests/phpunit/WebTest/Campaign/PledgeTest.php b/tests/phpunit/WebTest/Campaign/PledgeTest.php index a582a1fc8c..9ca12c268c 100644 --- a/tests/phpunit/WebTest/Campaign/PledgeTest.php +++ b/tests/phpunit/WebTest/Campaign/PledgeTest.php @@ -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);