3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
27 require_once 'CiviTest/CiviSeleniumTestCase.php';
30 * Class WebTest_Generic_GeneralClickAroundTest
32 class WebTest_Generic_GeneralClickAroundTest
extends CiviSeleniumTestCase
{
34 protected function setUp() {
38 public function login() {
39 $this->webtestLogin();
40 $this->openCiviPage('');
43 public function testSearchMenu() {
45 // click Search -> Find Contacts
46 // Use class names for menu items since li array can change based on which components are enabled
47 $this->click("css=ul#civicrm-menu li.crm-Search");
48 $this->click("css=ul#civicrm-menu li.crm-Find_Contacts a");
49 $this->waitForElementPresent('tag');
51 $this->click('contact_type');
52 $this->select('contact_type', 'label=Individual');
53 $this->select('tag', 'label=Major Donor');
54 $this->click('_qf_Basic_refresh');
55 $this->waitForElementPresent('search-status');
56 $this->assertText('search-status', "Contact Type IN 'Individual'");
57 $this->assertText('search-status', 'Tagged IN Major Donor');
59 // Advanced Search by Tag
60 $this->click("css=ul#civicrm-menu li.crm-Search");
61 $this->click("css=ul#civicrm-menu li.crm-Advanced_Search a");
62 $this->waitForElementPresent('contact_tags');
63 $this->select('contact_tags', 'label=Major Donor');
64 $this->click('_qf_Advanced_refresh');
65 $this->waitForElementPresent('search-status');
66 $this->assertText('search-status', 'Tagged IN Major Donor');
69 public function testNewIndividual() {
72 // Create New → Individual
73 $this->click("crm-create-new-link");
74 $this->click("link=Individual");
75 $this->waitForPageToLoad($this->getTimeoutMsec());
77 $this->assertElementPresent("first_name");
78 $this->assertElementPresent("email_1_email");
79 $this->assertElementPresent("phone_1_phone");
80 $this->assertElementPresent("contact_source");
81 $this->assertTextPresent("Constituent Information");
82 $this->click("//form[@id='Contact']/div[2]/div[4]/div[1]");
83 $this->click("//div[@id='customData1']/table/tbody/tr[1]/td[1]/label");
84 $this->assertTextPresent("Most Important Issue");
85 $this->click("//form[@id='Contact']/div[2]/div[6]/div[1]");
86 $this->assertTextPresent("Communication Preferences");
87 $this->assertTextPresent("Do not phone");
90 public function testManageGroups() {
93 // Contacts → Manage Groups
94 $this->click("//ul[@id='civicrm-menu']/li[4]");
95 $this->clickLink("xpath=//div[@id='root-menu-div']//div/ul//li/div/a[text()='Manage Groups']");
97 $this->assertTextPresent("Find Groups");
98 $this->assertElementPresent("title");
99 $this->assertTextPresent("Access Control");
100 $this->waitForElementPresent('link=Settings');
101 $this->assertTextPresent("Administrators");
102 $this->assertTextPresent("Add Group");
105 public function testContributionDashboard() {
106 $this->webtestLogin();
107 // Enable CiviContribute module if necessary
108 $this->enableComponents("CiviContribute");
110 // Contributions → Dashboard
111 $this->click("css=ul#civicrm-menu li.crm-Contributions");
112 $this->clickLink("css=ul#civicrm-menu li.crm-Contributions li.crm-Dashboard a");
114 $this->waitForElementPresent("xpath=//*[@id='chart_view']/a");
115 $this->waitForElementPresent("xpath=//*[@id='ContributionCharts']/div[4]/div[3]");
116 $this->assertTextPresent("Contribution Summary");
117 $this->assertTextPresent("Recent Contributions");
120 public function testEventDashboard() {
121 $this->webtestLogin();
123 // Enable CiviEvent module if necessary
124 $this->enableComponents("CiviEvent");
126 // Events → Dashboard
127 $this->click("css=ul#civicrm-menu li.crm-Events");
128 $this->clickLink("css=ul#civicrm-menu li.crm-Events li.crm-Dashboard a");
130 $this->assertTextPresent("Event Summary");
131 $this->assertTextPresent("Counted:");
132 $this->assertTextPresent("Not Counted:");
133 $this->assertTextPresent("Not Counted Due To Status:");
134 $this->assertTextPresent("Not Counted Due To Role:");
135 $this->assertTextPresent("Registered:");
136 $this->assertTextPresent("Attended:");
137 $this->assertTextPresent("No-show:");
138 $this->assertTextPresent("Cancelled:");
139 $this->assertTextPresent("Recent Registrations");
140 $this->assertTextPresent("Find more event participants...");
141 $this->assertTextPresent("Configure");
144 public function testMembershipsDashboard() {
145 $this->webtestLogin();
147 // Enable CiviMember module if necessary
148 $this->enableComponents("CiviMember");
150 // Memberships → Dashboard
151 $this->click("css=ul#civicrm-menu li.crm-Memberships");
152 $this->click("css=ul#civicrm-menu li.crm-Memberships li.crm-Dashboard a");
153 $this->waitForPageToLoad($this->getTimeoutMsec());
155 $this->assertTextPresent("Membership Summary");
156 $this->assertTextPresent("Members by Type");
157 $this->assertTextPresent("Recent Memberships");
158 $this->assertTextPresent("Find more members...");
161 public function testFindContributions() {
162 $this->webtestLogin();
164 // Enable CiviContribute module if necessary
165 $this->enableComponents("CiviContribute");
167 // Search → Find Contributions
168 // Use class names for menu items since li array can change based on which components are enabled
169 $this->click("css=ul#civicrm-menu li.crm-Search");
170 $this->clickLink("css=ul#civicrm-menu li.crm-Find_Contributions a");
172 $this->assertTextPresent("Edit Search Criteria");
173 $this->assertElementPresent("sort_name");
174 $this->assertElementPresent("contribution_date_low");
175 $this->assertElementPresent("contribution_amount_low");
176 $this->assertElementPresent("contribution_check_number");
177 $this->assertTextPresent("Financial Type");
178 $this->assertTextPresent("Contribution Page");
179 $this->assertElementPresent("s2id_contribution_or_softcredits");
180 $this->assertElementPresent("contribution_source");
181 $this->assertTextPresent("Personal Campaign Page");
182 $this->assertTextPresent("Personal Campaign Page Honor Roll");
183 $this->assertTextPresent("Currency");
186 public function testNewMailing() {
187 $this->webtestLogin();
189 // Enable CiviMail module if necessary
190 $this->enableComponents("CiviMail");
192 // configure default mail-box
193 $this->setupDefaultMailbox();
196 // Use class names for menu items since li array can change based on which components are enabled
197 $this->click("css=ul#civicrm-menu li.crm-Mailings");
198 $this->clickLink("css=ul#civicrm-menu li.crm-New_Mailing a");
200 $this->assertTextPresent("Mailing");
203 public function testConstituentReportSummary() {
206 // Constituent Report Summary
207 $this->click("css=ul#civicrm-menu li.crm-Reports");
208 $this->clickLink("css=ul#civicrm-menu li.crm-Contact_Reports a");
210 $this->clickLink("xpath=//div[@id='Contact']/table/tbody/tr/td[1]/a");
212 $this->assertTextPresent("Constituent Summary");
213 $this->click("xpath=//div[@id='mainTabContainer']/ul/li[3]/a");
214 $this->waitForElementPresent("xpath=//div[@id='report-tab-set-filters']");
215 $this->assertTextPresent("Contact Name");
216 $this->assertTextPresent("Contact Source");
217 $this->assertTextPresent("Country");
218 $this->assertTextPresent("State/Province");
219 $this->assertTextPresent("Group");
220 $this->assertTextPresent("Tag");
221 $this->clickLink("_qf_Summary_submit");
223 $this->assertTextPresent("Row(s) Listed");
224 $this->assertTextPresent("Total Row(s)");
227 public function testCustomData() {
230 // Use class names for menu items since li array can change based on which components are enabled
231 $this->click("css=ul#civicrm-menu li.crm-Administer");
232 $this->clickLink("xpath=//div[@id='root-menu-div']//a[text()='Custom Fields']");
234 $this->assertTextPresent("Custom Data");
235 $this->assertTextPresent("Constituent Information");
236 $this->assertTextPresent("Donor Information");
237 $this->assertTextPresent("Food Preference");
239 // Verify create form
240 $this->clickLink("//span[contains(text(), 'Add Set of Custom Fields')]");
242 $this->assertElementPresent("title");
243 $this->assertElementPresent("extends[0]");
244 $this->assertElementPresent("weight");
245 $this->assertTextPresent("Pre-form Help");
246 $this->assertTextPresent("Post-form Help");
249 public function testProfile() {
252 // Use class names for menu items since li array can change based on which components are enabled
253 $this->click("css=ul#civicrm-menu li.crm-Administer");
254 $this->click("css=ul#civicrm-menu li.crm-Customize_Data_and_Screens");
255 $this->clickLink("xpath=//div[@id='root-menu-div']//a[text()='Profiles']");
257 $this->assertTextPresent("CiviCRM Profile");
258 // Verify Reserved Profiles
260 $this->click("xpath=//div[@id='mainTabContainer']/ul/li[2]/a");
261 $this->waitForElementPresent("newCiviCRMProfile-bottom");
262 $this->assertTextPresent("New Household");
263 $this->assertTextPresent("New Individual");
264 $this->assertTextPresent("New Organization");
265 $this->assertTextPresent("Participant Status");
266 $this->assertTextPresent("Shared Address");
267 $this->assertTextPresent("Summary Overlay");
269 // Verify profiles that are not reserved
270 $this->click("xpath=//div[@id='mainTabContainer']/ul/li[1]/a");
271 $this->assertTextPresent("Name and Address");
272 $this->assertTextPresent("Supporter Profile");
274 // Verify create form
275 $this->click("//span[contains(text(), 'Add Profile')]");
276 $this->waitForPageToLoad($this->getTimeoutMsec());
277 $this->assertElementPresent("title");
278 $this->assertElementPresent("uf_group_type[Profile]");
279 $this->assertElementPresent("weight");
280 $this->assertTextPresent("Pre-form Help");
281 $this->assertTextPresent("Post-form Help");
282 $this->click("//form[@id='Group']/div[2]/div[2]/div/div");
283 $this->assertElementPresent("group");
284 $this->assertElementPresent("post_URL");
285 $this->assertTextPresent("Drupal user account registration option?");
286 $this->assertTextPresent("What to do upon duplicate match");
287 $this->assertTextPresent("Proximity Search");
290 public function testTags() {
293 // Use class names for menu items since li array can change based on which components are enabled
294 $this->click("css=ul#civicrm-menu li.crm-Administer");
295 $this->click("css=ul#civicrm-menu li.crm-Customize_Data_and_Screens");
296 $this->clickLink("xpath=//div[@id='root-menu-div']//a[text()='Tags (Categories)']");
299 $this->assertTextPresent("Non-profit");
300 $this->assertTextPresent("Company");
301 $this->assertTextPresent("Government Entity");
302 $this->assertTextPresent("Major Donor");
303 $this->assertTextPresent("Volunteer");
306 public function testActivityTypes() {
309 // Use class names for menu items since li array can change based on which components are enabled
310 $this->click("css=ul#civicrm-menu li.crm-Administer");
311 $this->click("css=ul#civicrm-menu li.crm-Customize_Data_and_Screens");
312 $this->clickLink("xpath=//div[@id='root-menu-div']//a[text()='Activity Types']");
314 // Verify activity types
315 $this->assertTextPresent("Meeting");
316 $this->assertTextPresent("Print PDF Letter");
317 $this->assertTextPresent("Event Registration");
318 $this->assertTextPresent("Contribution");
319 $this->assertTextPresent("Membership Signup");
322 public function testRelationshipTypes() {
325 // Use class names for menu items since li array can change based on which components are enabled
326 $this->click("css=ul#civicrm-menu li.crm-Administer");
327 $this->click("css=ul#civicrm-menu li.crm-Customize_Data_and_Screens");
329 $this->clickLink("xpath=//div[@id='root-menu-div']//a[text()='Relationship Types']");
331 // Verify relationship types
332 $this->assertTextPresent("Child of");
333 $this->assertTextPresent("Head of Household for");
334 $this->assertTextPresent("Sibling of");
335 $this->assertTextPresent("Spouse of");
336 $this->assertTextPresent("Supervised by");
337 $this->assertTextPresent("Volunteer for");
340 public function testMessageTemplates() {
343 // Use class names for menu items since li array can change based on which components are enabled
344 $this->click("css=ul#civicrm-menu li.crm-Administer");
345 $this->click("css=ul#civicrm-menu li.crm-Communications");
346 $this->clickLink("xpath=//div[@id='root-menu-div']//a[text()='Message Templates']");
348 // Verify message templates
349 $this->click("xpath=//div[@id='mainTabContainer']/ul//li/a[contains(text(),'System Workflow Messages')]");
350 $this->assertTextPresent("Contributions - Receipt (on-line)");
351 $this->assertTextPresent("Events - Registration Confirmation and Receipt (off-line)");
352 $this->assertTextPresent("Memberships - Signup and Renewal Receipts (off-line)");
353 $this->assertTextPresent("Personal Campaign Pages - Supporter Status Change Notification");
354 $this->assertTextPresent("Profiles - Admin Notification");
355 $this->assertTextPresent("Tell-a-Friend Email");