1
0
قرینه از https://github.com/matomo-org/matomo.git synced 2025-08-22 23:17:46 +00:00
Files
matomo/tests/UI/specs/IncompletePeriodVisualisation_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

38 خطوط
1.4 KiB
JavaScript

/*!
* Matomo - free/libre analytics platform
*
* Incomplete Period Visualisation Test
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
describe('IncompletePeriodVisualisation', function () {
this.fixture = 'Piwik\\Tests\\Fixtures\\SomeVisitsLastYearAndThisYear';
const generalParams = 'idSite=1&period=year&date=today';
const pageUrl = '?module=CoreHome&action=index&' + generalParams;
it('should load visitors > overview page and show incomplete period', async function () {
await page.goto(pageUrl + generalParams + '&segment=&category=General_Visitors&subcategory=General_Overview#?idSite=1&period=year&date=today&segment=&category=General_Visitors&subcategory=General_Overview');
await page.waitForNetworkIdle();
const pageWrap = await page.$('.pageWrap');
expect(await pageWrap.screenshot()).to.matchImage('visitors_overview');
});
it('tooltip for incomplete period should say "incomplete period"', async function () {
const graph = await page.$('.piwik-graph');
const boundingBox = await graph.boundingBox();
await page.mouse.move(
boundingBox.x + boundingBox.width - 50,
boundingBox.y + boundingBox.height - 50
);
const tooltipContent = await page.evaluate(() => $('.ui-tooltip').text().trim());
expect(tooltipContent).to.contain('Incomplete Period');
});
});