1
0
قرینه از https://github.com/matomo-org/matomo.git synced 2025-08-22 15:07:44 +00:00
Files
matomo/tests/UI/specs/OnlyRawDataNotification_spec.js
Stefan Giehl 3887e88c61 Display notification about not yet processed data also when visits log is disabled (#22178)
* Adds new API method Live.getMostRecentVisitsDateTime

* Add tests for new API method

* display notification if raw data hasn't been processed yet, but visits log is disabled

* Add test for notification

* use new api method also for no data page

* updates expected test files

* adjust message

* use correct params for api call

* improve/fix tests

* apply review feedback

* pass through all relevant parameters

* apply review feedback

Co-authored-by: Michal Kleiner <michal@innocraft.com>

* apply review feedback

Co-authored-by: Michal Kleiner <michal@innocraft.com>

* add missing doc block

---------

Co-authored-by: Michal Kleiner <michal@innocraft.com>
2024-05-08 18:34:57 +02:00

45 خطوط
1.7 KiB
JavaScript

/*!
* Matomo - free/libre analytics platform
*
* Only Raw Data Notification screenshot tests.
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
describe("OnlyRawDataNotification", function () {
this.fixture = "Piwik\\Tests\\Fixtures\\OneVisit";
const generalParams = 'idSite=1&period=range&date=2021-01-01,today';
const pageUrl = '?module=CoreHome&action=index&' + generalParams;
before(function () {
testEnvironment.testUseMockAuth = 1;
testEnvironment.configOverride.General = {
browser_archiving_disabled_enforce: '1',
enable_browser_archiving_triggering: '0',
};
testEnvironment.optionsOverride = {
enableBrowserTriggerArchiving: '0',
};
testEnvironment.save();
});
it("should show notification when only raw data exists", async function () {
await page.goto(pageUrl);
await page.waitForSelector('.widget');
const notificationContainer = await page.$('#notificationContainer');
expect(await notificationContainer.screenshot()).to.matchImage('show_notification_when_only_raw_data_exists');
});
it("should show notification when only raw data exists and visits log is disabled", async function () {
testEnvironment.overrideConfig('Live', 'disable_visitor_log', 1);
testEnvironment.save();
await page.goto('about:blank');
await page.goto(pageUrl);
await page.waitForSelector('.widget');
const notificationContainer = await page.$('#notificationContainer');
expect(await notificationContainer.screenshot()).to.matchImage('show_notification_when_only_raw_data_exists_no_visits_log');
});
});