<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
parent::setUp();
}
- function testLoggingReport() {
+ public function testLoggingReport() {
$this->webtestLogin();
//enable the logging
$this->type('subject', $noteSubject);
$this->type('note', $noteText);
$this->click("_qf_Note_upload-top");
- $this->waitForElementPresent("xpath=//div[@id='notes']//a[text()='Edit']");
- $this->click("xpath=//div[@id='notes']//a[text()='Edit']");
-
+ $this->waitForElementPresent("xpath=//div[@id='notes']/div/table/tbody/tr/td[7]/span[1]/a[2][text()='Edit']");
+ $this->click("xpath=//div[@id='notes']/div/table/tbody/tr/td[7]/span[1]/a[2][text()='Edit']");
$this->waitForElementPresent("_qf_Note_upload-top");
$this->type('subject', $noteSubject . "_edited");
$this->type('note', $noteText . "_edited");
$this->clickLink("_qf_Note_upload-top", "xpath=//div[@class='crm-results-block']/div[@id='notes']/div/table/tbody/tr//td/span[2]/ul/li[2]/a[text()='Delete']", FALSE);
- $this->click("xpath=//div[@class='crm-results-block']/div[@id='notes']/div/table/tbody/tr//td/span[2]/ul/li[2]/a[text()='Delete']");
+ $this->click("xpath=//div[@id='notes']/div/table/tbody/tr/td[7]/span[2]/ul/li[2]/a[text()='Delete']");
// Check confirmation alert.
$this->waitForText("xpath=//form[@id='Note']/div[@class='view-content']/div[@class='status']", "Are you sure you want to delete the note ''?");
$this->click("xpath=//input[@id='_qf_Note_next']");
$this->select("relationship_type_id", "label=Employee of");
$this->select2('related_contact_id', 'Default', TRUE);
$this->click('_qf_Relationship_upload-bottom');
- $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div//table/tbody//tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Disable']");
- $this->click("xpath=//div[@class='crm-contact-relationship-current']/div//table/tbody//tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Disable']");
+ $this->waitForElementPresent("xpath=//div[@id='contact-summary-relationship-tab']/div[2]/div/table/tbody/tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Disable']");
+
+ $this->click("xpath=//div[@id='contact-summary-relationship-tab']/div[2]/div/table/tbody/tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Disable']");
$this->waitForText("xpath=//div[@class='crm-confirm-dialog ui-dialog-content ui-widget-content modal-dialog crm-ajax-container']", 'Are you sure you want to disable this relationship?');
$this->click("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Yes']");
$this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-past']/div//table/tbody//tr/td[9]/span[2][text()='more']/ul/li[2]/a[text()='Delete']");
$this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td[8]/span/a[2]");
$this->click("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td[8]/span/a[2]");
$this->waitForElementPresent("_qf_Activity_cancel-bottom");
- $this->select("status_id","value=2");
+ $this->select("status_id", "value=2");
$this->click('_qf_Activity_upload-bottom');
$this->waitForText("crm-notification-container", "Activity has been saved.");
$this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td[7][text()='Completed']");
$this->waitForElementPresent("xpath=//div[@class='view-content']//div[@class='action-link']/a");
$this->click("xpath=//div[@class='view-content']//div[@class='action-link']/a");
$this->waitForElementPresent("_qf_Case_cancel-bottom");
- $this->type('activity_subject',"subject".rand());
- $this->select('case_type_id','value=1');
+ $this->type('activity_subject', "subject".rand());
+ $this->select('case_type_id', 'value=1');
$this->click('_qf_Case_upload-bottom');
- $this->waitForElementPresent("xpath=//div[@class='view-content']/table[@class='caseSelector']/tbody/tr[2]/td[9]//span//a[text()='Manage']");
- $this->click("xpath=//div[@class='view-content']/table[@class='caseSelector']/tbody/tr[2]/td[9]//span//a[text()='Manage']");
+ $this->waitForElementPresent("xpath=//form[@id='Search']/div[2]/div/table/tbody/tr[2]/td[9]/span[1]/a[1][text()='Manage']");
+ $this->click("xpath=//form[@id='Search']/div[2]/div/table/tbody/tr[2]/td[9]/span[1]/a[1][text()='Manage']");
$this->waitForElementPresent("xpath=//form[@id='CaseView']/div[2]/table/tbody/tr/td[4]/a");
$this->click("xpath=//form[@id='CaseView']/div[2]/table/tbody/tr/td[4]/a");
$this->waitForElementPresent("_qf_Activity_cancel-bottom");
- $this->select("case_status_id","value=2");
+ $this->select("case_status_id", "value=2");
$this->click("_qf_Activity_upload-top");
$this->waitForElementPresent("_qf_CaseView_cancel-bottom");
$this->click("_qf_CaseView_cancel-bottom");
/**
* @param $data
*/
- function verifyReportData($data) {
+ public function verifyReportData($data) {
foreach ($data as $value) {
// check for the row contains proper data
$actionPath = ($value['action'] == 'Update') ? "td[1]/a[2]" : "td[1][contains(text(), '{$value['action']}')]";
$this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[2][contains(text(), '{$value['log_type']}')]/../{$contactCheck}/../{$actionPath}"), "The proper record not present for (log type : {$value['log_type']}, altered contact : {$value['altered_contact']}, action as {$value['action']})");
if ($value['action'] == 'Update') {
- $this->assertTrue( ($value['action'] == $this->getText("xpath=//table/tbody//tr/td[2][contains(text(), '{$value['log_type']}')]/../td[4]/a[contains(text(), '{$value['altered_contact']}')]/../../{$actionPath}")), "The proper record action {$value['action']} not present for (log type : {$value['log_type']}, altered contact : {$value['altered_contact']} record)");
+ $this->assertTrue(($value['action'] == $this->getText("xpath=//table/tbody//tr/td[2][contains(text(), '{$value['log_type']}')]/../td[4]/a[contains(text(), '{$value['altered_contact']}')]/../../{$actionPath}")), "The proper record action {$value['action']} not present for (log type : {$value['log_type']}, altered contact : {$value['altered_contact']} record)");
}
}
}
* @param $dataForReportDetail
* @param array $filters
*/
- function detailReportCheck($dataForReportDetail, $filters = array()) {
+ public function detailReportCheck($dataForReportDetail, $filters = array()) {
foreach ($dataForReportDetail as $value) {
$this->waitForElementPresent("xpath=//table/tbody//tr/td[2][contains(text(), '{$value['log_type']}')]/../td[4]/a[contains(text(), '{$value['altered_contact']}')]/../../td[1]/a[2]");
$this->click("xpath=//table/tbody//tr/td[2][contains(text(), '{$value['log_type']}')]/../td[4]/a[contains(text(), '{$value['altered_contact']}')]/../../td[1]/a[2]");
}
}
- //visit the logging contact summary report
- $this->openCiviPage('report/logging/contact/summary', 'reset=1');
- foreach ($filters as $type => $filter) {
- if ($type == 'text' ) {
- foreach ($filter as $filterName => $filterValue) {
- $this->type($filterName, $filterValue);
+ //visit the logging contact summary report
+ $this->openCiviPage('report/logging/contact/summary', 'reset=1');
+ foreach ($filters as $type => $filter) {
+ if ($type == 'text') {
+ foreach ($filter as $filterName => $filterValue) {
+ $this->type($filterName, $filterValue);
+ }
}
}
- }
- $this->click("_qf_LoggingSummary_submit");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->click("_qf_LoggingSummary_submit");
+ $this->waitForPageToLoad($this->getTimeoutMsec());
}
}
}