$firstName = 'WebTest' . substr(sha1(rand()), 0, 7);
$lastName = 'InlineFieldsEdit' . substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName, $lastName);
+ $contactId = $this->urlArg('cid');
$this->waitForElementPresent('css=.crm-inline-edit-container.crm-edit-ready');
// Set Communication Prefs
$this->waitForTextPresent('required');
// Share address with a new org
$this->click('address[2][use_shared_address]');
- $this->select('profiles_2', 'label=New Organization');
$orgName = 'Test Org Inline' . substr(sha1(rand()), 0, 7);
- $this->waitForElementPresent('css=#contact-dialog-2 form');
+
+ // create new organization with dialog
+ $this->clickAt("xpath=//div[@id='s2id_address_2_master_contact_id']/a");
+ $this->click("xpath=//li[@class='select2-no-results']//a[contains(text(),' New Organization')]");
+ $this->waitForElementPresent("css=div#crm-profile-block");
+ $this->waitForElementPresent("_qf_Edit_next");
+
$this->type('organization_name', $orgName);
$this->type('street_address-1', 'Test Org Street');
$this->type('city-1', 'Test Org City');
// Try an invalid email
$this->inlineEdit('crm-email-content', array(
'email_2_email' => 'invalid@monkey,com',
- ), 'error');
+ ), 'errorJs');
// Delete email
$this->inlineEdit('crm-email-content', array(
'css=#crm-website-content a.add-more-inline' => TRUE,
'website_1_url' => 'http://example.com',
'website_2_url' => 'something.wrong',
- ), 'error');
+ ), 'errorJs');
// Correct invalid url and add a third website
$this->inlineEdit('crm-website-content', array(
'first_name' => 'NewName',
'prefix_id' => array('Mr.'),
));
- // Page title should be updated with new name
+ $this->assertElementContainsText('css=div.crm-summary-display_name', "Mr. NewName $lastName");
+ // Page title should be updated with new name on reload
+ $this->openCiviPage('contact/view', "reset=1&cid=$contactId", "crm-record-log");
$this->assertElementContainsText('css=title', "Mr. NewName $lastName");
}
}
}
$this->click("css=#$block input.crm-form-submit");
- if ($valid !== 'error') {
+ if ($valid !== 'error' && $valid !='errorJs') {
// Verify the form saved
$this->waitForElementPresent("css=#$block > .crm-inline-block-content");
$validate = FALSE;
}
// Verify there was a form error
else {
- $this->waitForElementPresent('css=#crm-notification-container .error.ui-notify-message');
- $this->click('css=#crm-notification-container .error .ui-notify-cross');
+ switch($valid) {
+ case 'errorJs':
+ $this->waitForElementPresent('css=label.error');
+ break;
+ default:
+ $this->waitForElementPresent('css=#crm-notification-container .error.ui-notify-message');
+ $this->click('css=#crm-notification-container .error .ui-notify-cross');
+ }
}
}
}