قرینه از
https://github.com/matomo-org/matomo.git
synced 2025-08-22 15:07:44 +00:00

* [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>
39 خطوط
1.4 KiB
JavaScript
39 خطوط
1.4 KiB
JavaScript
/*!
|
|
* Matomo - free/libre analytics platform
|
|
*
|
|
* Screenshot tests for the DBStats plugin.
|
|
*
|
|
* @link https://matomo.org
|
|
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
|
*/
|
|
|
|
describe("Diagnostics", function () {
|
|
this.timeout(0);
|
|
|
|
const url = "?module=Installation&action=systemCheckPage&idSite=1&period=day&date=yesterday";
|
|
|
|
it("should load correctly", async function() {
|
|
await page.goto(url);
|
|
|
|
const content = await page.$('#content');
|
|
await page.evaluate((directory) => {
|
|
$('#systemCheckInformational td').each(function () {
|
|
let html = $(this).html();
|
|
html = html.replace(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/g, 'DATETIME');
|
|
html = html.replaceAll(directory, '/path/matomo/');
|
|
html = html.replaceAll(directory.replaceAll('/', '\\/'), '\\/path\\/matomo');
|
|
$(this).html(html);
|
|
});
|
|
// replace varying invalidation counts with 0
|
|
$('#systemCheckInformational td:contains(nvalidation) + td').each(function () {
|
|
let text = $(this).text();
|
|
if (text.match(/^[0-9]+$/)) {
|
|
$(this).html($(this).html().replace(/[0-9]+/, '0'));
|
|
}
|
|
});
|
|
|
|
}, PIWIK_INCLUDE_PATH);
|
|
expect(await content.screenshot()).to.matchImage('page');
|
|
});
|
|
});
|