return $contact;
}
+ /**
+ * Add a contact via profile
+ */
+ public function webtestAddViaCreateProfile() {
+ $this->webtestLogin();
+
+ $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);
+
+ //contact details section
+ //fill in first name
+ $this->type("first_name", $firstName);
+
+ //fill in last name
+ $this->type("last_name", $lastName);
+
+ //address section
+ $this->type("street_address-1", "902C El Camino Way SW");
+ $this->type("city-1", "Dumfries");
+ $this->type("postal_code-1", "1234");
+ $this->assertSelected('country-1', "UNITED STATES");
+ $this->select("state_province-1", "value=1019");
+
+ // Clicking save.
+ $this->click("_qf_Edit_next");
+ $this->waitForPageToLoad($this->getTimeoutMsec());
+
+ $this->assertElementContainsText('css=.msg-text', "Your information has been saved.");
+ }
+
}
$this->type('sort_name', $firstName);
$this->click("_qf_Search_refresh");
- $this->waitForElementPresent("xpath=//div[@id='contributionSearch']/table/tbody/tr/td[11]/span/a[text()='Edit']");
- $this->click("xpath=//div[@id='contributionSearch']/table/tbody/tr/td[11]/span/a[text()='Edit']");
+ $this->waitForElementPresent("xpath=//div[@id='contributionSearch']/table/tbody/tr/td[11]/span//a[text()='Edit']");
+ $this->click("xpath=//div[@id='contributionSearch']/table/tbody/tr/td[11]/span//a[text()='Edit']");
$this->waitForElementPresent("_qf_Contribution_cancel-bottom");
$this->assertTrue($this->isTextPresent("$campaignTitle"));
}
$streetAddress = "100 Main Street";
$this->_testAddLocation($streetAddress);
- $this->_testAddFees(FALSE, FALSE, $paymentProcessorId);
+ $this->_testAddFees(FALSE, FALSE, $processorName);
// intro text for registration page
$registerIntro = "Fill in all the fields below and click Continue.";
* @param bool $priceSet
* @param int $processorId
*/
- public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorId) {
+ public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName) {
// Go to Fees tab
$this->click("link=Fees");
$this->waitForElementPresent("_qf_Fee_upload-bottom");
$this->click("CIVICRM_QFID_1_is_monetary");
- $this->check("payment_processor[$processorId]");
+ $this->select2('payment_processor', $processorName, TRUE);
$this->select("financial_type_id", "value=4");
if ($priceSet) {
// get one - TBD
$this->assertChecked("is_multiple_registrations");
}
- $this->click('intro_text-plain');
- $this->fillRichTextField("intro_text", $registerIntro);
+ $this->click("xpath=//div[@id='registration_screen']/table/tbody/tr[1]/td[2]/div[@class='replace-plain']");
+ $this->fillRichTextField("cke_wysiwyg_frame", $registerIntro);
// enable confirmation email
$this->click("CIVICRM_QFID_1_is_email_confirm");
"Priority" => "Normal",
);
$this->webtestVerifyTabularData($openCaseData);
- $this->click("xpath=//span[@class='ui-button-icon-primary ui-icon ui-icon-closethick']");
+ $this->click("xpath=//span[@class='ui-button-icon-primary ui-icon fa-times']");
// verify if custom data is present
$this->openCiviPage('case', 'reset=1');
parent::setUp();
}
+ /**
+ * Add a contact via profile
+ */
public function testAddViaCreateProfile() {
- $this->webtestLogin();
-
- $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);
-
- //contact details section
- //fill in first name
- $this->type("first_name", $firstName);
-
- //fill in last name
- $this->type("last_name", $lastName);
-
- //address section
- $this->type("street_address-1", "902C El Camino Way SW");
- $this->type("city-1", "Dumfries");
- $this->type("postal_code-1", "1234");
- $this->assertSelected('country-1', "UNITED STATES");
- $this->select("state_province-1", "value=1019");
-
- // Clicking save.
- $this->click("_qf_Edit_next");
- $this->waitForPageToLoad($this->getTimeoutMsec());
-
- $this->assertElementContainsText('css=.msg-text', "Your information has been saved.");
+ $this->webtestAddViaCreateProfile();
}
}
$streetAddress = "100 Main Street";
$this->_testAddLocation($streetAddress);
- $this->_testAddFees(FALSE, FALSE, $paymentProcessorId);
+ $this->_testAddFees(FALSE, FALSE, $processorName);
$this->openCiviPage('event/manage', 'reset=1');
$this->type('title', $eventTitle);
$this->click('_qf_SearchEvent_refresh');
* @param bool $priceSet
* @param int $processorId
*/
- public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorId) {
+ public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName) {
// Go to Fees tab
$this->click("link=Fees");
$this->waitForElementPresent("_qf_Fee_upload-bottom");
$this->click("CIVICRM_QFID_1_is_monetary");
- $this->check("payment_processor[{$processorId}]");
+ $this->select2('payment_processor', $processorName, TRUE);
$this->select("financial_type_id", "value=4");
if ($priceSet) {
// get one - TBD
$this->openCiviPage('group', 'reset=1');
$this->type('title', $params['name']);
$this->click('_qf_Search_refresh');
+ $this->waitForAjaxContent();
$this->waitForElementPresent("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td/span[contains(text(), '{$params['name']}')]");
$createdBy = $this->getText("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td[3]/a");
- $this->click("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td[7]/span/a[2]");
+ $this->click("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td[7]//span/a[text()='Settings']");
$this->waitForElementPresent("xpath=//form[@id='Edit']/div[2]/div/table[1]/tbody/tr[2]/td[contains(text(), '{$createdBy}')]");
$this->openCiviPage('group', 'reset=1');
// Find Membership
$this->openCiviPage("member/search", "reset=1", "_qf_Search_refresh");
- $this->multiselect2("membership_type_id", array($membershipTypes['membership_type']));
+ $this->select2('membership_type_id', $membershipTypes['membership_type'], TRUE);
$this->clickLink('_qf_Search_refresh');
$this->waitForText('search-status', "2 Results");
$this->openCiviPage("member/search", "reset=1", "_qf_Search_refresh");
$this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
- $this->multiselect2("membership_type_id", array($membershipTypes['membership_type']));
+ $this->select2('membership_type_id', $membershipTypes['membership_type'], TRUE);
$this->multiselect2("membership_status_id", array("New"));
$this->clickLink('_qf_Search_refresh');
$this->waitForText('search-status', "1 Result");
public function testUpdateProfile() {
// Create new via profile
- include_once 'WebTest/Contact/AddViaProfileTest.php';
- WebTest_Contact_AddViaProfileTest::testAddViaCreateProfile();
+ $this->webtestAddViaCreateProfile();
// Open profile for editing
$locationUrl = $this->getLocation();
$this->assertChecked("is_multiple_registrations");
}
- $this->click('intro_text');
- $this->fillRichTextField("intro_text", $registerIntro);
+ $this->click("xpath=//div[@id='registration_screen']/table/tbody/tr[1]/td[2]/div[@class='replace-plain']");
+ $this->fillRichTextField("cke_wysiwyg_frame", $registerIntro);
// enable confirmation email
$this->click('xpath=//fieldset[@id="mail"]/div/table/tbody/tr/td[2]/label[contains(text(), "Yes")]');
$this->verifyText("xpath=//form[@id='PledgeView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td", preg_quote($value));
}
- $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span[1]/a[text()='View']", FALSE);
+ $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div/table/tbody/tr[1]/td[10]/span[1]/a[text()='View']", FALSE);
$this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
$this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
$this->waitForElementPresent("field_name[0]");
$this->click('field_name[0]');
$this->select('field_name[0]', 'value=Contact');
+ $this->waitForElementPresent('field_name[1]');
$this->click('field_name[1]');
$this->select('field_name[1]', 'value=email');
$this->click("//option[@value='Contact']");