$this->type("description", "This is a test campaign");
// include groups for the campaign
- $this->addSelection("includeGroups-f", "label=Advisory Board");
+ $this->addSelection("includeGroups", "label=Advisory Board");
$this->click("//option[@value=4]");
- $this->click("add");
// fill the end date for campaign
$this->webtestFillDate("end_date", "+1 year");
$this->waitForText('crm-notification-container', "Petition has been saved.");
$this->waitForElementPresent("link=Add Petition");
-
- $this->waitForElementPresent("petitions");
+ $this->waitForElementPresent("search_form_petition");
$this->click("search_form_petition");
$this->type("petition_title", $title);
$this->click("xpath=//div[@class='crm-accordion-body']/table/tbody/tr[2]/td/a[text()='Search']");
-
- $this->waitForElementPresent("xpath=//div[@id='petitions_wrapper']/table[@id='petitions']/tbody/tr/td[10]/span[2][text()='more']/ul/li/a[text()='Sign']");
- $url = $this->getAttribute("xpath=//div[@id='petitions_wrapper']/table[@id='petitions']/tbody/tr/td[10]/span[2][text()='more']/ul/li/a[text()='Sign']@href");
+ $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[10]/span[2][text()='more']/ul/li[2]/a[text()='Sign']");
+ $url = $this->getAttribute("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[10]/span[2][text()='more']/ul/li[2]/a[text()='Sign']@href");
////////////// Retrieve Sign Petition Url /////////////////////////
$this->openCiviPage("campaign", "reset=1&subPage=petition", "link=Add Petition");
// check for unconfirmed petition signature
- $this->waitForElementPresent("petitions");
+ $this->waitForElementPresent("search_form_petition");
$this->click("search_form_petition");
$this->type("petition_title", $title);
$this->click("xpath=//div[@class='crm-accordion-body']/table/tbody/tr[2]/td/a[text()='Search']");
- $this->waitForElementPresent("xpath=//div[@id='petitions_wrapper']/table[@id='petitions']/tbody/tr/td[10]/span[2][text()='more']");
- $this->click("xpath=//div[@id='petitions_wrapper']/table[@id='petitions']/tbody/tr/td[10]/span[2][text()='more']/ul/li/a[text()='Signatures']");
+ $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[10]/span[2][text()='more']");
+ $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[10]/span[2][text()='more']/ul/li[3]/a[text()='Signatures']");
$this->waitForPageToLoad($this->getTimeoutMsec());
// verify tabular data
$this->waitForElementPresent("link=Add Petition");
- $this->waitForElementPresent("petitions");
+ $this->waitForElementPresent("search_form_petition");
$this->click("search_form_petition");
$this->type("petition_title", $title);
$this->click("xpath=//div[@class='crm-accordion-body']/table/tbody/tr[2]/td/a[text()='Search']");
- $this->waitForElementPresent("xpath=//div[@id='petitions_wrapper']/table[@id='petitions']/tbody/tr/td[10]/span[2][text()='more']/ul/li/a[text()='Sign']");
- $url = $this->getAttribute("xpath=//div[@id='petitions_wrapper']/table[@id='petitions']/tbody/tr/td[10]/span[2][text()='more']/ul/li/a[text()='Sign']@href");
+ $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[10]/span[2][text()='more']/ul/li[2]/a[text()='Sign']");
+ $url = $this->getAttribute("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[10]/span[2][text()='more']/ul/li[2]/a[text()='Sign']@href");
// logout and sign as anonymous.
$this->webtestLogout();
$this->openCiviPage("campaign", "reset=1&subPage=petition", "link=Add Petition");
// check for confirmed petition signature
- $this->waitForElementPresent("petitions");
+ $this->waitForElementPresent("search_form_petition");
$this->click("search_form_petition");
$this->type("petition_title", $title);
$this->click("xpath=//div[@class='crm-accordion-body']/table/tbody/tr[2]/td/a[text()='Search']");
- $this->waitForElementPresent("xpath=//div[@id='petitions_wrapper']/table[@id='petitions']/tbody/tr/td[10]/span[2][text()='more']");
- $this->click("xpath=//div[@id='petitions_wrapper']/table[@id='petitions']/tbody/tr/td[10]/span[2][text()='more']/ul/li/a[text()='Signatures']");
+ $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[10]/span[2][text()='more']");
+ $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[10]/span[2][text()='more']/ul/li[3]/a[text()='Signatures']");
$this->waitForPageToLoad($this->getTimeoutMsec());
// verify tabular data
$this->type('title', "$customGroup");
$this->select('extends[0]', "value=Contact");
$this->click('_qf_Group_next-bottom');
- $this->waitForElementPresent('_qf_Field_cancel-bottom');
+ $this->waitForElementPresent('newCustomField');
$this->waitForText('crm-notification-container', $customGroup);
// Add custom fields
+ $this->click('newCustomField');
+ $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button[3]/span[2]");
$field1 = "Checkbox $title";
$this->type('label', $field1);
$this->select('data_type[1]', "value=CheckBox");
$this->type('option_label_3', $label3);
$this->type('option_value_3', $value3);
- $this->click('_qf_Field_next-bottom');
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForText('crm-notification-container', $field1);
+ $this->click("xpath=//*[@id='_qf_Field_done-bottom']");
+ $this->waitForElementPresent('newCustomField');
+ $this->isElementPresent("xpath=//table[@id='options']/tbody//tr/td[1]/span[text()='{$field1}']");
// Create a profile for survey
$this->openCiviPage("admin/uf/group", "reset=1");
$surveyProfile = "Survey Profile $title";
$this->type('title', $surveyProfile);
$this->click('_qf_Group_next-bottom');
- $this->waitForElementPresent('_qf_Field_cancel-bottom');
+ $this->waitForElementPresent("xpath=//div[@id='crm-main-content-wrapper']/div/div[2]/a/span");
$this->waitForText('crm-notification-container', $surveyProfile);
// Add fields to the profile
// Phone ( Primary )
+ $this->click("xpath=//div[@id='crm-main-content-wrapper']/div/div[2]/a/span");
+ $this->waitForElementPresent('field_name[0]');
$this->select('field_name[0]', "value=Contact");
+ $this->waitForElementPresent('field_name[1]');
$this->select('field_name[1]', "value=phone");
$this->click('field_name[1]');
$this->select('visibility', "value=Public Pages and Listings");
$this->check('is_searchable');
$this->check('in_selector');
- $this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_cancel-bottom');
+ $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button[2]/span[2]");
+ $this->click("xpath=//div[@class='ui-dialog-buttonset']/button[2]/span[2]");
// Custom Data Fields
+ $this->waitForElementPresent("xpath=//select[@id='field_name_1'][@style='display: none;']");
$this->select('field_name[0]', "value=Contact");
+ $this->waitForElementPresent('field_name[1]');
$this->select('field_name[1]', "label=$field1 :: $customGroup");
$this->click('field_name[1]');
$this->select('visibility', "value=Public Pages and Listings");
$this->check('is_searchable');
$this->check('in_selector');
- $this->click('_qf_Field_next-bottom');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->click("xpath=//div[@class='ui-dialog-buttonset']/button[1]/span[2]");
+ $this->waitForElementPresent("xpath=//table[@id='options']");
+ $this->isElementPresent("xpath=//table[@id='options']/tbody//tr/td[1]/span", $field1);
// Create a survey
$this->openCiviPage("survey/add", "reset=1", "_qf_Main_upload-bottom");
// fill in a unique title for the survey
$surveyTitle = "Survey $title";
+ $this->waitForElementPresent('title');
$this->type('title', $surveyTitle);
// select the created campaign
//$this->select("campaign_id", "label=Campaign $title");
// select the activity type
+ $this->waitForElementPresent('activity_type_id');
$this->select("activity_type_id", "label=Survey");
// fill in reserve survey respondents
$this->waitForElementPresent("//select[@id='group']/option[text()='$groupName']");
// select group
+ $this->waitForElementPresent('group');
$this->click('group');
+ $this->waitForElementPresent('group');
$this->select('group', "label=$groupName");
$this->click('_qf_Search_refresh');
- $this->waitForElementPresent('Go');
- $this->click("CIVICRM_QFID_ts_all_4");
+ $this->waitForElementPresent('toggleSelect');
+ $this->click('toggleSelect');
$this->select('task', "Reserve Respondents");
- $this->click("Go");
+
$this->waitForElementPresent('_qf_Reserve_done_reserve-bottom');
$this->clickLink('_qf_Reserve_done_reserve-bottom', 'access');
//$this->waitForElementPresent("xpath=//ul[@id='crmasmList1']/li");
$this->click('_qf_Search_refresh');
- $this->waitForElementPresent('Go');
//$this->click("xpath=//*[@class='selector']//tbody//tr[@id='rowid{$id1}']/td[1]");
- $this->click("mark_x_{$id1}");
- $this->click("Go");
+ $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']/tbody//tr[@id='rowid{$id1}']/td/input");
+ $this->click("xpath=//table[@class='selector row-highlight']/tbody//tr[@id='rowid{$id1}']/td/input");
+ $this->waitForElementPresent('task');
+ $this->select('task', "Record Survey Responses");
$this->waitForElementPresent('_qf_Interview_cancel_interview');
+ $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[@id='row_{$id1}']/td[6]/input[@type='text']");
+
$this->type("field_{$id1}_phone-Primary-1", 9876543210);
- $this->click("//table[@id='voterRecords']/tbody//tr[@id='row_{$id1}']/td[7]/input[2]/../label[text()='$label1']");
- $this->click("//table[@id='voterRecords']/tbody//tr[@id='row_{$id1}']/td[7]/input[6]/../label[text()='$label2']");
+ $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[@id='row_{$id1}']/td[7]/input[2]/../label[text()='$label1']");
+ $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[@id='row_{$id1}']/td[7]/input[2]/../label[text()='$label1']");
+
+ $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[@id='row_{$id1}']/td[7]/input[4]/../label[text()='$label2']");
+ $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[@id='row_{$id1}']/td[7]/input[6]/../label[text()='$label2']");
+
$this->select("field_{$id1}_result", $optionLabel1);
- $this->click("interview_voter_button_{$id1}");
+ $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[@id='row_{$id1}']/td[10]/a");
+ $this->click('_qf_Interview_cancel_interview');
// Because it tends to cause problems, all uses of sleep() must be justified in comments
// Sleep should never be used for wait for anything to load from the server
// Justification for this instance: FIXME
//$this->click("xpath=//div[@id='search_form_gotv']/div[2]/table/tbody/tr[6]/td/a[text()='Search']");
$this->click("link=Search");
- $this->waitForElementPresent("xpath=//table[@id='gotvVoterRecords']/tbody/tr/td[7]");
- $this->check("xpath=//table[@id='gotvVoterRecords']/tbody/tr/td[7]/input");
+ $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[7]/input");
+ $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[7]/input");
// Check title of the activities created
$this->openCiviPage("activity/search", "reset=1", '_qf_Search_refresh');
+ $this->waitForElementPresent('activity_survey_id');
$this->select('activity_survey_id', "label=$surveyTitle");
$this->click('_qf_Search_refresh');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->verifyText("xpath=//table/tbody//tr/td[5]/a[text()='Smith, $firstName1']/../../td[3]",
+ $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']");
+ $this->verifyText("xpath=//table[@class='selector row-highlight']/tbody//tr/td[5]/a[text()='Smith, $firstName1']/../../td[3]",
preg_quote("$surveyTitle - Respondent Interview")
);
- $this->verifyText("xpath=//table/tbody//tr/td[5]/a[text()='John, $firstName2']/../../td[3]",
+ $this->verifyText("xpath=//table[@class='selector row-highlight']/tbody//tr/td[5]/a[text()='John, $firstName2']/../../td[3]",
preg_quote("$surveyTitle - Respondent Reservation")
);
}