File: Events_spec.js

package info (click to toggle)
matomo 5.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 95,068 kB
  • sloc: php: 289,425; xml: 127,249; javascript: 112,130; python: 202; sh: 178; makefile: 20; sql: 10
file content (31 lines) | stat: -rw-r--r-- 1,358 bytes parent folder | download
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
describe("Events", function () {
    var generalParams = 'idSite=1&period=year&date=2012-08-09',
        urlBaseGeneric = 'module=CoreHome&action=index&',
        urlBase = urlBaseGeneric + generalParams;

    it('should load the Events > index page correctly', async function () {
        await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=Events_Events");
        await page.mouse.move(-10, -10);

        expect(await page.screenshotSelector('.pageWrap,.dataTable')).to.matchImage('overview');
    });

    it("should show report flattened", async function() {
        await page.click('.dropdownConfigureIcon');
        await page.mouse.move(-10, -10);
        await page.waitForTimeout(250); // rendering
        await page.click('.dataTableFlatten');
        await page.mouse.move(-10, -10);
        await page.waitForNetworkIdle();

        expect(await page.screenshotSelector('.theWidgetContent')).to.matchImage('flattened');
    });

    it("should show another secondary dimension", async function() {
        await page.evaluate(() => $('.datatableRelatedReports li span:contains("Event Name")').click());
        await page.waitForTimeout(50);
        await page.waitForNetworkIdle();

        expect(await page.screenshotSelector('.theWidgetContent')).to.matchImage('secondary_switched');
    });
});