$this->clickLink('link=Add Profile', '_qf_Group_cancel-bottom');
$this->type('title', $profileTitle);
- $this->clickLink('_qf_Group_next-bottom', "xpath=//a/span[text()='Add Field']");
+ $this->clickLink('_qf_Group_next-bottom');
$this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now.");
$this->click("extends[0]");
$this->select("extends[0]", "value=Activity");
$this->click("//option[@value='Activity']");
- $this->click('_qf_Group_next-bottom');
- $this->waitForElementPresent('newCustomField');
- $this->click('newCustomField');
+ $this->clickLink('_qf_Group_next-bottom');
$this->waitForElementPresent('_qf_Field_cancel-bottom');
//Is custom group created?
$this->click("address_1_country_id");
$this->select("address_1_country_id", "value=" . $this->webtestGetValidCountryID());
- if ($this->assertElementContainsText('address_1', "Latitude")) {
+ if ($this->assertElementContainsText('address_table_1', "Latitude")) {
$this->type("address_1_geo_code_1", "1234");
$this->type("address_1_geo_code_2", "5678");
}
$this->click("address_2_country_id");
$this->select("address_2_country_id", "value=" . $this->webtestGetValidCountryID());
- if ($this->assertElementContainsText('address_2', "Latitude")) {
+ if ($this->assertElementContainsText('address_table_2', "Latitude")) {
$this->type("address_2_geo_code_1", "1234");
$this->type("address_2_geo_code_2", "5678");
}
$this->click("address_1_country_id");
$this->select("address_1_country_id", "value=" . $this->webtestGetValidCountryID());
- if ($this->assertElementContainsText('address_1', "Latitude")) {
+ if ($this->assertElementContainsText('address_table_1', "Latitude")) {
$this->type("address_1_geo_code_1", "1234");
$this->type("address_1_geo_code_2", "5678");
}
$this->click("address_1_country_id");
$this->select("address_1_country_id", "value=" . $this->webtestGetValidCountryID());
- if ($this->assertElementContainsText('address_1', "Latitude")) {
+ if ($this->assertElementContainsText('address_table_1', "Latitude")) {
$this->type("address_1_geo_code_1", "1234");
$this->type("address_1_geo_code_2", "5678");
}
function testAddViaCreateProfile() {
$this->webtestLogin();
- $this->openCiviPage('profile/create', 'reset=1&gid=1', '_qf_Edit_cancel');
+ $this->openCiviPage('profile/create', 'reset=1&gid=1', '_qf_Edit_next');
$firstName = 'Jo' . substr(sha1(rand()), 0, 4);
$lastName = 'Ad' . substr(sha1(rand()), 0, 7);
$this->click("extends[0]");
$this->select("extends[0]", "value=Contact");
$this->click("//option[@value='Contact']");
- $this->click("_qf_Group_next-bottom");
- $this->waitForElementPresent('newCustomField');
+ $this->clickLink("_qf_Group_next-bottom");
//Is custom group created?
$this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
- $this->click('newCustomField');
$this->waitForElementPresent("_qf_Field_cancel-bottom");
//add custom field - alphanumeric checkbox
$this->click("extends[0]");
$this->select("extends[0]", "value=Contact");
$this->click("//option[@value='Contact']");
- $this->click("_qf_Group_next-bottom");
- $this->waitForElementPresent('newCustomField');
+ $this->clickLink("_qf_Group_next-bottom");
//Is custom group created?
$this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
- $this->click('newCustomField');
$this->waitForElementPresent("_qf_Field_cancel-bottom");
//add custom field - money text
$this->type("id=title", $customFieldSet);
$this->select("id=extends_0", "label=Individual");
$this->click("id=collapse_display");
- $this->click("id=_qf_Group_next-bottom");
- $this->waitForElementPresent('newCustomField');
+ $this->clickLink("id=_qf_Group_next-bottom");
$this->waitForText('crm-notification-container', "Your custom field set '$customFieldSet' has been added.");
- $this->click('newCustomField');
$this->waitForElementPresent('_qf_Field_done-bottom');
// Add field to fieldset
$this->click("address_1_country_id");
$this->select("address_1_country_id", "value=1228");
- if ($this->assertElementContainsText("address_1", "Latitude")) {
+ if ($this->assertElementContainsText("address_table_1", "Latitude")) {
$this->type("address_1_geo_code_1", "1234");
$this->type("address_1_geo_code_2", "5678");
}
$this->type('help_pre', $setHelp);
$this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
- $this->clickLink('_qf_Set_next-bottom', 'newPriceField');
+ $this->clickLink('_qf_Set_next-bottom');
}
/**
$this->select('extends[1][]', 'value=2');
$this->click("//option[@value='Contact']");
- $this->click('_qf_Group_next');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink('_qf_Group_next', 'label');
//Is custom group created?
$this->waitForText('crm-notification-container', "Your custom field set '$customGroupTitle' has been added. You can add custom fields now.");
$this->click('is_searchable');
//clicking save
- $this->click('_qf_Field_done-bottom');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink('_qf_Field_done-bottom', 'newCustomField', FALSE);
//Is custom field created?
$this->waitForText('crm-notification-container', "Custom field '$checkboxFieldLabel' has been saved.");
//create another custom field - Integer Radio
- $this->clickLink("//a[@id='newCustomField']/span", '_qf_Field_cancel', FALSE);
+ $this->clickLink('newCustomField', '_qf_Field_cancel', FALSE);
$this->click('data_type[0]');
$this->select('data_type[0]', 'value=1');
$this->click("//option[@value='1']");
$this->type('help_pre', $setHelp);
$this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
- $this->clickLink('_qf_Set_next-bottom', 'newPriceField');
+ $this->clickLink('_qf_Set_next-bottom');
}
/**
* @param bool $dateSpecificFields
*/
function _testAddPriceFields(&$fields, &$validateStrings, $dateSpecificFields = FALSE) {
- $this->clickLink('newPriceField', '_qf_Field_cancel-bottom', FALSE);
+ $this->waitForElementPresent('_qf_Field_cancel-bottom');
foreach ($fields as $label => $type) {
$validateStrings[] = $label;
$this->waitForPageToLoad($this->getTimeoutMsec());
// Is status message correct?
- $this->assertElementContainsText("css=#crm-notification-container", "Event registration for $displayName has been added", "Status message didn't show up after saving!");
+ $this->waitForText("crm-notification-container", "Event registration for $displayName has been added");
$this->waitForElementPresent("xpath=//form[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
//click through to the participant view screen
$this->type('help_pre', 'This is test priceset.');
$this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
- $this->clickLink('_qf_Set_next-bottom', 'newPriceField');
+ $this->clickLink('_qf_Set_next-bottom');
}
/**
function _testAddPriceFields($fields) {
$fieldCount = count($fields);
$count = 1;
- $this->click('newPriceField');
$this->waitForElementPresent('label');
foreach ($fields as $label => $field) {
$this->type('label', $label);
$this->select('id=extends_0', 'label=Grants');
$this->addSelection('id=extends_1', "label=$grantType");
$this->click('id=collapse_display');
- $this->click('id=_qf_Group_next-bottom');
- $this->waitForElementPresent('newCustomField');
+ $this->clickLink('id=_qf_Group_next-bottom');
$this->waitForText('crm-notification-container', "Your custom field set '$grantFieldSet' has been added.");
- $this->click('newCustomField');
$this->waitForElementPresent('_qf_Field_done-bottom');
// Add field to fieldset
$this->click('extends[0]');
$this->select('extends[0]', "value=Address");
$this->click("//option[@value='Address']");
- $this->click('_qf_Group_next-bottom');
- $this->waitForElementPresent('newCustomField');
+ $this->clickLink('_qf_Group_next-bottom');
//Is custom group created?
$this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
$gid = $this->urlArg('gid');
- $this->click('newCustomField');
$this->waitForElementPresent('_qf_Field_cancel-bottom');
// create custom field "alphanumeric text"
$this->click('extends[0]');
$this->select('extends[0]', "value=Contact");
$this->click("//option[@value='Contact']");
- $this->click('_qf_Group_next-bottom');
- $this->waitForElementPresent('newCustomField');
+ $this->clickLink('_qf_Group_next-bottom');
//Is custom group created?
$this->waitForText('crm-notification-container', $customGroupTitle);
- $this->click('newCustomField');
$this->waitForElementPresent('_qf_Field_cancel-bottom');
$gid = $this->urlArg('gid');
$this->click("extends[0]");
$this->select("extends[0]", "value=Contact");
$this->click("//option[@value='Contact']");
- $this->click('_qf_Group_next-bottom');
- $this->waitForElementPresent('newCustomField');
+ $this->clickLink('_qf_Group_next-bottom');
//Is custom group created?
$this->assertTrue($this->isTextPresent("Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."));
- $this->click('newCustomField');
$this->waitForElementPresent('_qf_Field_cancel-bottom');
$url = explode('gid=', $this->getLocation());
$gid = $url[1];
$this->type('help_pre', $setHelp);
$this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
- $this->clickLink('_qf_Set_next-bottom', 'newPriceField');
+ $this->clickLink('_qf_Set_next-bottom');
$this->assertTrue($this->isTextPresent("Your Set '{$setTitle}' has been added. You can add fields to this set now."));
}
//Add field to profile
- $this->click("xpath=//a/span[text()='Add Field']");
$this->waitForElementPresent("field_name[0]");
$this->click('field_name[0]');
$this->select('field_name[0]', 'value=Contact');
// Wait for "saved" status msg
$this->waitForText('crm-notification-container', 'Profile Added');
- $this->waitForElementPresent("xpath=//a/span[text()='Add Field']");
- $this->click("xpath=//a/span[text()='Add Field']");
$this->waitForElementPresent("field_name_0");
// select field(s) to be added in profile
-
$this->select("field_name_0", "value=Contact");
$this->select("field_name_1", "value=email");
$this->select("field_name_2", "value=2");
// Wait for "saved" status msg
$this->waitForText('crm-notification-container', "Profile Field Saved");
-
$this->waitForElementPresent("xpath=//div[@id='field_page']/table/tbody/tr[1]/td[9]/span/a[text()='Edit']");
// extract profile Id
$id = explode("gid=", $this->getAttribute("xpath=//div[@id='field_page']/table/tbody/tr/td[9]/span/a[text()='Edit']/@href"));