//create new current employer
$currentEmployer = substr(sha1(rand()), 0, 7) . "Web Access";
- $this->type('current_employer', $currentEmployer);
//fill in email
$this->type("email_1_email", substr(sha1(rand()), 0, 7) . "john@gmail.com");
$this->click('address[1][use_shared_address]');
// create new organization with dialog
- $this->select("profiles_1", "label=New Organization");
+ $this->clickAt("xpath=//div[@id='s2id_address_1_master_contact_id']/a");
+ $this->click("xpath=//li[@class='select2-no-results']//a[contains(text(),' New Organization')]");
// create new contact using dialog
- $this->waitForElementPresent("css=div#contact-dialog-1");
+ $this->waitForElementPresent("css=div#crm-profile-block");
$this->waitForElementPresent("_qf_Edit_next");
$this->type('organization_name', $currentEmployer);
$this->type("email-Primary", "john@gmail.com" . substr(sha1(rand()), 0, 7));
$this->type('city-1', 'Dumfries');
$this->type('postal_code-1', '1234');
+ $this->select('state_province-1', 'value=1001');
$this->click("_qf_Edit_next");
// Is new contact created?
$this->waitForText('crm-notification-container', "$currentEmployer has been created.");
+ $this->select2('employer_id', $currentEmployer);
//make sure shared address is selected
$this->waitForElementPresent('selected_shared_address-1');
$this->click('address[2][use_shared_address]');
// create new household with dialog
- $this->select('profiles_2', "label=New Household");
+ $this->clickAt("xpath=//div[@id='s2id_address_2_master_contact_id']/a");
+ $this->click("xpath=//li[@class='select2-no-results']//a[contains(text(),' New Household')]");
// create new contact using dialog
- $this->waitForElementPresent("css=div#contact-dialog-2");
+ $this->waitForElementPresent("css=div#crm-profile-block");
$this->waitForElementPresent("_qf_Edit_next");
$sharedHousehold = substr(sha1(rand()), 0, 7) . 'Smith Household';
$this->type("email-Primary", substr(sha1(rand()), 0, 7) . "john@gmail.com");
$this->type('city-1', 'Birmingham');
$this->type('postal_code-1', '3456');
+ $this->select('state_province-1', 'value=1001');
$this->click("_qf_Edit_next");
$this->type('title', $eventTitle);
$this->click('_qf_SearchEvent_refresh');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $Id = explode('_', $this->getAttribute("xpath=//div[@id='event_status_id']/div[3]/table/tbody/tr@id"));
+ $Id = explode('-', $this->getAttribute("xpath=//div[@id='event_status_id']/div[2]/table/tbody/tr@id"));
$eventId = $Id[1];
$params = array('label_a_b' => 'Owner of ' . rand(),
// wait for add Event link
$this->waitForElementPresent("link=Add Event Registration");
$this->click("link=Add Event Registration");
- $this->waitForElementPresent("_qf_Participant_upload-bottom");
- $this->select("event_id", "value={$eventId}");
+ $this->waitForText("s2id_event_id", "- select event -");
+ $this->select2("event_id", $eventTitle);
$this->click("_qf_Participant_upload-bottom");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent("link=Add Event Registration");
$this->openCiviPage('contact/search/advanced', 'reset=1');
$this->click("_qf_Location_upload-bottom");
// Wait for "saved" status msg
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForText('crm-notification-container', "'Location' information has been saved.");
+ $this->waitForElementPresent("_qf_Location_upload-bottom");
+ $this->waitForText('crm-notification-container', "'Event Location' information has been saved.");
}
function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorId) {
$this->click("_qf_Fee_upload-bottom");
// Wait for "saved" status msg
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForTextPresent("'Fee' information has been saved.");
+ $this->waitForElementPresent("_qf_Fee_upload-bottom");
+ $this->waitForTextPresent("'Fees' information has been saved.");
}
function _testAddRelationship($ContactName, $relatedName, $relType) {
$this->select('relationship_type_id', "label={$relType}");
//fill in the individual
- $this->webtestFillAutocomplete($relatedName);
-
- $this->waitForElementPresent("quick-save");
+ $this->select2('related_contact_id', $relatedName, TRUE);
//fill in the relationship start date
$this->webtestFillDate('start_date', '-2 year');
//save the relationship
//$this->click("_qf_Relationship_upload");
- $this->click("quick-save");
- $this->waitForElementPresent("current-relationships");
+ $this->click('_qf_Relationship_upload-bottom');
+ $this->waitForElementPresent("crm-contact-relationship-selector-current_wrapper");
//check the status message
- $this->waitForText('crm-notification-container', "New relationship created.");
+ $this->waitForText('crm-notification-container', "Relationship created.");
- $this->waitForElementPresent("xpath=//div[@id='current-relationships']//div//table/tbody//tr/td[9]/span/a[text()='View']");
- $this->click("xpath=//div[@id='current-relationships']//div//table/tbody//tr/td[9]/span/a[text()='View']");
+ $this->waitForElementPresent("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']");
+ $this->click("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent("xpath=//table[@class='crm-info-panel']");
$this->webtestVerifyTabularData(
array(
'Description' => $description,
'Status' => 'Enabled',
)
);
- $this->assertElementContainsText('option11', $relType);
+ $this->assertElementContainsText("xpath=//table[@class='crm-info-panel']", $relType);
}
function _testSearchResult($relType) {
$this->select("component_mode", "label=Related Contacts");
$this->select("display_relationship_type", "label={$relType}");
$this->click("CiviEvent");
- $this->waitForElementPresent("event_type");
- $this->type("event_type", "Conference");
+ $this->waitForElementPresent("event_type_id");
+ $this->select2("event_type_id", "Conference");
$this->click("_qf_Advanced_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertElementContainsText('search-status', '2 Contacts');
$this->waitForElementPresent("css=div#tagtree");
//add Tagset to contact
- $this->click("//div[@id='Tag']/div[2]/div[1]/div/ul/li[1]/input");
- $this->type("//div[@id='Tag']/div[2]/div[1]/div/ul/li[1]/input", 'tagset1');
- $this->typeKeys("//div[@id='Tag']/div[2]/div[1]/div/ul/li[1]/input", 'tagset1');
+ $this->click("//div[@id='Tag']/div[2]/div[1]/span/ul/li[1]/input");
+ $this->type("//div[@id='Tag']/div[2]/div[1]/span/ul/li[1]/input", 'tagset1');
+ $this->typeKeys("//div[@id='Tag']/div[2]/div[1]/span/ul/li[1]/input", 'tagset1');
// ...waiting for drop down with results to show up...
$this->waitForElementPresent("css=div.token-input-dropdown-facebook");
$this->mouseDownAt("css=li.token-input-dropdown-item2-facebook");
//$this->waitForElementPresent("//div[@id='Tag']/div[3]/div[1]/ul/li[1]/span");
- $this->click("//div[@id='Tag']/div[2]/div[1]/div/ul/li[2]/input");
- $this->type("//div[@id='Tag']/div[2]/div[1]/div/ul/li[2]/input", 'tagset2');
- $this->typeKeys("//div[@id='Tag']/div[2]/div[1]/div/ul/li[2]/input", 'tagset2');
+ $this->click("//div[@id='Tag']/div[2]/div[1]/span/ul/li[2]/input");
+ $this->type("//div[@id='Tag']/div[2]/div[1]/span/ul/li[2]/input", 'tagset2');
+ $this->typeKeys("//div[@id='Tag']/div[2]/div[1]/span/ul/li[2]/input", 'tagset2');
// ...waiting for drop down with results to show up...
$this->waitForElementPresent("css=div.token-input-dropdown-facebook");
// ...need to use mouseDownAt on first result (which is a li element), click does not work
$this->mouseDownAt("css=li.token-input-dropdown-item2-facebook");
- $this->click("//div[@id='Tag']/div[2]/div[1]/div/ul/li");
+ $this->click("//div[@id='Tag']/div[2]/div[1]/span/ul/li");
// Type search name in autocomplete.
$this->click("css=input#sort_name_navigation");
$this->select('relationship_type_id', "label={$params['label_b_a']}");
//fill in the individual
- $this->click("//*[@id='related_contact_id']/../div/ul/li/input");
- $this->keyDown("//*[@id='related_contact_id']/../div/ul/li/input", " ");
- $this->type("//*[@id='related_contact_id']/../div/ul/li/input", $sortName);
- $this->typeKeys("//*[@id='related_contact_id']/../div/ul/li/input", $sortName);
- $this->waitForElementPresent("//*[@class='select2-result-label']");
- $this->clickAt("//*[@class='select2-results']/li[1]");
+ $this->select2('related_contact_id', $sortName, TRUE);
//fill in the relationship start date
$this->select('relationship_type_id', "label={$params['label_b_a']}");
//fill in the individual
- $this->click("//*[@id='related_contact_id']/../div/ul/li/input");
- $this->keyDown("//*[@id='related_contact_id']/../div/ul/li/input", " ");
- $this->type("//*[@id='related_contact_id']/../div/ul/li/input", $sortName);
- $this->typeKeys("//*[@id='related_contact_id']/../div/ul/li/input", $sortName);
- $this->waitForElementPresent("//*[@class='select2-result-label']");
- $this->clickAt("//*[@class='select2-results']/li[1]");
+ $this->select2('related_contact_id', $sortName, TRUE);
//fill in the relationship start date
//fill in the individual
- $this->click("//*[@id='related_contact_id']/../div/ul/li/input");
- $this->keyDown("//*[@id='related_contact_id']/../div/ul/li/input", " ");
- $this->type("//*[@id='related_contact_id']/../div/ul/li/input", $sortName);
- $this->typeKeys("//*[@id='related_contact_id']/../div/ul/li/input", $sortName);
- $this->waitForElementPresent("//*[@class='select2-result-label']");
- $this->clickAt("//*[@class='select2-results']/li[1]");
+ $this->select2('related_contact_id', $sortName, TRUE);
//fill in the relationship start date
$this->webtestFillDate('start_date', '-2 year');
}
$this->click("_qf_Fee_upload-bottom");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent("_qf_Fee_upload-bottom");
// Go to Online Registration tab
$this->click("link=Online Registration");
$this->type("confirm_from_email", "jane.doe@example.org");
$this->click("_qf_Registration_upload-bottom");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForTextPresent("'Registration' information has been saved.");
+ $this->waitForElementPresent("_qf_Registration_upload-bottom");
+ $this->waitForTextPresent("'Online Registration' information has been saved.");
// verify event input on info page
// start at Manage Events listing