From 050fb75a4776afcabdebe8dcf9249fc12b694fff Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Mon, 1 Apr 2013 13:43:16 +0530 Subject: [PATCH] webtest fix : the possibility of this test failing on server can be because of not appropriate permission for authenticated role user --- .../Profile/MultiRecordProfileAddTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php b/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php index a28b65c236..35dd9769c8 100644 --- a/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php +++ b/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php @@ -37,7 +37,13 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { } function testUserAddNewProfile() { - $this->webtestLogin(); + //add the required permission + $permissions = array( + 'edit-2-profile-listings-and-forms', + 'edit-2-access-all-custom-data', + 'edit-2-access-civicrm' + ); + $this->changePermissions($permissions); list($id, $profileTitle) = $this->_addNewProfile(TRUE, FALSE, TRUE); $this->_deleteProfile($id, $profileTitle); } @@ -49,7 +55,6 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { } function testNonSearchableMultiProfile() { - $this->webtestLogin(); list($id, $profileTitle) = $this->_addNewProfile(TRUE, TRUE); $this->_deleteProfile($id, $profileTitle); @@ -195,13 +200,7 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); $this->webtestLogout(); - $this->open("{$this->sboxPath}user"); - // Make sure login form is available - $this->waitForElementPresent('edit-submit'); - $this->type('edit-name', $recordNew['firstname']); - $this->type('edit-pass', $recordNew['firstname']); - $this->click('edit-submit'); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->webtestLogin($recordNew['firstname'], $recordNew['firstname']); } $this->openCiviPage('profile/edit', "reset=1&id=$id&gid=$gid", NULL); if (!$checkMultiRecord) { @@ -278,6 +277,7 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { } function _deleteProfile($gid, $profileTitle) { + $this->webtestLogin(); $this->openCiviPage("admin/uf/group", "action=delete&id={$gid}", '_qf_Group_next-bottom'); $this->click('_qf_Group_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); -- 2.25.1