Skip to content
Extraits de code Groupes Projets
PivotByDimension_spec.js 1,92 ko
Newer Older
  • Learn to ignore specific revisions
  • /*!
     * 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"
    
            ;
    
        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)');
                page.click('.expandDataTableFooterDrawer');
                page.mouseMove('.tableConfiguration');
                page.click('.dataTablePivotBySubtable');
            }, 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);
                page.click('.expandDataTableFooterDrawer');
                page.mouseMove('.tableConfiguration');
                page.click('.dataTablePivotBySubtable');
            }, done);
        });
    });