$this->waitForTextPresent($sourceText);
// Is status message correct?
- $this->assertTrue($this->isTextPresent("{$membershipTypes['membership_type']} membership for $firstName Memberson has been added."), "Status message didn't show up after saving!");
+ $this->assertElementContainsText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added.",
+ "Status message didn't show up after saving!"
+ );
$this->waitForElementPresent("xpath=//div[@id='Memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']");
'Start date' => $startDate,
'End date' => $endDate,
);
- foreach ($verifyMembershipRenewData as $label => $value) {
- $this->verifyText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td", preg_quote($value));
- }
- }
+ $this->webtestVerifyTabularData($verifyMembershipRenewData);
+ }
function testOfflineMemberRenewOverride() {
$this->open($this->sboxPath);
// select the financial type for the selected membership type
$this->select('financial_type_id', 'value=2');
-
+
// the amount for the selected membership type
$this->type('total_amount', '100.00');
$this->waitForTextPresent($sourceText);
// Is status message correct?
- $this->assertTrue($this->isTextPresent("{$membershipTypes['membership_type']} membership for $firstName Memberson has been added."), "Status message didn't show up after saving!");
+ $this->assertElementContainsText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added.",
+ "Status message didn't show up after saving!"
+ );
$this->waitForElementPresent("xpath=//div[@id='Memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']");
'Start date' => $startDate,
'End date' => $endDate,
);
- foreach ($verifyMembershipRenewOverrideData as $label => $value) {
- $this->verifyText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td", preg_quote($value));
- }
+ $this->webtestVerifyTabularData($verifyMembershipRenewOverrideData);
}
function testOfflineMembershipRenewChangeType() {
$this->waitForTextPresent($sourceText);
// Is status message correct?
- $this->assertTrue($this->isTextPresent("{$membershipTypes['membership_type']} membership for $firstName Memberson has been added."), "Status message didn't show up after saving!");
+ $this->assertElementContainsText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added.",
+ "Status message didn't show up after saving!"
+ );
$this->waitForElementPresent("xpath=//div[@id='Memberships']//table/tbody/tr/td[7]/span[2][text()='more']/ul/li/a[text()='Renew']");
'Start date' => $startDate,
'End date' => $endDate,
);
- foreach ($verifyMembershipData as $label => $value) {
- $this->verifyText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td", preg_quote($value));
- }
+ $this->webtestVerifyTabularData($verifyMembershipData);
}
function testOfflineMembershipRenewMultipleTerms() {
$this->waitForTextPresent($sourceText);
// Is status message correct?
- $this->assertTrue($this->isTextPresent("{$membershipTypes['membership_type']} membership for $firstName Memberson has been added."), "Status message didn't show up after saving!");
- $this->assertTrue($this->isTextPresent("A membership confirmation and receipt has been sent to {$firstName}@memberson.com."), "Email sent to member message didn't show up after saving membership!");
+ $this->assertElementContainsText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added.",
+ "Status message didn't show up after saving!"
+ );
+ $this->assertElementContainsText('crm-notification-container', "A membership confirmation and receipt has been sent to {$firstName}@memberson.com.",
+ "Email sent to member message didn't show up after saving membership!"
+ );
$this->waitForElementPresent("xpath=//div[@id='Memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']");
$this->waitForElementPresent('_qf_MembershipRenewal_cancel-bottom');
// Record contribution and set number of terms to 2
$this->click('record_contribution');
- $this->waitForElementPresent( 'financial_type_id' );
+ $this->waitForElementPresent('financial_type_id');
$this->click('changeTermsLink');
$this->waitForElementPresent('num_terms');
$this->type('num_terms', '');
sleep(2);
$this->click('total_amount');
$this->verifyValue('total_amount', "200.00");
- $this->select( 'financial_type_id', "label=Member Dues" );
+ $this->select('financial_type_id', "label=Member Dues");
$this->select('payment_instrument_id', "label=Check");
$this->waitForElementPresent('check_number');
$this->type('check_number', '1024');
'Start date' => $startDate,
'End date' => $endDate,
);
- foreach ($verifyMembershipRenewData as $label => $value) {
- $this->verifyText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td", preg_quote($value));
- }
+ $this->webtestVerifyTabularData($verifyMembershipRenewData);
}
-}
-
+}
\ No newline at end of file
$pageId = $this->_configureMembershipPage();
//now do the test membership signup.
- $this->open($this->sboxPath . "civicrm/contribute/transact?reset=1&action=preview&id={$pageId}");
- $this->waitForPageToLoad("3000");
- $this->waitForElementPresent("_qf_Main_upload-bottom");
+ $this->openCiviPage('contribute/transact', "reset=1&action=preview&id={$pageId}", "_qf_Main_upload-bottom");
$this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
$this->click("auto_renew");
$this->waitForElementPresent("_qf_Confirm_next_checkout");
$text = 'I want this membership to be renewed automatically every 1 year(s).';
- $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
+ $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text);
$this->click("_qf_Confirm_next_checkout");
sleep(5);
$this->waitForPageToLoad($this->getTimeoutMsec());
//now do the test membership signup.
- $this->open($this->sboxPath . "civicrm/contribute/transact?reset=1&action=preview&id={$pageId}");
- $this->waitForPageToLoad("3000");
- $this->waitForElementPresent("_qf_Main_upload-bottom");
-
+ $this->openCiviPage('contribute/transact', "reset=1&action=preview&id={$pageId}", "_qf_Main_upload-bottom");
$this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
$this->click("auto_renew");
$this->waitForElementPresent("_qf_Confirm_next_checkout");
$text = 'I want this membership to be renewed automatically every 1 year(s).';
- $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
+ $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text);
$this->click("_qf_Confirm_next_checkout");
sleep(5);
$this->webtestAddPaymentProcessor($processorName, 'Google_Checkout');
// -- start updating membership types
- $this->open($this->sboxPath . "civicrm/admin/member/membershipType/add?action=update&id=1&reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/member/membershipType/add', 'action=update&id=1&reset=1');
$this->waitForElementPresent("xpath=//div[@id='membership_type_form']//table/tbody/tr[6]/td/label[contains(text(), 'Auto-renew Option')]/../../td[2]/label[contains(text(), 'Give option, but not required')]");
$this->click("xpath=//div[@id='membership_type_form']//table/tbody/tr[6]/td/label[contains(text(), 'Auto-renew Option')]/../../td[2]/label[contains(text(), 'Give option, but not required')]");
$this->click("_qf_MembershipType_upload-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/admin/member/membershipType/add?action=update&id=2&reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/member/membershipType/add', 'action=update&id=2&reset=1');
$this->waitForElementPresent("xpath=//div[@id='membership_type_form']//table/tbody/tr[6]/td/label[contains(text(), 'Auto-renew Option')]/../../td[2]/label[contains(text(), 'Give option, but not required')]");
$this->click("xpath=//div[@id='membership_type_form']//table/tbody/tr[6]/td/label[contains(text(), 'Auto-renew Option')]/../../td[2]/label[contains(text(), 'Give option, but not required')]");
);
// now logout and login with admin credentials
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('logout', 'reset=1', NULL);
//make sure we do have required permissions.
$permissions = array("edit-1-make-online-contributions");
$this->changePermissions($permissions);
// now logout and do membership test that way
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('logout', 'reset=1', NULL);
}
return $pageId;
$pageId = $this->_configureMembershipPage();
//now do the test membership signup.
- $this->open($this->sboxPath . "civicrm/contribute/transact?reset=1&action=preview&id={$pageId}");
- $this->waitForPageToLoad("3000");
- $this->waitForElementPresent("_qf_Main_upload-bottom");
-
+ $this->openCiviPage('contribute/transact', "reset=1&action=preview&id={$pageId}", "_qf_Main_upload-bottom");
+
$this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
$this->click("auto_renew");
$this->waitForElementPresent("_qf_Confirm_next-bottom");
$text = 'I want this membership to be renewed automatically every 1 year(s).';
- $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
+ $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text);
$this->click("_qf_Confirm_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
$text = 'This membership will be renewed automatically every 1 year(s).';
- $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
+ $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text);
}
function testOnlineAutoRenewMembershipAuthenticated() {
$this->waitForPageToLoad($this->getTimeoutMsec());
//now do the test membership signup.
- $this->open($this->sboxPath . "civicrm/contribute/transact?reset=1&action=preview&id={$pageId}");
- $this->waitForPageToLoad("3000");
- $this->waitForElementPresent("_qf_Main_upload-bottom");
-
+ $this->openCiviPage('contribute/transact', "reset=1&action=preview&id={$pageId}", "_qf_Main_upload-bottom");
+
$this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
$this->click("auto_renew");
$this->type('email-5', "{$lastName}@example.com");
$this->click("_qf_Main_upload-bottom");
- $this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent("_qf_Confirm_next-bottom");
$text = 'I want this membership to be renewed automatically every 1 year(s).';
- $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
+ $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text);
$this->click("_qf_Confirm_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
$text = 'This membership will be renewed automatically every 1 year(s).';
- $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
+ $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text);
}
function testOnlinePendingAutoRenewMembershipAnonymous() {
$pageId = $this->_configureMembershipPage();
//now do the test membership signup.
- $this->open($this->sboxPath . "civicrm/contribute/transact?reset=1&action=preview&id={$pageId}");
- $this->waitForPageToLoad("3000");
- $this->waitForElementPresent("_qf_Main_upload-bottom");
-
+ $this->openCiviPage('contribute/transact', "reset=1&action=preview&id={$pageId}", "_qf_Main_upload-bottom");
+
$this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
$this->click("auto_renew");
$this->type('email-5', "{$lastName}@example.com");
$this->click("_qf_Main_upload-bottom");
- $this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent("_qf_Confirm_next-bottom");
$text = 'I want this membership to be renewed automatically every 1 year(s).';
- $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
+ $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text);
$this->click("_qf_Confirm_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
$text = 'This membership will be renewed automatically every 1 year(s).';
- $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
+ $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text);
}
function _configureMembershipPage() {
$this->webtestAddPaymentProcessor($processorName, 'AuthNet');
// -- start updating membership types
- $this->open($this->sboxPath . "civicrm/admin/member/membershipType/add?action=update&id=1&reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/member/membershipType/add', "action=update&id=1&reset=1", "_qf_MembershipType_upload-bottom");
- $this->waitForElementPresent("_qf_MembershipType_upload-bottom");
$this->click("xpath=//div[@id='membership_type_form']//table/tbody/tr[6]/td/label[contains(text(), 'Auto-renew Option')]/../../td[2]/label[contains(text(), 'Give option, but not required')]");
$this->type("duration_interval", "1");
$this->click("_qf_MembershipType_upload-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->open($this->sboxPath . "civicrm/admin/member/membershipType/add?action=update&id=2&reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('admin/member/membershipType/add', "action=update&id=2&reset=1", "_qf_MembershipType_upload-bottom");
- $this->waitForElementPresent("_qf_MembershipType_upload-bottom");
$this->click("xpath=//div[@id='membership_type_form']//table/tbody/tr[6]/td/label[contains(text(), 'Auto-renew Option')]/../../td[2]/label[contains(text(), 'Give option, but not required')]");
$this->type("duration_interval", "1");
$this->changePermissions($permissions);
// now logout and do membership test that way
- $this->open($this->sboxPath . "civicrm/logout?reset=1");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->openCiviPage('logout', 'reset=1', NULL);
}
return $pageId;