/**
* Select multiple options.
- * @param $fieldid
- * @param $params
+ * @param $fieldId
+ * @param $options
* @param $isDate if multiple date is to be selected from datepicker
*/
- public function multiselect2($fieldid, $params, $isDate = FALSE) {
+ public function multiselect2($fieldId, $options, $isDate = FALSE) {
// In the case of chainSelect, wait for options to load
$this->waitForElementNotPresent('css=select.loading');
- foreach ($params as $value) {
+ foreach ($options as $value) {
if ($isDate) {
- $this->clickAt("xpath=//*[@id='$fieldid']/../div/ul//li/input");
- $this->webtestFillDate($fieldid, $value, TRUE);
+ $this->clickAt("xpath=//*[@id='$fieldId']/../div/ul//li/input");
+ $this->webtestFillDate($fieldId, $value, TRUE);
}
else {
- $this->clickAt("xpath=//*[@id='$fieldid']/../div/ul//li/input");
+ $this->clickAt("xpath=//*[@id='$fieldId']/../div/ul//li/input");
$this->waitForElementPresent("xpath=//ul[@class='select2-results']");
$this->clickAt("xpath=//ul[@class='select2-results']//li/div[text()='$value']");
- $this->assertElementContainsText("xpath=//*[@id='$fieldid']/preceding-sibling::div[1]/", $value);
+ $this->assertElementContainsText("xpath=//*[@id='$fieldId']/preceding-sibling::div[1]/", $value);
}
}
// Wait a sec for select2 to update the original element
// check that expected roles are listed in the Case Roles pane
foreach ($caseRoles as $key => $role) {
- $this->assertText("css=div.crm-case-roles-block", $role);
+ $this->assertElementContainsText("css=div.crm-case-roles-block", $role);
}
$id = $this->urlArg('id');
// check that expected activities are listed in the Case Activities table
foreach ($timelineActivityTypes as $tActivityType) {
- $this->assertText("case_id_$id", $tActivityType);
+ $this->assertElementContainsText("case_id_$id", $tActivityType);
}
// for edit case type
// Go to advance search, check for 'Exclude' option.
$this->openCiviPage("contact/search/advanced", "reset=1");
- $this->select("xpath=//form[@id='Advanced']//table[1]/tbody/tr[2]/td[2]//select[1]", "label={$groupName}");
+ $this->select("group", "label={$groupName}");
$this->waitForTextPresent($groupName);
- $this->select("xpath=//form[@id='Advanced']//table[1]/tbody/tr[5]/td[1]/table[1]/tbody/tr[2]/td[1]//select[1]", 'value=do_not_phone');
- $this->waitForTextPresent('Do not phone');
-
- $this->select("xpath=//form[@id='Advanced']//table[1]/tbody/tr[5]/td[1]/table[1]/tbody/tr[2]/td[1]//select[1]", 'value=do_not_email');
- $this->waitForTextPresent('Do not email');
+ $this->multiselect2('privacy_options', array('Do not phone', 'Do not email'));
$this->click("_qf_Advanced_refresh");
$this->waitForPageToLoad(2 * $this->getTimeoutMsec());
// Go to advance search, check for 'Include' + 'OR' options.
$this->openCiviPage("contact/search/advanced", "reset=1");
- $this->select("xpath=//form[@id='Advanced']//table[1]/tbody/tr[2]/td[2]//select[1]", "label={$groupName}");
+ $this->select("group", "label={$groupName}");
$this->waitForTextPresent($groupName);
- $this->click("xpath=//form[@id='Advanced']//table[1]/tbody/tr[5]/td[1]/table[1]/tbody/tr[1]/td[1]//input[2]");
-
- $this->select("xpath=//form[@id='Advanced']//table[1]/tbody/tr[5]/td[1]/table[1]/tbody/tr[2]/td[1]//select[1]", 'value=do_not_phone');
- $this->waitForTextPresent('Do not phone');
+ $this->click("CIVICRM_QFID_2_privacy_toggle");
- $this->select("xpath=//form[@id='Advanced']//table[1]/tbody/tr[5]/td[1]/table[1]/tbody/tr[2]/td[1]//select[1]", 'value=do_not_email');
- $this->waitForTextPresent('Do not email');
+ $this->multiselect2('privacy_options', array('Do not phone', 'Do not email'));
$this->click("_qf_Advanced_refresh");
$this->waitForPageToLoad(2 * $this->getTimeoutMsec());
// Go to advance search, check for 'Include' + 'AND' options.
$this->openCiviPage("contact/search/advanced", "reset=1");
- $this->select("xpath=//form[@id='Advanced']//table[1]/tbody/tr[2]/td[2]//select[1]", "label={$groupName}");
+ $this->select("group", "label={$groupName}");
$this->waitForTextPresent($groupName);
- $this->click("xpath=//form[@id='Advanced']//table[1]/tbody/tr[5]/td[1]/table[1]/tbody/tr[1]/td[1]//input[2]");
-
- $this->select("xpath=//form[@id='Advanced']//table[1]/tbody/tr[5]/td[1]/table[1]/tbody/tr[2]/td[1]//select[1]", 'value=do_not_phone');
- $this->waitForTextPresent('Do not phone');
+ $this->click("CIVICRM_QFID_2_privacy_toggle");
- $this->select("xpath=//form[@id='Advanced']//table[1]/tbody/tr[5]/td[1]/table[1]/tbody/tr[2]/td[1]//select[1]", 'value=do_not_trade');
- $this->waitForTextPresent('Do not trade');
+ $this->multiselect2('privacy_options', array('Do not phone', 'Do not trade'));
$this->select('privacy_operator', 'value=AND');
'Check Number' => 'check #1041',
);
foreach ($verifyData as $label => $value) {
- $this->verifyText("xpath=//form[@id='ContributionView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td",
- preg_quote($value)
- );
+ $this->assertElementContainsText("xpath=//form[@id='ContributionView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td", $value);
}
// check values of contribution record in the DB
1 => "{$firstName} Anderson",
);
foreach ($expected as $value => $label) {
- $this->verifyText("xpath=id('Search')/div[2]/table[2]/tbody//tr/td[$value]", preg_quote($label));
+ $this->assertElementContainsText("xpath=id('Search')/div[2]/table[2]/tbody//tr/td[$value]", $label);
}
}