$this->changePermissions($permissions);
// change report setting to for a particular role
- $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('report/instance/1', 'reset=1');
$this->click("css=div.crm-report_setting-accordion div.crm-accordion-header");
$this->waitForElementPresent("_qf_Summary_submit_save");
$this->select("permission", "value=access CiviCRM");
$this->click("add");
$this->click("_qf_Summary_submit_save");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
+ $this->openCiviPage('logout', 'reset=1', NULL);
$this->open($this->sboxPath);
$this->waitForElementPresent('edit-submit');
$this->type('edit-name', $user2);
$this->type('edit-pass', 'Test12345');
$this->click('edit-submit');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("You do not have permission to access this report."));
- $this->open($this->sboxPath . "civicrm/report/list?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('report/instance/1', 'reset=1');
+ $this->assertElementContainsText('crm-container', 'You do not have permission to access this report.');
+ $this->openCiviPage('report/list', 'reset=1');
+ $this->openCiviPage('logout', 'reset=1', NULL);
//delete roles
$this->webtestLogin(TRUE);
$roleId = explode('/', $this->getAttribute("xpath=//table[@id='user-roles']/tbody//tr/td[1][text()='{$role}']/../td[4]/a[text()='edit permissions']/@href"));
$roleId = end($roleId);
$user = $this->_testCreateUser($roleId);
- $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('report/instance/1', 'reset=1');
if ($this->isChecked("is_reserved")) {
$this->click("is_reserved");
$this->click("_qf_Summary_submit_save");
);
$this->changePermissions($permissions);
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
+ $this->openCiviPage('logout', 'reset=1', NULL);
$this->open($this->sboxPath);
$this->waitForElementPresent('edit-submit');
$this->type('edit-name', $user);
$this->type('edit-pass', 'Test12345');
$this->click('edit-submit');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('report/instance/1', 'reset=1');
//check if the reserved report field is frozen
$this->assertTrue($this->isElementPresent("xpath=//div[@id='instanceForm']//table[3]/tbody//tr/td[2]/tt[text()='[ ]']"));
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
+ $this->openCiviPage('logout', 'reset=1', NULL);
$this->open($this->sboxPath);
$this->webtestLogin(TRUE);
// let's give full CiviReport permissions.
);
$this->changePermissions($permissions);
- $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('report/instance/1', 'reset=1');
//make the report reserved
$this->click("is_reserved");
$this->click("_qf_Summary_submit_save");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
+ $this->openCiviPage('logout', 'reset=1', NULL);
$this->open($this->sboxPath);
$this->waitForElementPresent('edit-submit');
$this->type('edit-name', $user);
$this->type('edit-pass', 'Test12345');
$this->click('edit-submit');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('report/instance/1', 'reset=1');
//check if the report criteria and settings is accessible
$this->assertTrue($this->isElementPresent("xpath=//form[@id='Summary']//div[@id='id_default']//input[@id='fields_email']"));
$this->assertTrue($this->isElementPresent("xpath=//form[@id='Summary']//div[@id='instanceForm']/table//input[@id='title']"));
//login as admin and remove reserved permission
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
+ $this->openCiviPage('logout', 'reset=1', NULL);
$this->open($this->sboxPath);
$this->webtestLogin(TRUE);
$this->open($this->sboxPath . "admin/people/permissions");
$this->waitForPageToLoad($this->getTimeoutMsec());
//login as user and check for absence of report criteria and settings
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
+ $this->openCiviPage('logout', 'reset=1', NULL);
$this->open($this->sboxPath);
$this->waitForElementPresent('edit-submit');
$this->type('edit-name', $user);
$this->type('edit-pass', 'Test12345');
$this->click('edit-submit');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('report/instance/1', 'reset=1');
if ($this->isElementPresent("xpath=//form[@id='Summary']/div[2]/div/div/div")) {
$this->verifyNotText("xpath=//form[@id='Summary']/div[2]/div/div/div", "Report Criteria");
$this->assertFalse($this->isElementPresent("xpath=//form[@id='Summary']//div[@id='instanceForm']//input[@id='title']"));
//login as admin and turn the is_reserved flag off for the instance
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
+ $this->openCiviPage('logout', 'reset=1', NULL);
$this->open($this->sboxPath);
$this->webtestLogin(TRUE);
- $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('report/instance/1', 'reset=1');
$this->click("is_reserved");
$this->click("_qf_Summary_submit_save");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
+ $this->openCiviPage('logout', 'reset=1', NULL);
$this->open($this->sboxPath);
$this->waitForElementPresent('edit-submit');
$this->type('edit-name', $user);
$this->type('edit-pass', 'Test12345');
$this->click('edit-submit');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/report/instance/1?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('report/instance/1', 'reset=1');
$this->assertTrue($this->isElementPresent("xpath=//form[@id='Summary']//div[@id='id_default']//input[@id='fields_email']"));
$this->assertTrue($this->isElementPresent("xpath=//form[@id='Summary']//div[@id='instanceForm']//input[@id='title']"));
//login as admin and delete the role
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
+ $this->openCiviPage('logout', 'reset=1', NULL);
$this->open($this->sboxPath);
$this->webtestLogin(TRUE);
$this->open($this->sboxPath . "admin/people/permissions/roles");