1
0
قرینه از https://github.com/matomo-org/matomo.git synced 2025-08-22 15:07:44 +00:00
Files
matomo/plugins/ImageGraph/tests/UI/ImageGraph_spec.js
Michal Kleiner 9a3ef94df6 [Coding Style] Enable rule PSR12.Files.FileHeader + unify file headers (#22132)
* [Coding Style] Enable rule PSR12.Files.FileHeader

* Apply CS

* Replace Piwik with Matomo in file headers

* Unify file headers (position, no. of lines, https links)

* Rebuild dist files

* Apply CS

* Fix system test that relies on line numbers in a file that had the file header updated

---------

Co-authored-by: Stefan Giehl <stefan@matomo.org>
2024-04-20 20:50:47 +02:00

53 خطوط
2.1 KiB
JavaScript

/*!
* Matomo - free/libre analytics platform
*
* ImageGraph plugin screenshot tests.
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
describe("ImageGraph", function () {
this.timeout(0);
before(function () {
testEnvironment.multiplicateTableResults = 169856;
testEnvironment.save();
});
function getImageGraphUrl(apiModule, apiAction, graphType, period, date) {
return "index.php?module=API&method=ImageGraph.get&idSite=1&width=500&height=250&apiModule=" + apiModule + "&apiAction=" + apiAction
+ "&graphType=" + graphType + "&period=" + period + "&date=" + date;
}
it("should render evolution graphs correctly", async function() {
await page.goto(getImageGraphUrl('VisitsSummary', 'get', 'evolution', 'month', '2011-06-01,2012-06-01'));
expect(await page.screenshot({ fullPage: true })).to.matchImage('evolution_graph');
});
it("should render evolution graphs correctly for week dates", async function() {
await page.goto(getImageGraphUrl('VisitsSummary', 'get', 'evolution', 'week', '2011-06-01,2012-06-01'));
expect(await page.screenshot({ fullPage: true })).to.matchImage('evolution_graph_week');
});
it("should render horizontal bar graphs correctly", async function() {
await page.goto(getImageGraphUrl('DevicesDetection', 'getBrowsers', 'horizontalBar', 'year', '2012-01-01'));
expect(await page.screenshot({ fullPage: true })).to.matchImage('horizontal_bar');
});
it("should render vertical bar graphs correctly", async function() {
await page.goto(getImageGraphUrl('UserCountry', 'getCountry', 'verticalBar', 'year', '2012-01-01'));
expect(await page.screenshot({ fullPage: true })).to.matchImage('vertical_bar');
});
it("should render pie graphs correctly", async function() {
await page.goto(getImageGraphUrl('DevicesDetection', 'getOsVersions', 'pie', 'year', '2012-01-01'));
expect(await page.screenshot({ fullPage: true })).to.matchImage('pie');
});
});