1
0
قرینه از https://github.com/matomo-org/matomo.git synced 2025-08-22 15:07:44 +00:00
Files
matomo/tests/UI/specs/MeasurableManager_spec.js
Shelby Ludlow 7dc8a5089f Update styling + structure of Create Measurable modal (#23277)
* styling sites management modal and adding types long descriptions

* Update ContentBlock import to import from CoreHome directly

* Update expected XML long description

* Update website expected XML long description

* Update MobileAppMeasurable long description copy

* Tweak lang file formatting

* Update UI tests for modal

* Update screenshot size for Measurable UI tests

* Add full modal screenshot for test

* update submodule

* Display Roll-Up Reporting info conditional on plugin being installed and activated

* Update UI test screenshots

* Update TagManager submodule

* Simplify controller index method rendering

---------

Co-authored-by: Michal Kleiner <michal@innocraft.com>
Co-authored-by: Stefan Giehl <stefan@matomo.org>
2025-05-27 10:50:55 +02:00

60 خطوط
2.2 KiB
JavaScript

/*!
* Matomo - free/libre analytics platform
*
* Site selector screenshot tests.
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
describe("MeasurableManager", function () {
this.fixture = "Piwik\\Plugins\\SitesManager\\tests\\Fixtures\\ManySites";
const url = "?module=SitesManager&action=index&idSite=1&period=day&date=yesterday&showaddsite=false";
before(function () {
testEnvironment.pluginsToLoad = ['MobileAppMeasurable'];
testEnvironment.save();
});
async function assertScreenshotEquals(screenshotName, selector) {
const element = await page.jQuery(selector);
expect(await element.screenshot()).to.matchImage(screenshotName);
}
it("should load correctly and should not use SitesManager wording as another type is enabled", async function () {
await page.goto(url);
await assertScreenshotEquals("loaded", '#content.admin');
});
it("should use measurable wording in menu", async function () {
const element = await page.jQuery('#secondNavBar li:contains(Tracking Code):first');
expect(await element.screenshot()).to.matchImage('measurable_menu_item');
});
// '.sitesManagerList,.sitesButtonBar,.sites-manager-header,.ui-dialog.ui-widget,.modal.open'
it("should show selection of available types when adding a type", async function () {
const element = await page.jQuery('.SitesManager .addSite:first');
await element.click();
await page.waitForSelector('.modal.open');
await page.waitForTimeout(350); // wait for modal animation
await assertScreenshotEquals("add_new_dialog", '.modal.open');
});
it("should load mobile app specific fields", async function () {
const element = await page.jQuery('.modal.open .btn:contains(Mobile App)');
await element.click();
await page.mouse.move(-10, -10);
await page.waitForSelector('input.btn[value=Save]');
await page.waitForNetworkIdle();
await page.evaluate(function () {
$('.form-help:contains(UTC time is)').hide();
});
await page.waitForTimeout(250);
await assertScreenshotEquals("add_measurable_view", '#content.admin');
});
});