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

FeedbackPopup_spec.js « UI « tests « Feedback « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cdfbbeb36eeee0f07a5bb48cab1f87e91d777793 (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
/*!
 * Matomo - free/libre analytics platform
 *
 * UsersManager screenshot tests.
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */

describe("FeedbackPopup", function () {
    this.timeout(0);
    this.fixture = "Piwik\\Plugins\\Feedback\\tests\\Fixtures\\FeedbackPopupFixture";

    var url = "?module=CoreHome&action=index&idSite=1&period=day&date=2019-07-11&forceFeedbackTest=1";

    before(async function() {
        await page.webpage.setViewport({
            width: 1250,
            height: 768
        });
    });

    it('should display popup when next reminder date is in past', async function () {
        await page.goto(url);
        await page.waitForNetworkIdle();

        var modal = await page.waitForSelector('.modal.open', { visible: true });
        expect(await modal.screenshot()).to.matchImage('feedback_popup');

        // Click on the "Remind me in 90 days" button = the popup shouldn't appear for the next test
        var remindLaterBtn = await modal.$$('.modal-footer .btn-flat');
        await remindLaterBtn[0].click();
        await page.waitForNetworkIdle();
    });

    it('should not display popup when next reminder date is in future', async function () {
        await page.goto(url);
        await page.waitForNetworkIdle();

        // check dashboard is present
        await page.waitForSelector('#dashboardWidgetsArea');

        // check modal isn't opened
        await page.waitForFunction("$('.modal.open').length == 0");
    });
});