Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*!
* Piwik - free/libre analytics platform
*
* ImageGraph plugin screenshot tests.
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
describe("ImageGraph", function () {
this.timeout(0);
function getImageGraphUrl(apiModule, apiAction, graphType, period, date) {
return "index.php?module=API&method=ImageGraph.get&idSite=1&width=500&height=250&apiModule=" + apiModule + "&apiAction=" + apiAction
+ "&graphType=" + graphType + "&period=" + period + "&date=" + date;
}
it("should render evolution graphs correctly", function (done) {
expect.screenshot('evolution_graph').to.be.capture(function (page) {
page.load(getImageGraphUrl('VisitsSummary', 'get', 'evolution', 'month', '2011-06-01,2012-06-01'));
}, done);
});
it("should render horizontal bar graphs correctly", function (done) {
expect.screenshot('horizontal_bar').to.be.capture(function (page) {
page.load(getImageGraphUrl('DevicesDetection', 'getBrowsers', 'horizontalBar', 'year', '2012-01-01'));
}, done);
});
it("should render vertical bar graphs correctly", function (done) {
expect.screenshot('vertical_bar').to.be.capture(function (page) {
page.load(getImageGraphUrl('UserCountry', 'getCountry', 'verticalBar', 'year', '2012-01-01'));
}, done);
});
it("should render pie graphs correctly", function (done) {
expect.screenshot('pie').to.be.capture(function (page) {
page.load(getImageGraphUrl('DevicesDetection', 'getOsVersions', 'pie', 'year', '2012-01-01'));
}, done);
});
});