Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
81621fee | 4 | | CiviCRM version 4.7 | |
6a488035 | 5 | +--------------------------------------------------------------------+ |
8c9251b3 | 6 | | Copyright CiviCRM LLC (c) 2004-2018 | |
6a488035 TO |
7 | +--------------------------------------------------------------------+ |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License along with this program; if not, contact CiviCRM LLC | | |
21 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
22 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
23 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
24 | +--------------------------------------------------------------------+ | |
d25dd0ee | 25 | */ |
6a488035 | 26 | |
6a488035 | 27 | require_once 'CiviTest/CiviSeleniumTestCase.php'; |
e9479dcf EM |
28 | |
29 | /** | |
30 | * Class WebTest_Member_OnlineAutoRenewMembershipGCTest | |
31 | */ | |
6a488035 TO |
32 | class WebTest_Member_OnlineAutoRenewMembershipGCTest extends CiviSeleniumTestCase { |
33 | ||
34 | protected function setUp() { | |
35 | parent::setUp(); | |
36 | } | |
37 | ||
00be9182 | 38 | public function testOnlineAutoRenewMembershipAnonymous() { |
6a488035 TO |
39 | //configure membership signup page. |
40 | $pageId = $this->_configureMembershipPage(); | |
41 | ||
42 | //now do the test membership signup. | |
f2ff7d84 | 43 | $this->openCiviPage('contribute/transact', "reset=1&action=preview&id={$pageId}", "_qf_Main_upload-bottom"); |
6a488035 | 44 | |
63d14d48 | 45 | $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]/div[2]/span/label/span[1][contains(text(),'Student')]"); |
6a488035 TO |
46 | $this->click("auto_renew"); |
47 | ||
48 | $firstName = 'John'; | |
49 | $lastName = 'Smith_' . substr(sha1(rand()), 0, 7); | |
50 | $this->type('email-5', "{$lastName}@example.com"); | |
51 | ||
225a8648 | 52 | $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next_checkout"); |
6a488035 TO |
53 | |
54 | $text = 'I want this membership to be renewed automatically every 1 year(s).'; | |
f2ff7d84 | 55 | $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text); |
6a488035 TO |
56 | |
57 | $this->click("_qf_Confirm_next_checkout"); | |
6a488035 | 58 | |
6a488035 TO |
59 | } |
60 | ||
00be9182 | 61 | public function testOnlineAutoRenewMembershipAuthenticated() { |
6a488035 TO |
62 | //configure membership signup page. |
63 | $pageId = $this->_configureMembershipPage(); | |
64 | ||
6a488035 TO |
65 | $this->webtestLogin(); |
66 | $this->waitForPageToLoad($this->getTimeoutMsec()); | |
67 | ||
68 | //now do the test membership signup. | |
f2ff7d84 | 69 | $this->openCiviPage('contribute/transact', "reset=1&action=preview&id={$pageId}", "_qf_Main_upload-bottom"); |
63d14d48 | 70 | $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]/div[2]/span/label/span[1][contains(text(),'Student')]"); |
6a488035 TO |
71 | |
72 | $this->click("auto_renew"); | |
73 | ||
74 | $firstName = 'John'; | |
75 | $lastName = 'Smith_' . substr(sha1(rand()), 0, 7); | |
76 | $this->type('email-5', "{$lastName}@example.com"); | |
77 | ||
225a8648 | 78 | $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next_checkout"); |
6a488035 TO |
79 | |
80 | $text = 'I want this membership to be renewed automatically every 1 year(s).'; | |
f2ff7d84 | 81 | $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text); |
6a488035 TO |
82 | |
83 | $this->click("_qf_Confirm_next_checkout"); | |
6a488035 | 84 | |
6a488035 | 85 | } |
96025800 | 86 | |
6a488035 | 87 | } |