$this->webtestLogin();
// Enable CiviCase module if necessary
- $this->open($this->sboxPath . "civicrm/admin/setting/component?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent('_qf_Component_next-bottom');
+ $this->openCiviPage('admin/setting/component', 'reset=1', '_qf_Component_next-bottom');
$enabledComponents = $this->getSelectOptions('enableComponents-t');
if (!in_array('CiviCase', $enabledComponents)) {
$this->addSelection('enableComponents-f', "label=CiviCase");
$this->changePermissions($permission);
// Go directly to the URL of the screen that you will be testing (New Case-standalone).
- $this->open($this->sboxPath . "civicrm/case/add?reset=1&action=add&atype=13&context=standalone");
-
- // As mentioned before, waitForPageToLoad is not always reliable. Below, we're waiting for the submit
- // button at the end of this page to show up, to make sure it's fully loaded.
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent('_qf_Case_upload-bottom');
+ $this->openCiviPage('case/add', 'reset=1&action=add&atype=13&context=standalone', '_qf_Case_upload-bottom');
// Adding contact with randomized first name (so we can then select that contact when creating case)
// We're using pop-up New Contact dialog
$this->waitForElementPresent('_qf_CaseView_cancel-bottom');
// Is status message correct?
- $this->assertTextPresent("Case opened successfully.", "Save successful status message didn't show up after saving!");
+ $this->assertElementContainsText('crm-notification-container', "Case opened successfully.", "Save successful status message didn't show up after saving!");
$customGroupTitle = 'Custom_' . substr(sha1(rand()), 0, 7);
$this->_testAddNewActivity($firstName, $subject, $customGroupTitle, $contactName);
// Let's start filling the form with values.
// ...and verifying if the page contains properly formatted display name for chosen contact.
- $this->assertTrue($this->isTextPresent("Anderson, " . $firstName2), "Contact not found in line " . __LINE__);
+ $this->assertElementContainsText('css=tr.crm-activity-form-block-target_contact_id td ul li.token-input-token-facebook', 'Anderson, ' . $firstName2, "Contact not found in line " . __LINE__);
// Now we're filling the "Assigned To" field.
// Typing contact's name into the field (using typeKeys(), not type()!)...
$this->waitForElementPresent("css=tr.crm-activity-form-block-assignee_contact_id td ul li span.token-input-delete-token-facebook");
// ...and verifying if the page contains properly formatted display name for chosen contact.
- $this->assertTrue($this->isTextPresent("Summerson, " . $firstName1), "Contact not found in line " . __LINE__);
+ $this->assertElementContainsText('css=tr.crm-activity-form-block-assignee_contact_id td ul li.token-input-token-facebook', 'Summerson, ' . $firstName1, "Contact not found in line " . __LINE__);
// Putting the contents into subject field - assigning the text to variable, it'll come in handy later
$subject = "This is subject of test activity being added through activity tab of contact summary screen.";
$this->waitForPageToLoad($this->getTimeoutMsec());
// Is status message correct?
- $this->assertTrue($this->isTextPresent("Activity '$subject' has been saved."),
+ $this->assertElementContainsText('crm-notification-container', "Activity '$subject' has been saved.",
"Status message didn't show up after saving!"
);
$this->waitForElementPresent("xpath=//div[@id='Activities']//table/tbody/tr[1]/td[9]/span/a[text()='View']");
// verify if custom data is present
- $this->open($this->sboxPath . "civicrm/case?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('case', 'reset=1');
$this->click("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[9]/span/a[text()='Manage']");
$this->waitForElementPresent('_qf_CaseView_cancel-bottom');
$this->waitForElementPresent('view-activity');
$this->waitForElementPresent("css=table#crm-activity-view-table tr.crm-case-activityview-form-block-groupTitle");
-
- $this->isTextPresent($customDataParams[0]);
- $this->isTextPresent($textField);
+ $this->assertElementContainsText('crm-activity-view-table', "$customDataParams[0]");
+ $this->assertElementContainsText('crm-activity-view-table', "$textField");
$this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Done']");
$this->waitForElementPresent("xpath=//div[@id='activities']//table[@id='activities-selector']/tbody/tr[1]/td[2]");
$this->select('activity_change_status', 'value=2');
$this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Ok']");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/case?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('case', 'reset=1');
$this->click("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[9]/span/a[text()='Manage']");
$this->waitForElementPresent('_qf_CaseView_cancel-bottom');
$this->waitForElementPresent("xpath=//div[@id='activities']//table[@id='activities-selector']/tbody/tr[1]/td[2]");
function _addCustomData($customGroupTitle) {
// Go directly to the URL of the screen that you will be testing (New Custom Group).
- $this->open($this->sboxPath . "civicrm/admin/custom/group?reset=1");
+ $this->openCiviPage('admin/custom/group', 'reset=1');
//add new custom data
$this->click("//a[@id='newCustomDataGroup']/span");
$this->waitForElementPresent('_qf_Field_cancel-bottom');
//Is custom group created?
- $this->assertTrue($this->isTextPresent("Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."));
+ $this->assertElementContainsText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
// create a custom field - Integer Radio
$this->click("data_type[0]");
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created
- $this->assertTrue($this->isTextPresent("Your custom field '$radioFieldLabel' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "Your custom field '$radioFieldLabel' has been saved.");
// create another custom field - text field
$this->click("//a[@id='newCustomField']/span");
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created
- $this->assertTrue($this->isTextPresent("Your custom field '$textFieldLabel' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "Your custom field '$textFieldLabel' has been saved.");
$textFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$textFieldLabel']/../../td[8]/span/a[text()='Edit Field']/@href"));
$textFieldId = $textFieldId[1];
$this->webtestLogin();
// Enable CiviCase module if necessary
- $this->open($this->sboxPath . "civicrm/admin/setting/component?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("_qf_Component_next-bottom");
+ $this->openCiviPage('admin/setting/component', 'reset=1', '_qf_Component_next-bottom');
$enabledComponents = $this->getSelectOptions("enableComponents-t");
if (!in_array("CiviCase", $enabledComponents)) {
$this->addSelection("enableComponents-f", "label=CiviCase");
$this->changePermissions($permission);
// Go to reserved New Individual Profile to set value for logged in user's contact name (we'll need that later)
- $this->open($this->sboxPath . "civicrm/profile/edit?reset=1&gid=4");
+ $this->openCiviPage('profile/edit', 'reset=1&gid=4');
$testUserFirstName = "Testuserfirst";
$testUserLastName = "Testuserlast";
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->click("_qf_Edit_next");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent("profilewrap4");
-
// Is status message correct?
- $this->assertTextPresent("Thank you. Your information has been saved.", "Save successful status message didn't show up after saving profile to update testUserName!");
+ $this->assertElementContainsText('crm-container', "Thank you. Your information has been saved.", "Save successful status message didn't show up after saving profile to update testUserName!");
// Go directly to the URL of the screen that you will be testing (New Case-standalone).
- $this->open($this->sboxPath . "civicrm/case/add?reset=1&action=add&atype=13&context=standalone");
-
- // As mentioned before, waitForPageToLoad is not always reliable. Below, we're waiting for the submit
- // button at the end of this page to show up, to make sure it's fully loaded.
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("_qf_Case_upload-bottom");
+ $this->openCiviPage('case/add', 'reset=1&action=add&atype=13&context=standalone', '_qf_Case_upload-bottom');
// Try submitting the form without creating or selecting a contact (test for CRM-7971)
$this->click("_qf_Case_upload-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent("css=span.crm-error");
- $this->assertTextPresent("Please select a contact or create new contact", "Expected form rule error for submit without selecting contact did not show up after clicking Save.");
+ $this->assertElementContainsText('Case', "Please select a contact or create new contact", "Expected form rule error for submit without selecting contact did not show up after clicking Save.");
// Adding contact with randomized first name (so we can then select that contact when creating case)
// We're using pop-up New Contact dialog
$this->waitForElementPresent("_qf_CaseView_cancel-bottom");
// Is status message correct?
- $this->assertTextPresent("Case opened successfully.", "Save successful status message didn't show up after saving!");
+ $this->assertElementContainsText('crm-notification-container', "Case opened successfully.", "Save successful status message didn't show up after saving!");
$summaryStrings = array(
"Case Summary",
function _testSearchbyDate($firstName, $lastName, $action) {
// Find Cases
if ($action != "0") {
- $this->open($this->sboxPath . "civicrm/case/search?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('case/search', 'reset=1');
$this->select("case_from_relative", "value=$action");
$this->select("case_to_relative", "value=$action");
$this->click("_qf_Search_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("$lastName, $firstName"));
+ $this->assertElementContainsText('Search', "$lastName, $firstName");
}
else {
//select date range
- $this->open($this->sboxPath . "civicrm/case/search?reset=1");
- $this->waitForElementPresent("_qf_Search_refresh-bottom");
+ $this->openCiviPage('case/search', 'reset=1', '_qf_Search_refresh-bottom');
$this->select("case_from_relative", "value=$action");
$this->webtestFillDate("case_from_start_date_low", "-1 month");
$this->webtestFillDate("case_from_start_date_high", "+1 month");
$this->webtestFillDate("case_to_end_date_high", "+1 month");
$this->click("_qf_Search_refresh-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("$lastName, $firstName"));
+ $this->assertElementContainsText('Search', "$lastName, $firstName");
}
//Advanced Search
- $this->open($this->sboxPath . "civicrm/contact/search/advanced?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("_qf_Advanced_refresh");
+ $this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh');
$this->click("CiviCase");
$this->waitForElementPresent("xpath=//div[@id='case-search']/table/tbody/tr[3]/td[2]/input[3]");
if ($action != "0") {
}
$this->click("_qf_Advanced_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("$lastName, $firstName"));
+ $this->assertElementContainsText('Advanced', "$lastName, $firstName");
}
}
$customGrp1 = "CaseCustom_Data1_" . substr(sha1(rand()), 0, 7);
// create custom group1
- $this->open($this->sboxPath . "civicrm/admin/custom/group?reset=1");
+ $this->openCiviPage('admin/custom/group', 'reset=1');
$this->click("newCustomDataGroup");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->type("title", $customGrp1);
$this->changePermissions($permission);
// Go to reserved New Individual Profile to set value for logged in user's contact name (we'll need that later)
- $this->open($this->sboxPath . "civicrm/profile/edit?reset=1&gid=4");
+ $this->openCiviPage('profile/edit', 'reset=1&gid=4', '_qf_Edit_next');
$testUserFirstName = "Testuserfirst";
$testUserLastName = "Testuserlast";
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("_qf_Edit_next");
$this->type("first_name", $testUserFirstName);
$this->type("last_name", $testUserLastName);
$this->click("_qf_Edit_next");
$this->assertTextPresent("Thank you. Your information has been saved.", "Save successful status message didn't show up after saving profile to update testUserName!");
// Go directly to the URL of the screen that you will be testing (New Case-standalone).
- $this->open($this->sboxPath . "civicrm/case/add?reset=1&action=add&atype=13&context=standalone");
-
- // As mentioned before, waitForPageToLoad is not always reliable. Below, we're waiting for the submit
- // button at the end of this page to show up, to make sure it's fully loaded.
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("_qf_Case_upload-bottom");
+ $this->openCiviPage('case/add', 'reset=1&action=add&atype=13&context=standalone', '_qf_Case_upload-bottom');
// Try submitting the form without creating or selecting a contact (test for CRM-7971)
$this->click("_qf_Case_upload-bottom");
$this->assertTextPresent("Case opened successfully.", "Save successful status message didn't show up after saving!");
$this->click("_qf_CaseView_cancel-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/case?reset=1");
-
- $this->waitForElementPresent("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[8]/a[text()='Open Case']");
+ $this->openCiviPage('case', 'reset=1', "xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[8]/a[text()='Open Case']");
$this->click("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[8]/a[text()='Open Case']");
$this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Done']");
sleep(3);
$this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Done']");
// verify if custom data is present
- $this->open($this->sboxPath . "civicrm/case?reset=1");
+ $this->openCiviPage('case', 'reset=1');
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->click("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[9]/span/a[text()='Manage']");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->click("xpath=//div[@id='{$customGrp1}']/div[2]");
sleep(2);
- $this->waitForElementPresent("xpath=//div[@id='{$customGrp1}']/div[2]/a/span[text()='Edit']");
- $this->click("xpath=//div[@id='{$customGrp1}']/div[2]/a/span[text()='Edit']");
+ $this->waitForElementPresent("xpath=//div[@id='{$customGrp1}']/div[2]/div/a/span[text()='Edit']");
+ $this->click("xpath=//div[@id='{$customGrp1}']/div[2]/div/a/span[text()='Edit']");
sleep(3);
$custFname = "Miky" . substr(sha1(rand()), 0, 7);
$custMname = "Davy" . substr(sha1(rand()), 0, 7);
$this->type("{$cusId_3}", $custLname);
$this->click("_qf_CustomData_upload");
sleep(2);
- $this->open($this->sboxPath . "civicrm/case?reset=1");
+ $this->openCiviPage('case', 'reset=1');
$this->click("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[8]/a[text()='Change Custom Data']");
sleep(3);
$openCaseChangeData = array(
$field3 = "Lname" . substr(sha1(rand()), 0, 7);
// add custom fields for group 1
- $this->open($this->sboxPath . "civicrm/admin/custom/group/field/add?reset=1&action=add&gid=" . $customGrpId1);
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/custom/group/field/add', "reset=1&action=add&gid={$customGrpId1}");
$this->type("label", $field1);
$this->check("is_searchable");
$this->click("_qf_Field_next_new-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
// get id of custom fields
- $this->open($this->sboxPath . "civicrm/admin/custom/group/field?reset=1&action=browse&gid=" . $customGrpId1);
+ $this->openCiviPage('admin/custom/group/field', "reset=1&action=browse&gid={$customGrpId1}");
$custom1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr[1]/td[8]/span/a[text()='Edit Field']/@href"));
$custom1 = $custom1[1];
array_push($customId, $custom1);
function _testDeleteCustomData($customGrpId1, $customId) {
// delete all custom data
- $this->open($this->sboxPath . "civicrm/admin/custom/group/field?action=delete&reset=1&gid=" . $customGrpId1 . "&id=" . $customId[0]);
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/custom/group/field', "action=delete&reset=1&gid={$customGrpId1}&id={$customId[0]}");
$this->click("_qf_DeleteField_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/admin/custom/group/field?action=delete&reset=1&gid=" . $customGrpId1 . "&id=" . $customId[1]);
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/custom/group/field', "action=delete&reset=1&gid={$customGrpId1}&id={$customId[1]}");
$this->click("_qf_DeleteField_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/admin/custom/group/field?action=delete&reset=1&gid=" . $customGrpId1 . "&id=" . $customId[2]);
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/custom/group/field', "action=delete&reset=1&gid={$customGrpId1}&id={$customId[2]}");
$this->click("_qf_DeleteField_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/admin/custom/group?action=delete&reset=1&id=" . $customGrpId1);
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/custom/group', "action=delete&reset=1&id={$customGrpId1}");
$this->click("_qf_DeleteGroup_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
}
function _testAdvansearchCaseData($customId, $custFname, $custMname, $custLname) {
- $this->open($this->sboxPath . "civicrm/contact/search/advanced?reset=1");
-
// search casecontact
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("_qf_Advanced_refresh");
+ $this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh');
$this->click("CiviCase");
sleep(2);
$cusId_1 = 'custom_' . $customId[0];
$this->type("{$cusId_3}", $custLname);
$this->click("_qf_Advanced_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent('1 Contact'));
+ $this->assertElementContainsText('crm-container', '1 Contact');
}
}
$this->webtestLogin();
// Enable CiviCase module if necessary
- $this->open($this->sboxPath . "civicrm/admin/setting/component?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("_qf_Component_next-bottom");
+ $this->openCiviPage('admin/setting/component', 'reset=1', '_qf_Component_next-bottom');
$enabledComponents = $this->getSelectOptions("enableComponents-t");
if (!in_array("CiviCase", $enabledComponents)) {
$this->addSelection("enableComponents-f", "label=CiviCase");
$this->changePermissions($permission);
// Go directly to the URL of the screen that you will be testing (Dashboard).
- $this->open($this->sboxPath . "civicrm/case?reset=1");
-
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("css=a.button");
+ $this->openCiviPage('case', 'reset=1', 'css=a.button');
// Should default to My Cases
$this->assertTrue($this->isChecked("name=allupcoming value=0"), 'Case dashboard should default to My Cases.');
// The header text of the table changes too
- $this->assertTextPresent("Summary of Case Involvement");
+ $this->assertElementContainsText('crm-container', "Summary of Case Involvement");
$this->click("name=allupcoming value=1");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent("css=a.button");
$this->assertTrue($this->isChecked("name=allupcoming value=1"), 'Selection of All Cases failed.');
- $this->assertTextPresent("Summary of All Cases");
+ $this->assertElementContainsText('crm-container', "Summary of All Cases");
// Go back to dashboard
- $this->open($this->sboxPath . "civicrm/case?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("css=a.button");
+ $this->openCiviPage('case', 'reset=1', 'css=a.button');
// Click on find my cases and check if right radio is checked
$this->click("name=find_my_cases");
$this->assertTrue($this->isChecked("name=case_owner value=2"), 'Find my cases button not properly setting search form value to my cases.');
// Go back to dashboard
- $this->open($this->sboxPath . "civicrm/case?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("css=a.button");
+ $this->openCivipage('case', 'reset=1', 'css=a.button');
// Click on a drilldown cell and check if right radio is checked
$this->click("css=a.crm-case-summary-drilldown");
$this->assertTrue($this->isChecked("name=case_owner value=1"), 'Drilldown on dashboard summary cells not properly setting search form value to all cases.');
// Go back to dashboard and reset to my cases
- $this->open($this->sboxPath . "civicrm/case?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("css=a.button");
+ $this->openCiviPage('case', 'reset=1', 'css=a.button');
$this->click("name=allupcoming value=0");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent("css=a.button");
$this->waitForElementPresent('_qf_Pledge_upload-bottom');
// check contact name on pledge form
- $this->assertTrue($this->isTextPresent("$firstName $lastName"));
+ $this->assertElementContainsText('css=tr.crm-pledge-form-block-displayName', "$firstName $lastName");
// Let's start filling the form with values.
$this->type("amount", "100");
$this->click("_qf_Pledge_upload-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("Pledge has been recorded and the payment schedule has been created."));
+ $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span[1]/a[text()='View']");
//click through to the Pledge view screen
// somewhere at the end of page and use waitForElementPresent on it - this assures you, that whole
// page contents loaded and you can continue your test execution.
$this->webtestLogin();
- $this->open($this->sboxPath . 'civicrm/admin/setting/localization?reset=1');
+ $this->openCiviPage('admin/setting/localization', 'reset=1');
$this->select("currencyLimit-f","value=FJD");
$this->click("add");
$this->click("_qf_Localization_next-bottom");
$this->waitForElementPresent('_qf_Pledge_upload-bottom');
// check contact name on pledge form
- $this->assertTrue($this->isTextPresent("$firstName $lastName"));
+ $this->assertElementContainsText('css=tr.crm-pledge-form-block-displayName', "$firstName $lastName");
// Let's start filling the form with values.
$this->select("currency","value=FJD");
$this->click("_qf_Pledge_upload-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("Pledge has been recorded and the payment schedule has been created."));
+ $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
//click through to the Pledge view screen
'Send additional reminders' => '4 days after the last one sent',
)
);
- $this->open($this->sboxPath . 'civicrm/admin/setting/localization?reset=1');
- $this->select("currencyLimit-t","value=FJD");
- $this->click("remove");
- $this->click("_qf_Localization_next-bottom");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/setting/localization', 'reset=1');
+ $this->select("currencyLimit-t","value=FJD");
+ $this->click("remove");
+ $this->click("_qf_Localization_next-bottom");
+ $this->waitForPageToLoad($this->getTimeoutMsec());
}
function testAddPledgePaymentWithAdjustTotalPledgeAmount() {
$this->waitForElementPresent('_qf_Pledge_upload-bottom');
// check contact name on pledge form
- $this->assertTrue($this->isTextPresent("$firstName $lastName"));
+ $this->assertElementContainsText('css=tr.crm-pledge-form-block-displayName', "$firstName $lastName");
// Let's start filling the form with values.
$this->type("amount", "30");
$this->click("_qf_Pledge_upload-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("Pledge has been recorded and the payment schedule has been created."));
+ $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
//click through to the Pledge view screen
$this->waitForElementPresent('_qf_Pledge_upload-bottom');
// check contact name on pledge form
- $this->assertTrue($this->isTextPresent("$firstName $lastName"));
+ $this->assertElementContainsText('css=tr.crm-pledge-form-block-displayName', "$firstName $lastName");
// Let's start filling the form with values.
$this->type("amount", "30");
$this->click("_qf_Pledge_upload-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("Pledge has been recorded and the payment schedule has been created."));
+ $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
//Add payments
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
$this->webtestLogin();
// Go directly to the URL of the screen that you will be testing (New Pledge-standalone).
- $this->open($this->sboxPath . 'civicrm/pledge/add?reset=1&context=standalone');
-
- // As mentioned before, waitForPageToLoad is not always reliable. Below, we're waiting for the submit
- // button at the end of this page to show up, to make sure it's fully loaded.
- $this->waitForElementPresent('_qf_Pledge_upload');
+ $this->openCiviPage('pledge/add', 'reset=1&context=standalone', '_qf_Pledge_upload');
// create new contact using dialog
$firstName = 'Ma' . substr(sha1(rand()), 0, 4);
$this->click('_qf_Pledge_upload-bottom');
$this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent('Pledge has been recorded and the payment schedule has been created.'));
+ $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
// verify if Pledge is created
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
$this->click("xpath=//form[@id='Contribution']//div[2]/table/tbody/tr[3]/td[2]/a");
$this->type('total_amount', '300.00');
$this->click('_qf_Contribution_upload-bottom');
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("The contribution record has been saved."));
+ $this->waitForPageToLoad("30000");
+ $this->assertElementContainsText('crm-notification-container', "The contribution record has been saved.");
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
$this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
$this->click("xpath=//form[@id='Contribution']//div[2]/table/tbody/tr[3]/td[2]/a");
$this->type('total_amount', '250.00');
$this->click('_qf_Contribution_upload-bottom');
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("The contribution record has been saved."));
+ $this->waitForPageToLoad("30000");
+ $this->assertElementContainsText('crm-notification-container', "The contribution record has been saved.");
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
$this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
$this->click("xpath=//form[@id='Contribution']//div[2]/table/tbody/tr[3]/td[2]/a");
$this->type('total_amount', '170.00');
$this->click('_qf_Contribution_upload-bottom');
- $this->waitForPageToLoad("30000");
- $this->assertTrue($this->isTextPresent("The contribution record has been saved."));
+ $this->waitForPageToLoad("30000");
+ $this->assertElementContainsText('crm-notification-container', "The contribution record has been saved.");
// delete the contribution associated with the 2nd payment
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
$this->webtestLogin();
// Go directly to the URL of the screen that you will be testing (New Pledge-standalone).
- $this->open($this->sboxPath . 'civicrm/pledge/add?reset=1&context=standalone');
-
- // As mentioned before, waitForPageToLoad is not always reliable. Below, we're waiting for the submit
- // button at the end of this page to show up, to make sure it's fully loaded.
- $this->waitForElementPresent('_qf_Pledge_upload');
+ $this->openCiviPage('pledge/add', 'reset=1&context=standalone', '_qf_Pledge_upload');
// create new contact using dialog
$firstName = 'Ma' . substr(sha1(rand()), 0, 4);
$this->click('_qf_Pledge_upload-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent('Pledge has been recorded and the payment schedule has been created.'));
+ $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created.");
// verify if Pledge is created
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");