Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ActionsDataTable_spec.js « specs « UI « tests - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a870b842b887277306ecb3ac71a7685a9b8c8103 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*!
 * Piwik - free/libre analytics platform
 *
 * ActionsDataTable screenshot tests.
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */

describe("ActionsDataTable", function () {
    this.timeout(0);

    var url = "?module=Widgetize&action=iframe&idSite=1&period=year&date=2012-08-09&moduleToWidgetize=Actions&actionToWidgetize=getPageUrls&isFooterExpandedInDashboard=1";

    it("should load correctly", function (done) {
        expect.screenshot('initial').to.be.capture(function (page) {
            page.load(url);
        }, done);
    });

    it("should sort column correctly when column header clicked", function (done) {
        expect.screenshot('column_sorted').to.be.capture(function (page) {
            page.click('th#avg_time_on_page');
        }, done);
    });

    it("should load subtables correctly when row clicked", function (done) {
        expect.screenshot('subtables_loaded').to.be.capture(function (page) {
            page.click('tr.subDataTable:first');
            page.click('tr.subDataTable:eq(2)');
        }, done);
    });

    it("should show configuration options", function (done) {
        expect.screenshot('configuration_options').to.be.captureSelector('.tableConfiguration', function (page) {
            page.click('.dropdownConfigureIcon');
        }, done);
    });

    it("should flatten table when flatten link clicked", function (done) {
        expect.screenshot('flattened').to.be.capture(function (page) {
            page.click('.dataTableFlatten');
        }, done);
    });

    it("should exclude low population rows when exclude low population link clicked", function (done) {
        expect.screenshot('exclude_low_population').to.be.capture(function (page) {
            page.click('.dropdownConfigureIcon');
            page.click('.dataTableExcludeLowPopulation');
        }, done);
    });

    it("should load normal view when switch to view hierarchical view link is clicked", function (done) {
        expect.screenshot('unflattened').to.be.capture(function (page) {
            page.click('.dropdownConfigureIcon span');
            page.click('.dataTableFlatten');
        }, done);
    });

    it("should display pageview percentages when hovering over pageviews column", function (done) {
        expect.screenshot('pageview_percentages').to.be.capture(function (page) {
            page.mouseMove('tr:contains("thankyou") td.column:eq(1)');
        }, done);
    });

    it("should generate a proper title for the visitor log segmented by the current row", function (done) {
        expect.screenshot('segmented_visitor_log_hover').to.be.capture(function (page) {
            var row = 'tr:contains("thankyou") ';
            page.mouseMove(row + 'td.column:first');
            page.mouseMove(row + 'td.label .actionSegmentVisitorLog');
        }, done);
    });

    it("should open the visitor log segmented by the current row", function (done) {
        expect.screenshot('segmented_visitor_log').to.be.capture(function (page) {
            page.click('tr:contains("thankyou") td.label .actionSegmentVisitorLog');
        }, done);
    });

    it("should display unique pageview percentages when hovering over unique pageviews column", function (done) {
        expect.screenshot('unique_pageview_percentages').to.be.capture(function (page) {
            page.click('.ui-widget .ui-dialog-titlebar-close');

            page.mouseMove('tr:contains("thankyou") td.column:eq(2)');
        }, done);
    });

    it("should show the search when clicking on the search icon", function (done) {
        expect.screenshot('search_visible').to.be.capture(function (page) {
            page.click('.dataTableAction.searchAction');
        }, done);
    });

    it("should search through table when search input entered and search button clicked and input should be visible", function (done) {
        expect.screenshot('search').to.be.capture(function (page) {
            page.sendKeys('.searchAction .dataTableSearchInput', 'i');
            page.click('.searchAction .icon-search');
        }, done);
    });

    it("should close search when clicking on the x icon", function (done) {
        expect.screenshot('search_closed').to.be.capture(function (page) {
            page.click('.searchAction .icon-close');
        }, done);
    });

    it("should automatically expand subtables if it contains only one folder", function (done) {
        expect.screenshot('auto_expand').to.be.capture(function (page) {
            page.load(url + '&viewDataTable=table');
            page.click('tr .value:contains("blog")');
            page.click('tr .value:contains("2012")');
        }, done);
    });
});