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

PivotByDimension_spec.js « specs « UI « tests - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cfe367438ba05f39858746a59385bd27d8e4e839 (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
/*!
 * Piwik - free/libre analytics platform
 *
 * PivotByDimension UI tests
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */

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

    var eventsUrl = "?module=CoreHome&action=index&idSite=1&period=year&date=2012-08-09#?idSite=1&period=year&date=2012-08-09&category=General_Actions&subcategory=Events_Events",
        actionsUrl = "?module=CoreHome&action=index&idSite=1&period=year&date=2012-08-09#?idSite=1&period=year&date=2012-08-09&category=General_Actions&subcategory=General_Pages",
        cvarsUrl = "?module=CoreHome&action=index&idSite=1&period=year&date=2012-08-09#?idSite=1&period=year&date=2012-08-09&category=General_Visitors&subcategory=CustomVariables_CustomVariables"
        ;

    function showDataTableFooter(page)
    {
        page.mouseMove('.dataTableFeatures');
    }

    it("should pivot a report correctly when the pivot cog option is selected", function (done) {
        expect.screenshot('pivoted').to.be.captureSelector('.dataTable,.expandDataTableFooterDrawer', function (page) {
            page.load(eventsUrl);
            page.click('.dimension:contains(Event Names)');
            showDataTableFooter(page);
            page.click('.dropdownConfigureIcon');
            page.click('.dataTablePivotBySubtable');
            page.mouseMove({x: -15, y: -15}); // make sure nothing is highlighted
        }, done);
    });

    it("should not display the pivot option on actions reports", function (done) {
        expect.page(actionsUrl).not.contains('.dataTablePivotBySubtable', function () {}, done);
    });

    it("should display the pivot option on reports that set a custom columns_to_display", function (done) {
        expect.screenshot('pivoted_columns_report').to.be.captureSelector('.dataTable,.expandDataTableFooterDrawer', function (page) {
            page.load(cvarsUrl);
            showDataTableFooter(page);
            page.click('.dropdownConfigureIcon');
            page.click('.dataTablePivotBySubtable');
            page.mouseMove({x: -15, y: -15}); // make sure nothing is highlighted
        }, done);
    });
});