$this->click('quick-save');
$this->waitForElementPresent('current-relationships');
//check the status message
- $this->assertTrue($this->isTextPresent('New relationship created.'));
+ $this->assertElementContainsText('crm-notification-container', 'New relationship created.');
$this->waitForElementPresent("xpath=//div[@id='current-relationships']//div//table/tbody//tr/td[9]/span/a[text()='View']");
//verify inherited membership has been removed
$this->openCiviPage("contact/view", "reset=1&cid=$id&selectedChild=member", "xpath=//div[@class='crm-container-snippet']/div/div[3]");
- $this->assertTrue($this->isTextPresent('No memberships have been recorded for this contact.'));
+ $this->assertElementContainsText('Memberships', 'No memberships have been recorded for this contact.');
// visit relationship tab and re-enable the relationship
$this->click('css=li#tab_rel a');
//verify inherited membership has been removed
$this->openCiviPage("contact/view", "reset=1&cid={$id}&selectedChild=member", "xpath=//div[@class='crm-container-snippet']/div/div[3]");
- $this->assertTrue($this->isTextPresent('No memberships have been recorded for this contact.'));
+ $this->assertElementContainsText('Memberships', 'No memberships have been recorded for this contact.');
//enable relationship
$this->click('css=li#tab_rel a');
$this->waitForElementPresent('_qf_Field_next-bottom');
$this->click('_qf_Field_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("Price Field '{$fields[0]}' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "Price Field '{$fields[0]}' has been saved.");
// load the Price Set Preview and check for expected values
$this->_testVerifyPriceSet($validateStrings, $sid);
$this->assertType('numeric', $sid);
$fields = array("National Membership $title", "Radio");
- $this->open($this->sboxPath . "civicrm/admin/price/field?reset=1&action=add&sid={$sid}");
+ $this->openCiviPage('admin/price/field', "reset=1&action=add&sid={$sid}");
$validateStrings[] = $fields[0];
$this->type('label', $fields[0]);
$this->waitForElementPresent('_qf_Field_next-bottom');
$this->click('_qf_Field_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("Price Field '{$fields[0]}' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "Price Field '{$fields[0]}' has been saved.");
// load the Price Set Preview and check for expected values
$this->_testVerifyPriceSet($validateStrings, $sid);
}
function _testAddSet($setTitle, $usedFor, $contributionType = NULL, $setHelp) {
- $this->open($this->sboxPath . 'civicrm/admin/price?reset=1&action=add');
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent('_qf_Set_next-bottom');
+ $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom');
// Enter Priceset fields (Title, Used For ...)
$this->type('title', $setTitle);
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent('_qf_Field_next-bottom');
- $this->assertTrue($this->isTextPresent("Your Set '{$setTitle}' has been added. You can add fields to this set now."));
+ $this->assertElementContainsText('crm-notification-container', "Your Set '{$setTitle}' has been added. You can add fields to this set now.");
}
function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $contributionType) {
$memTypeId2 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/div[2]/table/tbody//tr/td[text()='{$memTypeTitle2}']/../td[12]/span/a[3]@href"));
$memTypeId2 = $memTypeId2[1];
- $this->open($this->sboxPath . "civicrm/admin/price/field?reset=1&action=add&sid={$sid}");
+ $this->openCiviPage('admin/price/field', "reset=1&action=add&sid={$sid}");
foreach ($fields as $label => $type) {
$validateStrings[] = $label;
$this->click('_qf_Field_next_new-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent('_qf_Field_next-bottom');
- $this->assertTrue($this->isTextPresent("Price Field '{$label}' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "Price Field '{$label}' has been saved.");
}
return array($memTypeTitle1, $memTypeTitle2);
}
function _testVerifyPriceSet($validateStrings, $sid) {
// verify Price Set at Preview page
// start at Manage Price Sets listing
- $this->open($this->sboxPath . 'civicrm/admin/price?reset=1');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/price', 'reset=1');
// Use the price set id ($sid) to pick the correct row
$this->click("css=tr#row_{$sid} a[title='Preview Price Set']");
}
function _testVerifyRegisterPage($contributionPageTitle) {
- $this->open($this->sboxPath . 'civicrm/admin/contribute?reset=1');
- $this->waitForElementPresent('_qf_SearchContribution_refresh');
+ $this->openCiviPage('admin/contribute', 'reset=1', '_qf_SearchContribution_refresh');
$this->type('title', $contributionPageTitle);
$this->click('_qf_SearchContribution_refresh');
$this->waitForPageToLoad('50000');
$id = $this->getAttribute("//div[@id='configure_contribution_page']//div[@class='dataTables_wrapper']/table/tbody/tr@id");
$id = explode('_', $id);
- $registerUrl = "civicrm/contribute/transact?reset=1&id=$id[1]";
+ $registerUrl = array('url' => 'contribute/transact', 'args' => "reset=1&id=$id[1]");
return $registerUrl;
}
function _testSignUpOrRenewMembership($registerUrl, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = FALSE) {
- $this->open($this->sboxPath . 'civicrm/logout?reset=1');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('logout', 'reset=1');
- $this->open($this->sboxPath . $registerUrl);
- $this->waitForElementPresent('_qf_Main_upload-bottom');
+ $this->openCiviPage($registerUrl['url'], $registerUrl['args'], '_qf_Main_upload-bottom');
//build the membership dates.
require_once 'CRM/Core/Config.php';
// Log in using webtestLogin() method
$this->webtestLogin();
- $this->open($this->sboxPath . "civicrm/member/search?reset=1");
- $this->waitForElementPresent("member_end_date_high");
+ $this->openCiviPage('member/search', 'reset=1', 'member_end_date_high');
$this->type("sort_name", "{$contactParams['first_name']} {$contactParams['last_name']}");
$this->click("_qf_Search_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("2 Results "));
+ $this->assertElementContainsText('crm-container', '2 Results');
$this->waitForElementPresent("xpath=//div[@id='memberSearch']/table/tbody/tr");
$this->click("xpath=//div[@id='memberSearch']/table/tbody//tr/td[4][text()='{$memTypeTitle1}']/../td[11]/span/a[text()='View']");
function _testMultilpeTermsMembershipRegistration($registerUrl, $contactParams, $memTypeTitle1, $term, $renew = FALSE){
if($renew){
- $this->open($this->sboxPath . "civicrm/member/search?reset=1");
- $this->waitForElementPresent("member_end_date_high");
+ $this->openCiviPage('member/search', 'reset=1', 'member_end_date_high');
$this->type("sort_name", "{$contactParams['first_name']} {$contactParams['last_name']}");
$this->click("_qf_Search_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
$prevYear = substr($year, 0, 4);
}
- $this->open($this->sboxPath . 'civicrm/logout?reset=1');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('logout', 'reset=1');
- $this->open($this->sboxPath . $registerUrl);
- $this->waitForElementPresent('_qf_Main_upload-bottom');
+ $this->openCiviPage($registerUrl['url'], $registerUrl['args'], '_qf_Main_upload-bottom');
//build the membership dates.
require_once 'CRM/Core/Config.php';
// Log in using webtestLogin() method
$this->webtestLogin();
- $this->open($this->sboxPath . "civicrm/member/search?reset=1");
- $this->waitForElementPresent("member_end_date_high");
+ $this->openCiviPage('member/search', 'reset=1', 'member_end_date_high');
$this->type("sort_name", "{$contactParams['first_name']} {$contactParams['last_name']}");
$this->click("_qf_Search_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("1 Result "));
+ $this->assertElementContainsText('crm-container', '1 Result ');
$this->waitForElementPresent("xpath=//div[@id='memberSearch']/table/tbody/tr");
$this->click("xpath=//div[@id='memberSearch']/table/tbody//tr/td[4][text()='{$memTypeTitle1}']/../td[11]/span/a[text()='View']");
$this->webtestLogin();
//enable the logging
- $this->open($this->sboxPath . "civicrm/admin/setting/misc?reset=1");
+ $this->openCiviPage('admin/setting/misc', 'reset=1');
$this->click("xpath=//tr[@class='crm-miscellaneous-form-block-logging']/td[2]/label[text()='Yes']");
$this->click("_qf_Miscellaneous_next-top");
$this->waitForTextPresent("Changes Saved");
$this->waitForPageToLoad($this->getTimeoutMsec());
//visit the logging contact summary report
- $this->open($this->sboxPath . "civicrm/report/logging/contact/summary?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('report/logging/contact/summary', 'reset=1');
$this->type('altered_contact_value', $firstName);
$this->click("_qf_LoggingSummary_submit");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->detailReportCheck($dataForReportDetail, $filters);
//delete contact check
- $this->open($this->sboxPath . "civicrm/contact/view/delete?&reset=1&delete=1&cid={$cid[1]}");
+ $this->openCiviPage('contact/view/delete', "reset=1&delete=1&cid={$cid[1]}");
$this->click("_qf_Delete_done");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/report/logging/contact/summary?reset=1");
+ $this->openCiviPage('report/logging/contact/summary', 'reset=1');
$this->click("_qf_LoggingSummary_submit");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->verifyReportData($contactDataDelete);
//disable the logging
- $this->open($this->sboxPath . "civicrm/admin/setting/misc?reset=1");
+ $this->openCiviPage('admin/setting/misc', 'reset=1');
$this->click("xpath=//tr[@class='crm-miscellaneous-form-block-logging']/td[2]/label[text()='No']");
$this->click("_qf_Miscellaneous_next-top");
$this->waitForTextPresent("Changes Saved");
}
//visit the logging contact summary report
- $this->open($this->sboxPath . "civicrm/report/logging/contact/summary?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('report/logging/contact/summary', 'reset=1');
foreach ($filters as $type => $filter) {
if ($type == 'text' ) {
foreach ($filter as $filterName => $filterValue) {
$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');
$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');
//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');
$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');
$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');
$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');
$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');
$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');
$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');
$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');
$this->open($this->sboxPath);
$this->webtestLogin(TRUE);
$this->open($this->sboxPath . "admin/people/permissions/roles");