*/
require_once 'CiviTest/CiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Contact_AdvanceSearchPaneTest
+ */
class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase {
protected function setUp() {
$this->_checkOpenedPanes(array_keys($allpanes));
}
+ /**
+ * @param array $openedPanes
+ */
function _checkOpenedPanes($openedPanes = array(
)) {
if (!$this->isTextPresent('No matches found')) {
}
}
+ /**
+ * @param $paneRef
+ * @param array $selectFields
+ */
function _selectPaneFields($paneRef, $selectFields = array(
)) {
$pane = $this->_advanceSearchPanes($paneRef);
}
break;
+ case 'multiselect2':
+ foreach ($field['values'] as $op) {
+ $this->waitForVisible($fldLocator);
+ $this->multiselect2($fldLocator, $op);
+ }
+ break;
+
case 'date':
$this->webtestFillDate($fldLocator, current($field['values']));
break;
}
}
+ /**
+ * @param null $paneRef
+ *
+ * @return array
+ */
function _advanceSearchPanes($paneRef = NULL) {
static $_advance_search_panes;
array(
'Location Type' =>
array(
- 'type' => 'checkbox',
- 'values' => array('location_type[1]', 'location_type[2]'),
+ 'type' => 'multiselect2',
+ 'locator' => 'location_type',
+ 'values' => array(array('Home', 'Work')),
),
'Country' =>
array(
),
'State' =>
array(
- 'type' => 'select',
+ 'type' => 'multiselect2',
'locator' => 'state_province',
- 'values' => array('Alabama', 'California', 'New Jersey', 'New York'),
+ 'values' => array(array('Alabama', 'California', 'New Jersey', 'New York')),
),
),
),
'event' =>
array(
'headerLocator' => 'div#CiviEvent',
- 'bodyLocator' => 'input#event_name',
+ 'bodyLocator' => 'input#event_id',
'title' => 'Events',
'fields' =>
array(