blob: 3101a1b1d0c22e9d72e9d32c13a44fd6b92c2daa (
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
|
/*!
* Piwik - free/libre analytics platform
*
* JS tracker UI tests.
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
describe("JSTracker", function () {
this.fixture = 'Piwik\\Tests\\Fixtures\\JSTrackingUIFixture';
var testWebsiteUrl = 'tests/resources/overlay-test-site-real/index.html';
var generalParams = 'idSite=1&period=day&date=today',
widgetizeParams = "module=Widgetize&action=iframe",
visitorLogUrl = "?" + widgetizeParams + "&" + generalParams + "&moduleToWidgetize=Live&actionToWidgetize=getVisitorLog";
it("run correctly on a website and correctly track visits in the visitor log", async function () {
await page.goto(testWebsiteUrl);
// view another page
await page.evaluate(() => $('a:contains(Page 3)')[0].click());
await page.waitForNetworkIdle();
await page.waitFor(500);
await page.waitForNetworkIdle();
// visit visitor log for correct date
await page.goto(visitorLogUrl);
await page.evaluate(function () {
$('.visitor-log-datetime').html('REMOVED');
var $e = $('.dataTableWrapper>.row>.column>strong');
$e.text($e.text().replace(/\d+s/, 'Ns'));
});
expect(await page.screenshot({ fullPage: true })).to.matchImage('visitor_log');
});
});
|