+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
*/
-/**
- * Include configuration
- */
-define('CIVICRM_SETTINGS_PATH', __DIR__ . '/civicrm.settings.dist.php');
-define('CIVICRM_SETTINGS_LOCAL_PATH', __DIR__ . '/civicrm.settings.local.php');
define('CIVICRM_WEBTEST', 1);
-if (file_exists(CIVICRM_SETTINGS_LOCAL_PATH)) {
- require_once CIVICRM_SETTINGS_LOCAL_PATH;
-}
-require_once CIVICRM_SETTINGS_PATH;
-
/**
* Base class for CiviCRM Selenium tests
*
parent::__construct($name, $data, $dataName, $browser);
$this->loggedInAs = NULL;
- require_once 'CiviSeleniumSettings.php';
$this->settings = new CiviSeleniumSettings();
if (property_exists($this->settings, 'serverStartupTimeOut') && $this->settings->serverStartupTimeOut) {
global $CiviSeleniumTestCase_polled;
return $this->settingCache[$field];
}
+ /**
+ * override this since the built in function doesn't work with the new phpunit.
+ * @param string $element
+ * @param string $text
+ */
+ public function waitForText($element, $text) {
+ $this->waitForTextPresent($text);
+ $this->assertElementContainsText($element, $text);
+ }
+
/**
* Ensures the required CiviCRM components are enabled.
* @param $components
}
}
+ /**
+ * Ensures the required currencies are enabled.
+ * @param $currencies
+ */
+ public function enableCurrency($currencies) {
+ $this->openCiviPage("admin/setting/localization", "reset=1", "_qf_Localization_next-bottom");
+ $enabledCurrency = $this->getSelectOptions("currencyLimit-t");
+ foreach ($enabledCurrency as $k => $val) {
+ $enabledCurrency[$k] = substr($val, 0, 3);
+ }
+ $added = FALSE;
+ foreach ((array) $currencies as $curr) {
+ if (!in_array($curr, $enabledCurrency)) {
+ $this->addSelection("currencyLimit-f", "value=$curr");
+ $this->click("//option[@value='$curr']");
+ $this->click("add");
+ $added = TRUE;
+ }
+ }
+ if ($added) {
+ $this->clickLink("_qf_Localization_next-bottom");
+ }
+ }
+
/**
* Add a contact with the given first and last names and either a given email.
* (when specified), a random email (when true) or no email (when unspecified or null).
$tableLocator = "[@id='$tableId']";
}
foreach ($expected as $label => $value) {
+ //assertContains() accepts param as string
+ $value = "$value";
if ($xpathPrefix) {
$this->waitForElementPresent("xpath=//table{$tableLocator}/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td");
- $this->verifyText("xpath=//table{$tableLocator}/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td", preg_quote($value));
+ $this->assertElementContainsText("xpath=//table{$tableLocator}/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td", $value);
}
else {
$this->waitForElementPresent("xpath=//table{$tableLocator}/tbody/tr/td[text()='{$label}']/following-sibling::td");
- $this->verifyText("xpath=//table{$tableLocator}/tbody/tr/td[text()='{$label}']/following-sibling::td", preg_quote($value));
+ $this->assertElementContainsText("xpath=//table{$tableLocator}/tbody/tr/td[text()='{$label}']/following-sibling::td", $value);
}
}
}
}
$this->type("option_label_{$oIndex}", $oValue['label']);
$this->type("option_amount_{$oIndex}", $oValue['amount']);
- $this->click('link=another choice');
+ $this->click('link=add another choice');
}
}
'test_password' => '7ARxW575w736eF5p',
);
}
- elseif ($processorType == 'Google_Checkout') {
- // FIXME: we 'll need to make a new separate account for testing
- $processorSettings = array(
- 'user_name' => '559999327053114',
- 'password' => 'R2zv2g60-A7GXKJYl0nR0g',
- );
- }
elseif ($processorType == 'PayPal') {
$processorSettings = array(
'test_user_name' => '559999327053114',
if ($memPriceSetId || (($membershipTypes === TRUE) || (is_array($membershipTypes) && !empty($membershipTypes)))) {
// go to step 3 (memberships)
$this->click('link=Memberships');
- $this->waitForElementPresent('_qf_MembershipBlock_next-bottom');
+ $this->waitForElementPresent('_qf_MembershipBlock_submit_savenext');
// fill in step 3 (Memberships)
$this->click('member_is_active');
$this->clickLink('_qf_Edit_upload-bottom');
// Is status message correct?
- $this->waitForText('crm-notification-container', "$groupName");
+ $this->waitForText('crm-notification-container', "The Group '$groupName' has been saved.");
return $groupName;
}
/**
* Select multiple options.
- * @param $fieldid
- * @param $params
+ * @param $fieldId
+ * @param $options
* @param $isDate if multiple date is to be selected from datepicker
*/
- public function multiselect2($fieldid, $params, $isDate = FALSE) {
+ public function multiselect2($fieldId, $options, $isDate = FALSE) {
// In the case of chainSelect, wait for options to load
$this->waitForElementNotPresent('css=select.loading');
- foreach ($params as $value) {
+ foreach ($options as $value) {
if ($isDate) {
- $this->clickAt("xpath=//*[@id='$fieldid']/../div/ul//li/input");
- $this->webtestFillDate($fieldid, $value, TRUE);
+ $this->clickAt("xpath=//*[@id='$fieldId']/../div/ul//li/input");
+ $this->webtestFillDate($fieldId, $value, TRUE);
}
else {
- $this->clickAt("xpath=//*[@id='$fieldid']/../div/ul//li/input");
+ $this->clickAt("xpath=//*[@id='$fieldId']/../div/ul//li/input");
$this->waitForElementPresent("xpath=//ul[@class='select2-results']");
$this->clickAt("xpath=//ul[@class='select2-results']//li/div[text()='$value']");
- $this->assertElementContainsText("xpath=//*[@id='$fieldid']/preceding-sibling::div[1]/", $value);
+ $this->assertElementContainsText("xpath=//*[@id='$fieldId']/preceding-sibling::div[1]/", $value);
}
}
// Wait a sec for select2 to update the original element