// Log in using webtestLogin() method
$this->webtestLogin();
-
+
// Add new individual using Quick Add block on the main page
$firstName1 = "John_" . substr(sha1(rand()), 0, 7);
$lastName1 = "Smiths_x" . substr(sha1(rand()), 0, 7);
$Name1 = $lastName1 . ', ' . $firstName1;
$this->webtestAddContact($firstName1, $lastName1, "$firstName1.$lastName1@example.com");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
// Add new individual using Quick Add block on the main page
$firstName2 = "James_" . substr(sha1(rand()), 0, 7);
$lastName2 = "Smiths_x" . substr(sha1(rand()), 0, 7);
$Name2 = $lastName2 . ', ' . $firstName2;
-
+
$firstName3 = "James_" . substr(sha1(rand()), 0, 7);
$lastName3 = "Smiths_x" . substr(sha1(rand()), 0, 7);
$Name3 = $lastName3 . ', ' . $firstName3;
'label' => 'Last Name'
));
$this->addProfile($profileTitle, $profileFields);
-
- $this->open($this->sboxPath . "civicrm/contact/search?reset=1");
- $this->waitForElementPresent('_qf_Basic_refresh');
+ $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh');
$this->type('sort_name', "Smiths_x");
$this->click('_qf_Basic_refresh');
$this->waitForElementPresent('_qf_Basic_next_print');
$this->isElementPresent("xpath=//form[@id='Batch']/div[2]/table/tbody//tr/td[text()='{$Name2}']");
$this->isElementPresent("xpath=//form[@id='Batch']/div[2]/table/tbody//tr/td[text()='{$Name1}']");
$this->isElementPresent("xpath=//form[@id='Batch']/div[2]/table/tbody//tr/td[text()='{$Name3}']");
- // selecting first check of profile
+ // selecting first check of profile
$this->click("xpath=//form[@id='Batch']/div[2]/table/tbody/tr/td[2]/input");
-
+
$this->waitForElementPresent('_qf_Batch_next');
$this->click("xpath=//table[@class='crm-copy-fields']/thead/tr/td[2]/img");
sleep(5);
$this->waitForElementPresent('_qf_Result_done');
$this->click('_qf_Result_done');
- // Find contact and assert for contact sub type
- $this->open($this->sboxPath . "civicrm/contact/search?reset=1");
- $this->waitForElementPresent('_qf_Basic_refresh');
-
+ // Find contact and assert for contact sub type
+ $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh');
$this->type('sort_name', $firstName2);
$this->click('_qf_Basic_refresh');
$this->waitForElementPresent("xpath=//div[@class='crm-search-results']/table/tbody//td/span/a[text()='View']");
$this->click("xpath=//div[@class='crm-search-results']/table/tbody//td/span/a[text()='View']");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForPageToLoad($this->getTimeoutMsec());
$xpath = "xpath=//div[@id='contact-summary']/div/div[2]/div/div/div[2]/div[@class='crm-content crm-contact_type_label']";
$this->verifyText($xpath, preg_quote("Student"));
- $this->open($this->sboxPath . "civicrm/contact/search?reset=1");
- $this->waitForElementPresent('_qf_Basic_refresh');
-
+ $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh');
$this->type('sort_name', $firstName3);
$this->click('_qf_Basic_refresh');
$this->waitForElementPresent("xpath=//div[@class='crm-search-results']/table/tbody//td/span/a[text()='View']");
$this->click("xpath=//div[@class='crm-search-results']/table/tbody//td/span/a[text()='View']");
- $this->waitForPageToLoad($this->getTimeoutMsec());
-
+ $this->waitForPageToLoad($this->getTimeoutMsec());
+
$xpath = "xpath=//div[@id='contact-summary']/div/div[2]/div/div/div[2]/div[@class='crm-content crm-contact_type_label']";
$this->verifyText($xpath, preg_quote("Staff"));
}
$this->_addProfile($profileTitle, $customDataArr, $profileFor);
//setting ckeditor as WYSIWYG
- $this->open($this->sboxPath . "civicrm/admin/setting/preferences/display?reset=1");
- $this->waitForElementPresent('_qf_Display_next-bottom');
+ $this->openCiviPage('admin/setting/preferences/display', 'reset=1', '_qf_Display_next-bottom');
$this->select('editor_id', 'CKEditor');
$this->click('_qf_Display_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
// Find Contact
- $this->open($this->sboxPath . "civicrm/contact/search?reset=1");
- $this->waitForElementPresent('_qf_Basic_refresh');
+ $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh');
$this->type('sort_name', $lastName);
$this->click('_qf_Basic_refresh');
$this->waitForElementPresent('_qf_Basic_next_print');
// selecting first check of profile
$this->click("xpath=//form[@id='Batch']/div[2]/table/tbody/tr/td[2]/table/tbody/tr/td/input[2]");
-
+
// selecting second check of profile
$this->click("xpath=//form[@id='Batch']/div[2]/table/tbody/tr/td[3]/input[2]");
// clicking copy values to rows of first check and verifying
$this->assertTrue($assertCheck, 'copy rows for field two failed[radio button]');
//test with tinymce editor
- $this->open($this->sboxPath . "civicrm/admin/setting/preferences/display?reset=1");
- $this->waitForElementPresent('_qf_Display_next-bottom');
+ $this->openCiviPage('admin/setting/preferences/display', 'reset=1', '_qf_Display_next-bottom');
$this->select('editor_id', 'TinyMCE');
$this->click('_qf_Display_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
// Find Contact
- $this->open($this->sboxPath . "civicrm/contact/search?reset=1");
- $this->waitForElementPresent('_qf_Basic_refresh');
+ $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh');
$this->type('sort_name', $lastName);
$this->click('_qf_Basic_refresh');
$this->waitForElementPresent('_qf_Basic_next_print');
$this->assertTrue($assertCheck, 'Rich Text Area coping failed [TinyMCE]');
//campaign test for interview
- // Enable CiviCampaign module if necessary
- $this->open($this->sboxPath . "civicrm/admin/setting/component?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("_qf_Component_next-bottom");
+ //enable CiviCampaign module if necessary
+ $this->openCiviPage('admin/setting/component', 'reset=1', '_qf_Component_next-bottom');
$enabledComponents = $this->getSelectOptions("enableComponents-t");
if (!in_array("CiviCampaign", $enabledComponents)) {
$this->addSelection("enableComponents-f", "label=CiviCampaign");
$this->click("add");
$this->click("_qf_Component_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("Your changes have been saved."));
+ $this->assertElementContainsText('crm-notification-container', 'Changes Saved');
}
//Adding a survey
- $this->open($this->sboxPath . "civicrm/survey/add?reset=1");
- $this->waitForElementPresent('_qf_Main_upload-bottom');
+ $this->openCiviPage('survey/add', 'reset=1', '_qf_Main_upload-bottom');
$surveyTitle = "BatchUpdateTest Survey" . substr(sha1(rand()), 0, 7);
$this->type("title", $surveyTitle);
$this->select('activity_type_id', 'label=Survey');
//setting options per line to check CRM-9938
$this->type("options_per_line", 2);
-
+
//clicking save
$this->click('_qf_Field_next');
$this->waitForPageToLoad($this->getTimeoutMsec());
return $returnArray;
}
-}
-
+}
\ No newline at end of file
$this->webtestLogin();
$this->_addNewProfile(TRUE, FALSE, TRUE);
}
-
+
function testAddNewNonMultiProfile() {
// This is the path where our testing install resides.
// The rest of URL is defined in CiviSeleniumTestCase base class, in
$this->webtestLogin();
$this->_addNewProfile(FALSE);
}
-
+
function testNonSearchableMultiProfile() {
// This is the path where our testing install resides.
// The rest of URL is defined in CiviSeleniumTestCase base class, in
$this->webtestLogin();
$this->_addNewProfile(TRUE, TRUE);
}
-
+
function _addNewProfile($checkMultiRecord = TRUE, $checkSearchable = FALSE, $userCheck = FALSE) {
-
$params = $this->_testCustomAdd($checkSearchable);
// Go directly to the URL of the screen that you will be
// testing (Add new profile ).
$this->open($this->sboxPath . 'civicrm/admin/uf/group?reset=1');
-
$this->waitForPageToLoad($this->getTimeoutMsec());
-
- $this->click('newCiviCRMProfile-top');
+ $this->click('newCiviCRMProfile-top');
$this->waitForElementPresent('_qf_Group_next-bottom');
//Name of profile
$this->waitForElementPresent('field_name[0]');
$this->click('field_name[0]');
$this->select('field_name[0]', 'value=Contact');
- $this->click("//option[@value='Contact']");
+ $this->click("//option[@value='Contact']");
$this->click('field_name_1');
$this->select('field_name_1', 'label='.$params['textFieldLabel'].' :: '.$params['customGroupTitle']);
if ($checkMultiRecord) {
$this->click('field_name[0]');
$this->select('field_name[0]', 'value=Student');
$this->click("//option[@value='Student']");
-
+
$this->click('field_name_1');
$this->select('field_name_1', 'value=first_name');
$this->click('is_multi_summary');
$recordNew = $this->_addRecords('Create');
$this->waitForPageToLoad($this->getTimeoutMsec());
$elements = $this->parseURL( );
-
$gid = $elements['queryString']['gid'];
$id = $elements['queryString']['id'];
-
+
if ($userCheck) {
- // Add Drupal user
- $this->open($this->sboxPath . "civicrm/contact/view/useradd?reset=1&action=add&cid=$id");
- $this->waitForElementPresent('cms_name');
+ //add drupal user
+ $this->openCiviPage('contact/view/useradd', "reset=1&action=add&cid=$id", 'cms_name');
$this->type('cms_name', $recordNew['firstname']);
$this->type('cms_pass', $recordNew['firstname']);
$this->type('cms_confirm_pass', $recordNew['firstname']);
$this->click('_qf_Useradd_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open( $this->settings->sandboxPATH . "user/logout");
+ $this->open($this->sboxPath . "user/logout");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->open("{$this->sboxPath}user");
// Make sure login form is available
$record2 = $this->_addRecords();
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->verifyText("//div[@id='browseValues']/div/div/table/tbody/tr[3]/td[1]", preg_quote($record2['text']));
-
+
// Check Max Record Limit
$this->verifyElementNotPresent("//div[@id='crm-profile-block']/a/span");
-
+
//Check for edit functionality
sleep(3);
$this->click("//div[@id='browseValues']/div/div/table/tbody/tr/td[3]/span/a[text()='Edit']");
$this->click("//div[@id='profile-dialog']/div/form/div[2]/div[2]/span/input[@id='_qf_Edit_next']");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->verifyText("//div[@id='browseValues']/div/div/table/tbody/tr[1]/td[1]", preg_quote($recordNew['text'].'edit'));
-
+
// Check the delete functionality
$this->click("//div[@id='browseValues']/div/div/table/tbody/tr/td[3]/span/a[text()='Delete']");
$this->waitForElementPresent("//html/body/div[5]");
sleep(3);
$this->assertTrue($this->isTextPresent('Are you sure you want to delete this record?'));
$this->click('_qf_Edit_upload_delete');
-
+
// Check the view functionality
sleep(3);
$this->click("//div[@id='browseValues']/div/div/table/tbody/tr/td[3]/span/a[text()='View']");
$this->verifyElementNotPresent("//div[@id='profile-dialog']/div/div/div/div[1]/div[2]/a");
return;
}
-
+
// Check Search Functionality
if (!$userCheck) {
$this->click("//div[@id='profile-dialog']/div/div/div/div/div[2]/a");