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

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

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

    var viewDataTableUrl = "?module=Widgetize&action=iframe&moduleToWidgetize=Referrers&idSite=1&period=week&date=2012-02-09&"
                         + "actionToWidgetize=getKeywords&viewDataTable=table&filter_limit=5";

    var ecommerceItemReportWidgetized = "?module=Widgetize&action=iframe&moduleToWidgetize=Goals&actionToWidgetize=getItemsSku&idGoal=ecommerceAbandonedCart"
                                      + "&idSite=1&period=year&date=2012-02-09&viewDataTable=ecommerceAbandonedCart&filter_limit=-1";

    it('should load when icon clicked in ViewDataTable', function (done) {
        expect.screenshot('row_evolution').to.be.captureSelector('.ui-dialog', function (page) {
            page.load(viewDataTableUrl);
            page.mouseMove('tbody tr:first-child');
            page.mouseMove('a.actionRowEvolution:visible'); // necessary to get popover to display
            page.click('a.actionRowEvolution:visible');
        }, done);
    });

    it('should change the metric shown when a metric sparkline row is clicked', function (done) {
        expect.screenshot('row_evolution_other_metric').to.be.captureSelector('.ui-dialog', function (page) {
            page.click('table.metrics tr[data-i=1]');
        }, done);
    });

    it('should show two serieses when a metric sparkline row is shift+clicked', function (done) {
        expect.screenshot('row_evolution_multiple_series').to.be.captureSelector('.ui-dialog', function (page) {
            page.click('table.metrics tr[data-i=2]', ['shift']);
        }, done);
    });

    it('should load multi-row evolution correctly', function (done) {
        expect.screenshot('multirow_evolution').to.be.captureSelector('.ui-dialog', function (page) {
            page.click('.rowevolution-startmulti');
            page.mouseMove('tbody tr:nth-child(2)');
            page.mouseMove('a.actionRowEvolution:visible');
            page.click('a.actionRowEvolution:visible');
        }, done);
    });

    it('should display a different row evolution metric when the metric selection is changed', function (done) {
        expect.screenshot('multirow_evolution_other_metric').to.be.captureSelector('.ui-dialog', function (page) {
            page.evaluate(function () {
                $('select.multirowevoltion-metric').val($('select.multirowevoltion-metric option:nth-child(3)').val()).change();
            });
            page.wait(1000);
        }, done);
    });

    it('should display row evolution for an ecommerce item report correctly', function (done) {
        expect.screenshot('row_evolution_ecommerce_item').to.be.captureSelector('.ui-dialog', function (page) {
            page.load(ecommerceItemReportWidgetized);
            page.mouseMove('tbody tr:first-child');
            page.mouseMove('a.actionRowEvolution:visible'); // necessary to get popover to display
            page.click('a.actionRowEvolution:visible');
        }, done);
    });
});