$this->webtestLogin();
// Go directly to the URL of the screen that will create new group.
- $this->open($this->sboxPath . "civicrm/group/add?reset=1");
+ $this->openCiviPage("group/add", "reset=1");
$groupTitle = "testGroup" . substr(sha1(rand()), 0, 4);
$this->type("title", $groupTitle);
$this->click("group_type[1]");
$this->click("_qf_Edit_upload-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("The Group '{$groupTitle}' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "The Group '{$groupTitle}' has been saved.");
// Go directly to the URL that will create a new ACL role
- $this->open($this->sboxPath . "civicrm/admin/options/acl_role?group=acl_role&action=add&reset=1");
-
- $this->waitForElementPresent("_qf_Options_cancel-bottom");
+ $this->openCiviPage("admin/options/acl_role", "group=acl_role&action=add&reset=1", "_qf_Options_cancel-bottom");
$label = "TestAclRole" . substr(sha1(rand()), 0, 4);
$this->type("label", $label);
$this->click("_qf_Options_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("The Acl Role '{$label}' has been saved "));
+ $this->assertElementContainsText('crm-notification-container', "The Acl Role '{$label}' has been saved");
// Go directly to the URL of the screen that will assign users to role.
- $this->open($this->sboxPath . "civicrm/acl/entityrole?action=add&reset=1");
+ $this->openCiviPage("acl/entityrole", "action=add&reset=1");
$this->select("acl_role_id", "label=" . $label);
$this->select("entity_id", "label={$groupTitle}");
// Go directly to the URL of the screen that will manage ACLs
- $this->open($this->sboxPath . "civicrm/acl?action=add&reset=1");
+ $this->openCiviPage("acl", "action=add&reset=1");
$this->click("group_id");
$this->select("group_id", "label={$groupTitle}");
$this->select("operation", "label=View");
// 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__);
// Since we're here, let's check if screen help is being displayed properly
- $this->assertTrue($this->isTextPresent("You can optionally assign this activity to someone"), "Help text is missing.");
+ $this->assertElementContainsText('css=tr.crm-activity-form-block-assignee_contact_id td span.description', 'You can optionally assign this activity to someone', 'Help text is missing.');
// 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.";
// For simple input fields we can use field id as selector
$this->waitForPageToLoad($this->getTimeoutMsec());
// Is status message correct?
- $this->assertTrue($this->isTextPresent("Activity '$subject' has been saved."), "Status message didn't show up after saving!");
+ $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[2]/td[9]/span/a[text()='View']");
$this->open($this->sboxPath);
$this->webtestLogin();
- $this->open($this->sboxPath . "civicrm/admin/setting/preferences/display?reset=1");
- $this->waitForElementPresent("name=activity_assignee_notification_ics");
+ $this->openCivipage("admin/setting/preferences/display", "reset=1", "name=activity_assignee_notification_ics");
// Notify assignees should be checked by default, so we just need to click the ical setting which is off by default.
- $this->click("name=activity_assignee_notification_ics");
+ $this->check("name=activity_assignee_notification_ics");
$this->click("_qf_Display_next");
$this->waitForPageToLoad($this->getTimeoutMsec());
$firstName1 = substr(sha1(rand()), 0, 7);
$this->webtestAddContact("$firstName1", "Anderson", $firstName1 . "@anderson.com");
- $this->open($this->sboxPath . "civicrm/activity?reset=1&action=add&context=standalone");
- $this->waitForElementPresent("_qf_Activity_upload");
+ $this->openCivipage("activity", "reset=1&action=add&context=standalone", "_qf_Activity_upload");
$this->select("activity_type_id", "value=1");
$this->click("_qf_Activity_upload");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("Activity '$subject' has been saved."), "Status message didn't show up after saving!");
+ $this->assertElementContainsText('crm-notification-container', "Activity '$subject' has been saved.", "Status message didn't show up after saving!");
// check the resulting email
$mail = $mailer->getMostRecentEmail( 'ezc' );
$this->webtestAddContact("$firstName2", "Summerson", $firstName2 . "@summerson.com");
// Go directly to the URL of the screen that you will be testing (New Activity-standalone).
- $this->open($this->sboxPath . "civicrm/activity?reset=1&action=add&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_Activity_upload");
+ $this->openCiviPage("activity", "reset=1&action=add&context=standalone", "_qf_Activity_upload");
// Let's start filling the form with values.
$this->waitForElementPresent("css=tr.crm-activity-form-block-target_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("Anderson, $firstName1"), "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, $firstName1", 'Contact not found in line ' . __LINE__);
// Now we're doing the same for "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, $firstName2"), "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, $firstName2", 'Contact not found in line ' . __LINE__);
// Since we're here, let's check of screen help is being displayed properly
- $this->assertTrue($this->isTextPresent("You can optionally assign this activity to someone"), "Help text is missing.");
+ $this->assertElementContainsText('css=tr.crm-activity-form-block-assignee_contact_id td span.description', 'You can optionally assign this activity to someone', 'Help text is missing.');
// 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 standalone screen.";
// Is status message correct?
$this->assertTrue($this->isTextPresent("Activity '$subject' has been saved."), "Status message didn't show up after saving!");
- $this->open($this->sboxPath . "civicrm/activity/search?reset=1");
- $this->waitForElementPresent("_qf_Search_refresh");
+ $this->openCiviPage("activity/search", "reset=1", "_qf_Search_refresh");
$this->type("sort_name", $firstName1);
$this->click("_qf_Search_refresh");
$this->webtestLogin();
// Go directly to the URL of the screen that you will be testing (Custom data for contacts).
- $this->open($this->sboxPath . "civicrm/admin/custom/group?action=add&reset=1");
- // 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->openCiviPage("admin/custom/group", "action=add&reset=1");
//fill custom group title
$customGroupTitle = 'custom_group' . substr(sha1(rand()), 0, 3);
$this->waitForPageToLoad($this->getTimeoutMsec());
//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.");
//add custom field - alphanumeric text
$textFieldLabel = 'test_text_field' . substr(sha1(rand()), 0, 3);
$this->click("header");
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created?
- $this->assertTrue($this->isTextPresent("Your custom field '$checkboxFieldLabel' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "Your custom field '$checkboxFieldLabel' has been saved.");
//create another custom field - Number 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.");
//On New Individual contact form
- $this->open($this->sboxPath . "civicrm/contact/add?ct=Individual&reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("New Individual"));
+ $this->openCiviPage("contact/add", "ct=Individual&reset=1");
+ $this->assertElementContainsText('page-title', "New Individual");
//expand all tabs
$this->click("expand");
$this->waitForElementPresent("address_1_street_address");
//verify custom group fields are present on new Individual Contact Form
- $this->assertTrue($this->isTextPresent($textFieldLabel));
- $this->assertTrue($this->isTextPresent($checkboxFieldLabel));
- $this->assertTrue($this->isTextPresent($checkboxOptionLabel1));
- $this->assertTrue($this->isTextPresent($checkboxOptionLabel2));
- $this->assertTrue($this->isTextPresent($checkboxOptionLabel3));
- $this->assertTrue($this->isTextPresent($checkboxOptionLabel4));
- $this->assertTrue($this->isTextPresent($radioFieldLabel));
- $this->assertTrue($this->isTextPresent($radioOptionLabel1));
- $this->assertTrue($this->isTextPresent($radioOptionLabel2));
+ $this->assertElementContainsText('customData', $textFieldLabel);
+ $this->assertElementContainsText('customData', $checkboxFieldLabel);
+ $this->assertElementContainsText('customData', $checkboxOptionLabel1);
+ $this->assertElementContainsText('customData', $checkboxOptionLabel2);
+ $this->assertElementContainsText('customData', $checkboxOptionLabel3);
+ $this->assertElementContainsText('customData', $checkboxOptionLabel4);
+ $this->assertElementContainsText('customData', $radioFieldLabel);
+ $this->assertElementContainsText('customData', $radioOptionLabel1);
+ $this->assertElementContainsText('customData', $radioOptionLabel2);
//On New Household contact form
- $this->open($this->sboxPath . "civicrm/contact/add?ct=Household&reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("New Household"));
+ $this->openCiviPage("contact/add", "ct=Household&reset=1");
+ $this->assertElementContainsText('page-title', "New Household");
//expand all tabs
$this->click("expand");
$this->waitForElementPresent("address_1_street_address");
//verify custom group fields are present on new household Contact Form
- $this->assertTrue($this->isTextPresent($textFieldLabel));
- $this->assertTrue($this->isTextPresent($checkboxFieldLabel));
- $this->assertTrue($this->isTextPresent($checkboxOptionLabel1));
- $this->assertTrue($this->isTextPresent($checkboxOptionLabel2));
- $this->assertTrue($this->isTextPresent($checkboxOptionLabel3));
- $this->assertTrue($this->isTextPresent($checkboxOptionLabel4));
- $this->assertTrue($this->isTextPresent($radioFieldLabel));
- $this->assertTrue($this->isTextPresent($radioOptionLabel1));
- $this->assertTrue($this->isTextPresent($radioOptionLabel2));
+ $this->assertElementContainsText('customData', $textFieldLabel);
+ $this->assertElementContainsText('customData', $checkboxFieldLabel);
+ $this->assertElementContainsText('customData', $checkboxOptionLabel1);
+ $this->assertElementContainsText('customData', $checkboxOptionLabel2);
+ $this->assertElementContainsText('customData', $checkboxOptionLabel3);
+ $this->assertElementContainsText('customData', $checkboxOptionLabel4);
+ $this->assertElementContainsText('customData', $radioFieldLabel);
+ $this->assertElementContainsText('customData', $radioOptionLabel1);
+ $this->assertElementContainsText('customData', $radioOptionLabel2);
//On New Organization contact form
- $this->open($this->sboxPath . "civicrm/contact/add?ct=Organization&reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("New Organization"));
+ $this->openCiviPage("contact/add", "ct=Organization&reset=1");
+ $this->assertElementContainsText('page-title', "New Organization");
//expand all tabs
$this->click("expand");
$this->waitForElementPresent("address_1_street_address");
//verify custom group fields are present on new Organization Contact Form
- $this->assertTrue($this->isTextPresent($textFieldLabel));
- $this->assertTrue($this->isTextPresent($checkboxFieldLabel));
- $this->assertTrue($this->isTextPresent($checkboxOptionLabel1));
- $this->assertTrue($this->isTextPresent($checkboxOptionLabel2));
- $this->assertTrue($this->isTextPresent($checkboxOptionLabel3));
- $this->assertTrue($this->isTextPresent($checkboxOptionLabel4));
- $this->assertTrue($this->isTextPresent($radioFieldLabel));
- $this->assertTrue($this->isTextPresent($radioOptionLabel1));
- $this->assertTrue($this->isTextPresent($radioOptionLabel2));
+ $this->assertElementContainsText('customData', $textFieldLabel);
+ $this->assertElementContainsText('customData', $checkboxFieldLabel);
+ $this->assertElementContainsText('customData', $checkboxOptionLabel1);
+ $this->assertElementContainsText('customData', $checkboxOptionLabel2);
+ $this->assertElementContainsText('customData', $checkboxOptionLabel3);
+ $this->assertElementContainsText('customData', $checkboxOptionLabel4);
+ $this->assertElementContainsText('customData', $radioFieldLabel);
+ $this->assertElementContainsText('customData', $radioOptionLabel1);
+ $this->assertElementContainsText('customData', $radioOptionLabel2);
}
}