Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
06a1bc01 | 4 | | CiviCRM version 4.5 | |
6a488035 | 5 | +--------------------------------------------------------------------+ |
06a1bc01 | 6 | | Copyright CiviCRM LLC (c) 2004-2014 | |
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 | +--------------------------------------------------------------------+ | |
25 | */ | |
26 | ||
6a488035 | 27 | require_once 'CiviTest/CiviSeleniumTestCase.php'; |
e9479dcf EM |
28 | |
29 | /** | |
30 | * Class WebTest_Report_DonarReportTest | |
31 | */ | |
6a488035 TO |
32 | class WebTest_Report_DonarReportTest extends CiviSeleniumTestCase { |
33 | ||
34 | protected function setUp() { | |
35 | parent::setUp(); | |
36 | } | |
37 | ||
38 | function testDonarReportPager() { | |
6a488035 TO |
39 | $this->webtestLogin(); |
40 | ||
41 | // now create new donar detail report instance | |
305515fb | 42 | $this->openCiviPage('report/contribute/detail', 'reset=1', '_qf_Detail_submit'); |
76e86fd8 | 43 | |
6a488035 TO |
44 | // preview result |
45 | $this->click("_qf_Detail_submit"); | |
46 | $this->waitForPageToLoad($this->getTimeoutMsec()); | |
47 | ||
48 | // Create report | |
49 | $this->click("css=div.crm-report_setting-accordion div.crm-accordion-header"); | |
50 | $this->waitForElementPresent("title"); | |
51 | ||
52 | $reportName = 'ContributeDetail_' . substr(sha1(rand()), 0, 7); | |
53 | $reportDescription = "New Contribute Detail Report"; | |
54 | ||
55 | // Fill Report Title | |
56 | $this->type("title", $reportName); | |
57 | ||
58 | // Fill Report Description | |
59 | $this->type("description", $reportDescription); | |
60 | ||
61 | // We want navigation menu | |
62 | $this->click("is_navigation"); | |
63 | $this->waitForElementPresent("parent_id"); | |
64 | ||
65 | // Navigation menu under Reports section | |
66 | $this->select("parent_id", "label=Reports"); | |
67 | ||
68 | // Set permission as access CiviCRM | |
69 | $this->select("permission", "value=access CiviCRM"); | |
70 | ||
71 | // click to create report | |
72 | $this->click("_qf_Detail_submit_save"); | |
73 | $this->waitForPageToLoad($this->getTimeoutMsec()); | |
74 | ||
75 | // Open report list | |
305515fb | 76 | $this->openCiviPage('report/list', 'reset=1'); |
6a488035 TO |
77 | |
78 | // Is report is resent in list? | |
305515fb | 79 | $this->assertElementContainsText('css=div#Contribute > table.report-layout', $reportName); |
6a488035 TO |
80 | |
81 | // Visit report | |
8cc4f1ab | 82 | $this->click("xpath=//div[@id='Contribute']//table/tbody//tr/td/a/strong[text() = '$reportName']"); |
6a488035 TO |
83 | $this->waitForPageToLoad($this->getTimeoutMsec()); |
84 | ||
85 | //now select the criteria | |
86 | //click report criteria accordian | |
87 | $this->click("css=div.crm-report_criteria-accordion div.crm-accordion-header"); | |
88 | ||
89 | //enter contribution amount | |
90 | $this->select('total_amount_op', "value=gte"); | |
91 | $this->type('total_amount_value', "10"); | |
92 | ||
93 | // click preview | |
94 | $this->click("_qf_Detail_submit"); | |
95 | $this->waitForPageToLoad($this->getTimeoutMsec()); | |
96 | ||
97 | //Is greater than or equal to 100 | |
98 | //check for criteria | |
305515fb | 99 | $this->assertElementContainsText('css=table.statistics-table', "Is greater than or equal to 10", "Criteria is not selected"); |
6a488035 TO |
100 | |
101 | //click on next link | |
305515fb | 102 | $this->click("_qf_Detail_submit_save"); |
6a488035 TO |
103 | $this->waitForPageToLoad($this->getTimeoutMsec()); |
104 | ||
105 | // check if criteria still exits | |
305515fb | 106 | $this->assertElementContainsText('css=table.statistics-table', "Is greater than or equal to 10", "Criteria is not selected"); |
6a488035 | 107 | } |
42daf119 | 108 | } |