blob: dd1ab7e3cd84c18637a3887f299a4dc0115c7475 (
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
67
68
69
70
71
72
73
74
75
|
/*!
* Matomo - free/libre analytics platform
*
* Screenshot integration tests.
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
describe("Goals", function () {
this.fixture = 'Piwik\\Tests\\Fixtures\\SomePageGoalVisitsWithConversions';
it('should show the goals overview', async function() {
await page.goto("?module=CoreHome&action=index&idSite=1&period=year&date=2009-01-04#?idSite=1&period=year&date=2009-01-04&category=Goals_Goals&subcategory=General_Overview");
await page.waitForNetworkIdle();
await page.waitForSelector('.dataTableVizGoals');
var report = await page.$('.reporting-page');
expect(await report.screenshot()).to.matchImage('overview');
});
it('should show goals by page', async function() {
await page.evaluate(function(){
$('div.dimensionCategory:nth-child(2) > ul:nth-child(1) > li:nth-child(2)').click();
});
await page.waitForSelector('.dimensionReport');
await page.waitForNetworkIdle();
var report = await page.$('.dimensionReport');
expect(await report.screenshot()).to.matchImage('goals_by_pages');
});
it('should show goals by page titles', async function() {
await page.evaluate(function(){
$('div.dimensionCategory:nth-child(2) > ul:nth-child(1) > li:nth-child(4)').click();
});
await page.waitForSelector('.dimensionReport');
await page.waitForNetworkIdle();
var report = await page.$('.dimensionReport');
expect(await report.screenshot()).to.matchImage('goals_by_page_titles');
});
it('should show goals by entry page', async function() {
await page.evaluate(function(){
$('div.dimensionCategory:nth-child(2) > ul:nth-child(1) > li:nth-child(3)').click();
});
await page.waitForSelector('.dimensionReport');
await page.waitForNetworkIdle();
var report = await page.$('.dimensionReport');
expect(await report.screenshot()).to.matchImage('goals_by_entry_pages');
});
it('should show goals by entry page titles', async function() {
await page.evaluate(function(){
$('.datatableRelatedReports > ul:nth-child(1) > li:nth-child(2) > span:nth-child(1)').click();
});
await page.waitForSelector('.dimensionReport');
await page.waitForNetworkIdle();
var report = await page.$('.dimensionReport');
expect(await report.screenshot()).to.matchImage('goals_by_entry_page_titles');
});
});
|