}
}
+ /**
+ * Click on a link or button
+ * Wait for the page to load
+ * Wait for an element to be present
+ */
+ function clickLink($element, $waitFor = 'civicrm-footer') {
+ $this->click($element);
+ $this->waitForPageToLoad($this->getTimeoutMsec());
+ if ($waitFor) {
+ $this->waitForElementPresent($waitFor);
+ }
+ }
+
/**
* Call the API on the local server
* (kind of defeats the point of a webtest - see CRM-11889)
function webtestAddHousehold($householdName = "Smith's Home", $email = NULL) {
- $this->open($this->sboxPath . 'civicrm/contact/add?reset=1&ct=Household');
+ $this->openCiviPage("contact/add", "reset=1&ct=Household");
$this->click('household_name');
$this->type('household_name', $householdName);
function webtestAddOrganization($organizationName = "Organization XYZ", $email = NULL) {
- $this->open($this->sboxPath . 'civicrm/contact/add?reset=1&ct=Organization');
+ $this->openCiviPage("contact/add", "reset=1&ct=Organization");
$this->click('organization_name');
$this->type('organization_name', $organizationName);
* @return an array of saved params values.
*/
function webtestAddRelationshipType($params = array()) {
- $this->open($this->sboxPath . 'civicrm/admin/reltype?reset=1&action=add');
+ $this->openCiviPage("admin/reltype", "reset=1&action=add");
//build the params if not passed.
if (!is_array($params) || empty($params)) {
"Status message didn't show up after saving!"
);
- $this->open($this->sboxPath . 'civicrm/admin/reltype?reset=1');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage("admin/reltype", "reset=1");
//validate data on selector.
$data = $params;
/**
* Create new online contribution page w/ user specified params or defaults.
+ * FIXME: this function take an absurd number of params - very unwieldy :(
*
* @param User can define pageTitle, hash and rand values for later data verification
*
}
// go to the New Contribution Page page
- $this->open($this->sboxPath . 'civicrm/admin/contribute?action=add&reset=1');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/contribute', 'action=add&reset=1');
// fill in step 1 (Title and Settings)
$this->type('title', $pageTitle);
$this->click("id=is_confirm_enabled");
}
- // go to step 2
- $this->click('_qf_Settings_next');
- $this->waitForElementPresent('_qf_Amount_next-bottom');
+ // Submit form
+ $this->clickLink('_qf_Settings_next', "_qf_Amount_next-bottom");
+
+ // Get contribution page id
+ $pageId = $this->urlArg('id');
// fill in step 2 (Processor, Pay Later, Amounts)
if (!empty($processor)) {
$this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
}
- // parse URL to grab the contribution page id
- // pass $pageId back to any other tests that call this class
- return $this->urlArg('id');
+ return $pageId;
}
/**
}
}
- $this->open($this->sboxPath . 'civicrm/contact/deduperules?action=update&id=' . $strictRuleId);
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent('_qf_DedupeRules_next-bottom');
+ $this->openCiviPage('contact/deduperules', "action=update&id=$strictRuleId", '_qf_DedupeRules_next-bottom');
$count = 0;
foreach ($fields as $field => $weight) {
$isDefault = FALSE
) {
- $this->open($this->sboxPath . "civicrm/admin/financial/financialAccount?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage("admin/financial/financialAccount", "reset=1");
$this->click("link=Add Financial Account");
$this->waitForElementPresent('_qf_FinancialAccount_cancel-botttom');
$isDefault = FALSE
) {
if ($firstName) {
- $this->open($this->sboxPath . "civicrm/admin/financial/financialAccount?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage("admin/financial/financialAccount", "reset=1");
}
$this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$editfinancialAccount}']/../td[9]/span/a[text()='Edit']");
}
function addeditFinancialType($financialType, $option = 'new') {
- $this->open($this->sboxPath . 'civicrm/admin/financial/financialType?reset=1');
+ $this->openCiviPage("admin/financial/financialType", "reset=1");
if ($option == 'Delete') {
$this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[7]/span[2]");
/**
* Give the specified permissions
- * Note: this function logs in as 'admin'
+ * Note: this function logs in as 'admin' (logging out if necessary)
*/
function changePermissions($permission) {
$this->webtestLogin('admin');
$this->fillRichTextField('intro_text', 'This is Test Introductory Message', 'CKEditor');
$this->fillRichTextField('footer_text', 'This is Test Footer Message', 'CKEditor');
- // go to step 2
- $this->click('_qf_Settings_next');
- $this->waitForElementPresent("_qf_Amount_next-bottom");
+ // Submit form
+ $this->clickLink('_qf_Settings_next', "_qf_Amount_next-bottom");
+
+ // Get contribution page id
+ $pageId = $this->urlArg('id');
//this contribution page for online contribution
$this->check("payment_processor[{$paymentProcessorId}]");
$this->click('_qf_Contribute_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
- //get Url for Live Contribution Page
- $registerUrl = $this->_testVerifyRegisterPage($contributionPageTitle);
+ // Make sure our page shows up in search results
+ $this->openCiviPage("admin/contribute", "reset=1", "_qf_SearchContribution_refresh");
+ $this->type('title', $contributionPageTitle);
+ $this->click("_qf_SearchContribution_refresh");
+ $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
+ $url = $this->assertElementContainsText("//div[@id='configure_contribution_page']//table/tbody", $contributionPageTitle);
//logout
$this->webtestLogout();
//Open Live Contribution Page
- $this->openCiviPage($registerUrl['url'], $registerUrl['args'], NULL);
+ $this->openCiviPage('contribute/transact', "reset=1&id=$pageId", '_qf_Main_upload-bottom');
+
$firstName = 'Ma' . substr(sha1(rand()), 0, 4);
$lastName = 'An' . substr(sha1(rand()), 0, 7);
-
- $this->type("email-5", $firstName . "@example.com");
-
$this->type("first_name", $firstName);
$this->type("last_name", $lastName);
+ $this->type("email-5", $firstName . "@example.com");
+
$streetAddress = "100 Main Street";
$this->type("street_address-1", $streetAddress);
$this->type("city-1", "San Francisco");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent("_qf_Confirm_next-bottom");
- $this->click("_qf_Confirm_next-bottom");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink("_qf_Confirm_next-bottom", NULL);
//login to check contribution
-
- // Log in using webtestLogin() method
$this->webtestLogin();
//Find Contribution
$this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
$this->type("sort_name", "$firstName $lastName");
- $this->click("_qf_Search_refresh");
-
- $this->waitForPageToLoad($this->getTimeoutMsec());
-
- $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
- $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
+ $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+ $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom");
//View Contribution Record
$this->verifyText("xpath=id('ContributionView')/div[2]/table[1]/tbody/tr[10]/td[2]", preg_quote($campaignTitle));
}
- function _testVerifyRegisterPage($contributionPageTitle) {
- $this->openCiviPage("admin/contribute", "reset=1", "_qf_SearchContribution_refresh");
- $this->type('title', $contributionPageTitle);
- $this->click("_qf_SearchContribution_refresh");
- $this->waitForPageToLoad('50000');
- $id = $this->getAttribute("//div[@id='configure_contribution_page']//table/tbody/tr/td/strong[text()='$contributionPageTitle']/../../td[5]/div/span/ul/li/a[text()='Title and Settings']@href");
- $id = explode('id=', $id);
- $registerUrl = array('url' => 'contribute/transact', 'args' => "reset=1&id=$id[1]");
- return $registerUrl;
- }
}
$this->webtestLogout();
// Go to edit profile page of the created contact.
- $this->openCiviPage("profile/edit", "id={$contactId}&gid={$profileId}&reset=1&cs={$cs}");
- $this->assertStringsPresent(array($profileName));
+ $this->openCiviPage("profile/edit", "id={$contactId}&gid={$profileId}&reset=1&cs={$cs}", NULL);
+ $this->waitForTextPresent($profileName);
// Check all profile fields, update their values.
foreach ($fields as $field) {
$this->waitForPageToLoad(2 * $this->getTimeoutMsec());
// Check profile view page.
- $this->assertStringsPresent(array($profileName));
+ $this->waitForTextPresent($profileName);
// Check updated values of all fields.
$checkFieldValues = array();
}
}
- function _testVerifyRegisterPage($contributionPageTitle) {
- $this->openCiviPage("admin/contribute", "reset=1", '_qf_SearchContribution_refresh');
- $this->type('title', $contributionPageTitle);
- $this->click('_qf_SearchContribution_refresh');
- $this->waitForPageToLoad('50000');
- $id = $this->getAttribute("//div[@id='configure_contribution_page']//div[@class='dataTables_wrapper']/table/tbody/tr@id");
- $id = explode('_', $id);
- $registerUrl = "civicrm/contribute/transact?reset=1&id=$id[1]";
- return $registerUrl;
- }
-
function testContributeOnlineWithPriceSet() {
$this->webtestLogin();
$this->fillRichTextField('footer_text', 'This is Test Footer Message', 'CKEditor');
$this->select('financial_type_id', "label={$financialType}");
- // go to step 2
- $this->click('_qf_Settings_next');
- $this->waitForElementPresent('_qf_Amount_next-bottom');
+
+ // Submit form
+ $this->clickLink('_qf_Settings_next', "_qf_Amount_next-bottom");
+
+ // Get contribution page id
+ $pageId = $this->urlArg('id');
//this contribution page for online contribution
- //$this->select( 'payment_processor_id', 'label=' . $processorName );
$this->click("xpath=//tr[@class='crm-contribution-contributionpage-amount-form-block-payment_processor']/td/label[text()='$processorName']");
$this->select('price_set_id', 'label=' . $setTitle);
$this->click('_qf_Amount_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
- //get Url for Live Contribution Page
- $registerUrl = $this->_testVerifyRegisterPage($contributionPageTitle);
-
//logout
$this->webtestLogout();
//Open Live Contribution Page
- $this->open($this->sboxPath . $registerUrl);
- $this->waitForElementPresent('_qf_Main_upload-bottom');
+ $this->openCiviPage('contribute/transact', "reset=1&id=$pageId", '_qf_Main_upload-bottom');
$firstName = 'Ma' . substr(sha1(rand()), 0, 4);
$lastName = 'An' . substr(sha1(rand()), 0, 7);
$this->fillRichTextField('intro_text', 'This is Test Introductory Message', 'CKEditor');
$this->fillRichTextField('footer_text', 'This is Test Footer Message', 'CKEditor');
- // go to step 2
- $this->click('_qf_Settings_next');
- $this->waitForElementPresent('_qf_Amount_next-bottom');
+ // Submit form
+ $this->clickLink('_qf_Settings_next', "_qf_Amount_next-bottom");
+
+ // Get contribution page id
+ $pageId = $this->urlArg('id');
//this contribution page for online contribution
- //$this->select( 'payment_processor_id', 'label=' . $processorName );
$this->click("xpath=//tr[@class='crm-contribution-contributionpage-amount-form-block-payment_processor']/td/label[text()='$processorName']");
$this->select('price_set_id', 'label=' . $setTitle);
- $this->click('_qf_Amount_next-bottom');
- $this->waitForPageToLoad($this->getTimeoutMsec());
-
- //get Url for Live Contribution Page
- $registerUrl = $this->_testVerifyRegisterPage($contributionPageTitle);
+ $this->clickLink('_qf_Amount_next-bottom');
//logout
$this->webtestLogout();
//Open Live Contribution Page
- $this->open($this->sboxPath . $registerUrl);
- $this->waitForElementPresent('_qf_Main_upload-bottom');
+ $this->openCiviPage('contribute/transact', "reset=1&id=$pageId", '_qf_Main_upload-bottom');
$firstName = 'Ma' . substr(sha1(rand()), 0, 4);
$lastName = 'An' . substr(sha1(rand()), 0, 7);
$this->waitForPageToLoad($this->getTimeoutMsec());
//login to check contribution
-
- // Log in using webtestLogin() method
$this->webtestLogin();
//Find Contribution
// select testdrive mode
$this->isTextPresent($pageTitle);
- $this->openCiviPage("contribute/transact", "reset=1&action=preview&id=$pageId");
+ $this->openCiviPage("contribute/transact", "reset=1&action=preview&id=$pageId", '_qf_Main_upload-bottom');
// verify whatever’s possible to verify
// FIXME: ideally should be expanded
}
}
- /*
- * check CRM-7943
- */
+ /**
+ * check CRM-7943
+ */
function testContributionPageSeparatePayment() {
// open browser, login
$this->webtestLogin();
// select testdrive mode
$this->isTextPresent($pageTitle);
- $this->openCiviPage("contribute/transact", "reset=1&action=preview&id=$pageId");
+ $this->openCiviPage("contribute/transact", "reset=1&action=preview&id=$pageId", '_qf_Main_upload-bottom');
$texts = array(
"Title - New Membership $hash",
}
}
- /*
- * check CRM-7949
- */
+ /**
+ * check CRM-7949
+ */
function testContributionPageSeparatePaymentPayLater() {
// open browser, login
$this->webtestLogin();
$this->click('_qf_SearchContribution_refresh');
$this->waitForPageToLoad($this->getTimeoutMsec());
- //get Url for Live Contribution Page
- $registerUrl = "civicrm/contribute/transact?reset=1&id=$pageId";
//logout
$this->webtestLogout();
//Open Live Contribution Page
- $this->open($this->sboxPath . $registerUrl);
- $this->waitForElementPresent('_qf_Main_upload-bottom');
+ $this->openCiviPage('contribute/transact', "reset=1&id=$pageId", '_qf_Main_upload-bottom');
$firstName = 'Ya' . substr(sha1(rand()), 0, 4);
$lastName = 'Cha' . substr(sha1(rand()), 0, 7);
$this->type('email-5', $firstName . '@example.com');
$this->type('first_name', $firstName);
$this->type('last_name', $lastName);
- //$this->click( "xpath=id('Main')/x:div[2]/x:div[3]/x:div[2]/x:label[2]" );
- $this->waitForElementPresent('_qf_Main_upload-bottom');
+
$this->click('_qf_Main_upload-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent('_qf_Confirm_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
//Open Live Membership Page
- $this->open($this->sboxPath . "civicrm/contribute/transact?reset=1&id=" . $pageId . "&cid=" . $cid);
- $this->waitForElementPresent("_qf_Main_upload-bottom");
+ $this->openCiviPage('contribute/transact', "reset=1&id=$pageId&cid=$cid", "_qf_Main_upload-bottom");
$this->click('CIVICRM_QFID_amount_other_radio_4');
$this->type('amount_other', 60);
$this->click('onbehalf_organization_name');
function _testOrganizationWithImageUpload($pageId, $cid, $pageTitle) {
//Open Live Contribution Page
- $this->openCiviPage("contribute/transact", "reset=1&id=$pageId");
+ $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", '_qf_Main_upload-bottom');
$firstName = 'Ma' . substr(sha1(rand()), 0, 4);
$lastName = 'An' . substr(sha1(rand()), 0, 7);
$allowOtherAmmount = TRUE
);
- $this->openCiviPage("contribute/transact", "reset=1&action=preview&id=$pageId");
- $this->assertTrue($this->isTextPresent($donationPageTitle));
+ $this->openCiviPage("contribute/transact", "reset=1&action=preview&id=$pageId", NULL);
+ $this->waitForTextPresent($donationPageTitle);
$firstName = 'Ma' . substr(sha1(rand()), 0, 4);
$lastName = 'An' . substr(sha1(rand()), 0, 7);
$allowOtherAmmount = TRUE
);
- $this->openCiviPage("contribute/transact", "reset=1&action=preview&id=$pageId");
- $this->assertTrue($this->isTextPresent($donationPageTitle));
+ $this->openCiviPage("contribute/transact", "reset=1&action=preview&id=$pageId", NULL);
+ $this->waitForTextPresent($donationPageTitle);
$firstName = 'Ma' . substr(sha1(rand()), 0, 4);
$lastName = 'An' . substr(sha1(rand()), 0, 7);
$contributionPageTitle = "Contribution Page $title";
$paymentProcessor = "Webtest Dummy $title";
- $this->webtestAddContributionPage(NULL, NULL, $contributionPageTitle, array($paymentProcessor => 'Dummy'),
+ $pageId = $this->webtestAddContributionPage(NULL, NULL, $contributionPageTitle, array($paymentProcessor => 'Dummy'),
TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, $sid, FALSE, 1, NULL
);
// Sign up for membership
- $registerUrl = $this->_testVerifyRegisterPage($contributionPageTitle);
-
$firstName = 'John_' . substr(sha1(rand()), 0, 7);
$lastName = 'Anderson_' . substr(sha1(rand()), 0, 7);
$email = "{$firstName}.{$lastName}@example.com";
'last_name' => $lastName,
'email-5' => $email,
);
- $this->_testSignUpOrRenewMembership($registerUrl, $contactParams, $memTypeTitle1, $memTypeTitle2);
+ $this->_testSignUpOrRenewMembership($pageId, $contactParams, $memTypeTitle1, $memTypeTitle2);
// Renew this membership
- $this->_testSignUpOrRenewMembership($registerUrl, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = TRUE);
+ $this->_testSignUpOrRenewMembership($pageId, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = TRUE);
}
function testAddPriceSetWithMultipleTerms() {
$contributionPageTitle = "Contribution Page $title";
$paymentProcessor = "Webtest Dummy $title";
- $this->webtestAddContributionPage(NULL, NULL, $contributionPageTitle, array($paymentProcessor => 'Dummy'),
+ $pageId = $this->webtestAddContributionPage(NULL, NULL, $contributionPageTitle, array($paymentProcessor => 'Dummy'),
TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, $sid, FALSE, 1, NULL
);
// Sign up for membership
- $registerUrl = $this->_testVerifyRegisterPage($contributionPageTitle);
-
$firstName = 'John_' . substr(sha1(rand()), 0, 7);
$lastName = 'Anderson_' . substr(sha1(rand()), 0, 7);
$email = "{$firstName}.{$lastName}@example.com";
'email-5' => $email,
);
//membership with number of terms as 2
- $this->_testMultilpeTermsMembershipRegistration($registerUrl, $contactParams, $memTypeTitle1, 2);
+ $this->_testMultilpeTermsMembershipRegistration($pageId, $contactParams, $memTypeTitle1, 2);
//membership with number of terms as 3 which will renew the above membership
- $this->_testMultilpeTermsMembershipRegistration($registerUrl, $contactParams, $memTypeTitle1, 3, TRUE);
+ $this->_testMultilpeTermsMembershipRegistration($pageId, $contactParams, $memTypeTitle1, 3, TRUE);
}
$this->assertStringsPresent($validateStrings);
}
- function _testVerifyRegisterPage($contributionPageTitle) {
- $this->openCiviPage('admin/contribute', 'reset=1', '_qf_SearchContribution_refresh');
- $this->type('title', $contributionPageTitle);
- $this->click('_qf_SearchContribution_refresh');
- $this->waitForPageToLoad('50000');
- $id = $this->getAttribute("//div[@id='configure_contribution_page']//div[@class='dataTables_wrapper']/table/tbody/tr@id");
- $id = explode('_', $id);
- $registerUrl = array('url' => 'contribute/transact', 'args' => "reset=1&id=$id[1]");
- return $registerUrl;
- }
-
- function _testSignUpOrRenewMembership($registerUrl, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = FALSE) {
+ function _testSignUpOrRenewMembership($pageId, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = FALSE) {
$this->webtestLogout();
- $this->openCiviPage($registerUrl['url'], $registerUrl['args'], '_qf_Main_upload-bottom');
+ $this->openCiviPage('contribute/transact', "reset=1&id=$pageId", '_qf_Main_upload-bottom');
//build the membership dates.
- require_once 'CRM/Core/Config.php';
- require_once 'CRM/Utils/Array.php';
- require_once 'CRM/Utils/Date.php';
$currentYear = date('Y');
$currentMonth = date('m');
$previousDay = date('d') - 1;
);
}
- $this->click('_qf_MembershipView_cancel-bottom');
- $this->waitForElementPresent("xpath=//div[@id='memberSearch']/table/tbody/tr[2]");
+ $this->clickLink('_qf_MembershipView_cancel-bottom', "xpath=//div[@id='memberSearch']/table/tbody/tr[2]");
$this->click("xpath=//div[@id='memberSearch']/table/tbody//tr/td[4][text()='{$memTypeTitle2}']/../td[11]/span/a[text()='View']");
$this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
}
}
- function _testMultilpeTermsMembershipRegistration($registerUrl, $contactParams, $memTypeTitle1, $term, $renew = FALSE){
+ function _testMultilpeTermsMembershipRegistration($pageId, $contactParams, $memTypeTitle1, $term, $renew = FALSE){
if($renew){
$this->openCiviPage('member/search', 'reset=1', 'member_end_date_high');
$this->type("sort_name", "{$contactParams['first_name']} {$contactParams['last_name']}");
$this->webtestLogout();
- $this->openCiviPage($registerUrl['url'], $registerUrl['args'], '_qf_Main_upload-bottom');
+ $this->openCiviPage('contribute/transact', "reset=1&id=$pageId", '_qf_Main_upload-bottom');
//build the membership dates.
- require_once 'CRM/Core/Config.php';
- require_once 'CRM/Utils/Array.php';
- require_once 'CRM/Utils/Date.php';
$currentYear = date('Y');
$currentMonth = date('m');
$previousDay = date('d') - 1;
parent::setUp();
}
+ /**
+ * FIXME: This test tries to update a contribution page (id=2) that may not exist :(
+ */
function testOnlineMembershipRenew() {
// a random 7-char string and an even number to make this pass unique
$hash = substr(sha1(rand()), 0, 7);
// save
$this->waitForElementPresent("_qf_Amount_next");
- $this->click('_qf_Amount_next');
- $this->waitForPageToLoad();
+ $this->clickLink('_qf_Amount_next');
// go to Membership block
$this->click('css=#tab_membership a');
}
}
+ /**
+ * FIXME: This test tries to update a contribution page (id=2) that may not exist :(
+ */
function testOnlineMembershipRenewChangeType() {
// a random 7-char string and an even number to make this pass unique
$hash = substr(sha1(rand()), 0, 7);
//logout
$this->webtestLogout();
- $this->openCiviPage("contribute/transact", "reset=1&id=$pageId");
+ $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom");
$this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'$membershipTypeTitle')]");
$this->type("email-5", $email);
function _testOnlineMembershipSignup($pageId, $memTypeId, $cid = NULL) {
//Open Live Contribution Page
+ $args = array('reset' => 1, 'id' => $pageId);
if ($cid) {
- $contribUrl = array('url' => "contribute/transact", 'args' => "reset=1&id=$pageId&cid=$cid");
+ $args['cid'] = $cid;
}
- else {
- $contribUrl = array('url' => "contribute/transact", 'args' => "reset=1&id=$pageId");
- }
- $this->openCiviPage($contribUrl['url'], $contribUrl['args'], '_qf_Main_upload-bottom');
+ $this->openCiviPage("contribute/transact", $args, '_qf_Main_upload-bottom');
// Select membership type 1
$this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'$memTypeId')]");
$this->type("xpath=//div[@class='crm-section other_amount-section']//div[2]/input", 60);
- $this->click("_qf_Main_upload-bottom");
- $this->waitForElementPresent("_qf_Confirm_next-bottom");
- $this->click("_qf_Confirm_next-bottom");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
+ $this->clickLink("_qf_Confirm_next-bottom", NULL);
}
}