قرینه از
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>
45 خطوط
1.6 KiB
JavaScript
45 خطوط
1.6 KiB
JavaScript
/*!
|
|
* Matomo - free/libre analytics platform
|
|
*
|
|
* UsersManager screenshot tests.
|
|
*
|
|
* @link https://matomo.org
|
|
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
|
*/
|
|
|
|
describe("ScheduledReports", function () {
|
|
this.timeout(0);
|
|
this.fixture = "Piwik\\Plugins\\ScheduledReports\\tests\\Fixtures\\ReportSubscription";
|
|
|
|
it("should show an error if no token was provided", async function () {
|
|
await page.goto("?module=ScheduledReports&action=unsubscribe&token=");
|
|
|
|
expect(await page.screenshot({ fullPage: true })).to.matchImage('no_token');
|
|
});
|
|
|
|
it("should show an error if token is invalid", async function () {
|
|
await page.goto("?module=ScheduledReports&action=unsubscribe&token=invalidtoken");
|
|
|
|
expect(await page.screenshot({ fullPage: true })).to.matchImage('invalid_token');
|
|
});
|
|
|
|
it("should ask for confirmation before unsubscribing", async function () {
|
|
await page.goto("?module=ScheduledReports&action=unsubscribe&token=mycustomtoken");
|
|
|
|
expect(await page.screenshot({ fullPage: true })).to.matchImage('unsubscribe_form');
|
|
});
|
|
|
|
it("should show success message on submit", async function () {
|
|
await page.click(".submit");
|
|
await page.waitForNetworkIdle();
|
|
|
|
expect(await page.screenshot({ fullPage: true })).to.matchImage('unsubscribe_success');
|
|
});
|
|
|
|
it("token should be invalid on second try", async function () {
|
|
await page.goto("?module=ScheduledReports&action=unsubscribe&token=mycustomtoken");
|
|
|
|
expect(await page.screenshot({ fullPage: true })).to.matchImage('invalid_token');
|
|
});
|
|
});
|