diff --git a/plugins/Login/tests/UI/Login_spec.js b/plugins/Login/tests/UI/Login_spec.js
index 76fd74bdf5d..27b8e0de0c9 100644
--- a/plugins/Login/tests/UI/Login_spec.js
+++ b/plugins/Login/tests/UI/Login_spec.js
@@ -19,8 +19,6 @@ describe("Login", function () {
testEnvironment.testUseMockAuth = 0;
testEnvironment.queryParamOverride = {date: "2012-01-01", period: "year"};
testEnvironment.save();
-
- await page.clearCookies();
});
beforeEach(function () {
@@ -37,8 +35,6 @@ describe("Login", function () {
delete testEnvironment.queryParamOverride;
delete testEnvironment.configOverride.General;
testEnvironment.save();
-
- await page.clearCookies();
});
afterEach(function () {
diff --git a/plugins/Login/tests/UI/NoAccess_spec.js b/plugins/Login/tests/UI/NoAccess_spec.js
index b047e9a4234..8b8a715e772 100644
--- a/plugins/Login/tests/UI/NoAccess_spec.js
+++ b/plugins/Login/tests/UI/NoAccess_spec.js
@@ -14,19 +14,14 @@ describe("NoAccess", function () {
testEnvironment.testUseMockAuth = 0;
testEnvironment.overrideConfig('General', 'login_session_not_remembered_idle_timeout', 1)
testEnvironment.save();
-
- await page.clearCookies();
});
after(async function () {
testEnvironment.testUseMockAuth = 1;
testEnvironment.save();
-
- await page.clearCookies();
});
it("should login successfully with user credentials and show error when a site without access is viewed", async function() {
- await page.clearCookies();
await page.goto("?idSite=2");
await page.waitForNetworkIdle();
await page.type("#login_form_login", "oliverqueen");
diff --git a/plugins/Morpheus/Controller.php b/plugins/Morpheus/Controller.php
index 05eb04461d5..837d1be4767 100644
--- a/plugins/Morpheus/Controller.php
+++ b/plugins/Morpheus/Controller.php
@@ -22,6 +22,7 @@ public function demo()
$snippets = [];
+ // @phpcs:disable Generic.Files.LineLength
$snippets[] = [
'id' => 'ActivityIndicator',
'title' => 'Loading indicator',
@@ -864,6 +865,7 @@ public function demo()
'plugin'
],
];
+ // @phpcs:enable Generic.Files.LineLength
return $this->renderTemplate('demo', [
'snippets' => $snippets,
diff --git a/plugins/MultiSites/API.php b/plugins/MultiSites/API.php
index 2734474019f..1563c2baab8 100644
--- a/plugins/MultiSites/API.php
+++ b/plugins/MultiSites/API.php
@@ -91,18 +91,33 @@ public function getAll($period, $date, $segment = false, $_restrictSitesToLogin
{
Piwik::checkUserHasSomeViewAccess();
- $sites = $this->getSitesIdFromPattern($pattern, $_restrictSitesToLogin);
+ $idSites = $this->getSitesIdFromPattern($pattern, $_restrictSitesToLogin);
+
+ /**
+ * This event can be used to manipulate the sites being displayed on all websites dashboard.
+ *
+ * **Example**
+ *
+ * Piwik::addAction('MultiSites.filterSites', function (&$idSites) {
+ * $idSites = array_filter($idSites, function($idSite) {
+ * return $idSite !== 1
+ * });
+ * });
+ *
+ * @param array &$idSites List of idSites that the current user would be allowed to see in all websites dashboard.
+ */
+ Piwik::postEvent('MultiSites.filterSites', [&$idSites]);
if (!empty($showColumns) && !is_array($showColumns)) {
$showColumns = explode(',', $showColumns);
}
- if (empty($sites)) {
+ if (empty($idSites)) {
return new DataTable();
}
return $this->buildDataTable(
- $sites,
+ $idSites,
$period,
$date,
$segment,
@@ -159,8 +174,12 @@ private function getSitesIdFromPattern($pattern, $_restrictSitesToLogin)
// Both calls above have called Site::setSitesFromArray. We now get these sites:
$sitesToProblablyAdd = Site::getSites();
+ $idSites = [];
+ foreach ($sitesToProblablyAdd as $site) {
+ $idSites[] = $site['idsite'];
+ }
- return $sitesToProblablyAdd;
+ return $idSites;
}
/**
@@ -180,10 +199,14 @@ public function getOne($idSite, $period, $date, $segment = false, $_restrictSite
{
Piwik::checkUserHasViewAccess($idSite);
- $sites = $this->getSiteFromId($idSite);
+ $site = $this->getSiteFromId($idSite);
+
+ if (empty($site)) {
+ return new DataTable();
+ }
return $this->buildDataTable(
- $sites,
+ [$idSite],
$period,
$date,
$segment,
@@ -233,20 +256,11 @@ public function getAllWithGroups($period = null, $date = null, $segment = false,
private function getSiteFromId($idSite)
{
$idSite = (int) $idSite;
- $sites = array(APISitesManager::getInstance()->getSiteFromId($idSite));
-
- return $sites;
+ return APISitesManager::getInstance()->getSiteFromId($idSite);
}
- private function buildDataTable($sitesToProblablyAdd, $period, $date, $segment, $_restrictSitesToLogin, $enhanced, $multipleWebsitesRequested, $showColumns)
+ private function buildDataTable($idSites, $period, $date, $segment, $_restrictSitesToLogin, $enhanced, $multipleWebsitesRequested, $showColumns)
{
- $idSites = array();
- if (!empty($sitesToProblablyAdd)) {
- foreach ($sitesToProblablyAdd as $site) {
- $idSites[] = $site['idsite'];
- }
- }
-
// build the archive type used to query archive data
$archive = Archive::build(
$idSites,
diff --git a/plugins/MultiSites/tests/System/ApiTest.php b/plugins/MultiSites/tests/System/ApiTest.php
index 2572226bc15..09fd8fddf4f 100644
--- a/plugins/MultiSites/tests/System/ApiTest.php
+++ b/plugins/MultiSites/tests/System/ApiTest.php
@@ -9,6 +9,7 @@
namespace Piwik\Plugins\MultiSites\tests\System;
+use Piwik\Piwik;
use Piwik\Plugins\MultiSites\tests\Fixtures\ManySitesWithVisits;
use Piwik\Tests\Framework\TestCase\SystemTestCase;
@@ -95,6 +96,22 @@ public function getApiForTesting()
];
}
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApiFiltered($api, $params)
+ {
+ $params['testSuffix'] .= '_filtered';
+
+ Piwik::addAction('MultiSites.filterSites', function (&$idSites) {
+ $idSites = array_filter($idSites, function ($idSite) {
+ return $idSite != 2 && $idSite != 10;
+ });
+ });
+
+ $this->runApiTests($api, $params);
+ }
+
public static function getOutputPrefix()
{
return '';
diff --git a/plugins/MultiSites/tests/System/expected/test__filtered__MultiSites.getAllWithGroups_day.xml b/plugins/MultiSites/tests/System/expected/test__filtered__MultiSites.getAllWithGroups_day.xml
new file mode 100644
index 00000000000..36ff3cab54d
--- /dev/null
+++ b/plugins/MultiSites/tests/System/expected/test__filtered__MultiSites.getAllWithGroups_day.xml
@@ -0,0 +1,508 @@
+
+
+ 13
+
+ 6
+ 4
+ 10
+ 2,541
+ 0
+
+ 2013-01-22
+
+
+
+ 2
+ 4
+ 3
+ $2,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13
+ 1
+ $
+ 0
+ day
+ Tue, Jan 22
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+ http://piwik.net
+
+
+
+ 0
+ 0
+ 0
+ $0
+ 0
+ 0
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 14
+ 1
+ $
+ 0
+ day
+ Tue, Jan 22
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+ http://piwik.net
+
+
+
+ 0
+ 0
+ 0
+ $0
+ 0
+ 0
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 15
+ 1
+ $
+ 0
+ day
+ Tue, Jan 22
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+ http://piwik.net
+
+
+
\ No newline at end of file
diff --git a/plugins/MultiSites/tests/System/expected/test_limitedWithOffset_filtered__MultiSites.getAllWithGroups_day.xml b/plugins/MultiSites/tests/System/expected/test_limitedWithOffset_filtered__MultiSites.getAllWithGroups_day.xml
new file mode 100644
index 00000000000..1fccc5db64b
--- /dev/null
+++ b/plugins/MultiSites/tests/System/expected/test_limitedWithOffset_filtered__MultiSites.getAllWithGroups_day.xml
@@ -0,0 +1,204 @@
+
+
+ 13
+
+ 6
+ 4
+ 10
+ 2,541
+ 0
+
+ 2013-01-22
+
+
+
+ 0
+ 0
+ 0
+ $0
+ 0
+ 0
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 6
+ 1
+ $
+ 0
+ day
+ Tue, Jan 22
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+ http://piwik.net
+
+
+
+ 0
+ 0
+ 0
+ $0
+ 0
+ 0
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 7
+ 1
+ $
+ 0
+ day
+ Tue, Jan 22
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+ http://piwik.net
+
+
+
+ 0
+ 0
+ 0
+ $0
+ 0
+ 0
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 8
+ 1
+ $
+ 0
+ day
+ Tue, Jan 22
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+ http://piwik.net
+
+
+
+ 0
+ 0
+ 0
+ $0
+ 0
+ 0
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 9
+ 1
+ $
+ 0
+ day
+ Tue, Jan 22
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+ http://piwik.net
+
+
+
+ 0
+ 0
+ 0
+ $0
+ 0
+ 0
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 11
+ 1
+ $
+ 0
+ day
+ Tue, Jan 22
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+ http://piwik.net
+
+
+
\ No newline at end of file
diff --git a/plugins/MultiSites/tests/System/expected/test_limitedWithPattern_filtered__MultiSites.getAllWithGroups_day.xml b/plugins/MultiSites/tests/System/expected/test_limitedWithPattern_filtered__MultiSites.getAllWithGroups_day.xml
new file mode 100644
index 00000000000..264436d1437
--- /dev/null
+++ b/plugins/MultiSites/tests/System/expected/test_limitedWithPattern_filtered__MultiSites.getAllWithGroups_day.xml
@@ -0,0 +1,204 @@
+
+
+ 6
+
+ 6
+ 4
+ 10
+ 2,541
+ 0
+
+ 2013-01-22
+
+
+
+ 2
+ 4
+ 3
+ $2,541
+ 1
+ 1
+ 2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
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 0%
+ 0
+ 6
+ 1
+ $
+ 0
+ day
+ Tue, Jan 22
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+ http://piwik.net
+
+
+
\ No newline at end of file
diff --git a/plugins/MultiSites/tests/System/expected/test_multiplePeriods_filtered__MultiSites.getAllWithGroups_day.xml b/plugins/MultiSites/tests/System/expected/test_multiplePeriods_filtered__MultiSites.getAllWithGroups_day.xml
new file mode 100644
index 00000000000..f76ae70b1cc
--- /dev/null
+++ b/plugins/MultiSites/tests/System/expected/test_multiplePeriods_filtered__MultiSites.getAllWithGroups_day.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/plugins/PrivacyManager/Commands/AnonymizeRawData.php b/plugins/PrivacyManager/Commands/AnonymizeRawData.php
index d9368847a17..92abb9f02c9 100644
--- a/plugins/PrivacyManager/Commands/AnonymizeRawData.php
+++ b/plugins/PrivacyManager/Commands/AnonymizeRawData.php
@@ -22,7 +22,12 @@ protected function configure()
$defaultDate = '1996-01-01,' . Date::now()->toString();
$this->setName('privacymanager:anonymize-some-raw-data');
- $this->setDescription('Anonymize some of the stored raw data (logs). The reason it only anonymizes "some" data is that personal data can be present in many various data collection points, for example some of your page URLs or page titles may include personal data and these will not be anonymized by this command as it is not possible to detect personal data for example in a URL automatically.');
+ $this->setDescription(
+ 'Anonymize some of the stored raw data (logs). The reason it only anonymizes "some" data is that ' .
+ 'personal data can be present in many various data collection points, for example some of your page URLs ' .
+ 'or page titles may include personal data and these will not be anonymized by this command as it is not ' .
+ 'possible to detect personal data for example in a URL automatically.'
+ );
$this->addRequiredValueOption('date', null, 'Date or date range to invalidate raw data for (UTC). Either a date like "2015-01-03" or a range like "2015-01-05,2015-02-12". By default, all data including today will be anonymized.', $defaultDate);
$this->addRequiredValueOption('unset-visit-columns', null, 'Comma separated list of log_visit columns that you want to unset. Each value for that column will be set to its default value. If the same column exists in "log_conversion" table as well, the column will be unset there as well. This action cannot be undone.', '');
$this->addRequiredValueOption('unset-link-visit-action-columns', null, 'Comma separated list of log_link_visit_action columns that you want to unset. Each value for that column will be set to its default value. This action cannot be undone.', '');
diff --git a/plugins/ProfessionalServices/lang/fr.json b/plugins/ProfessionalServices/lang/fr.json
index 9fb9597f6b2..271ba7a3ba5 100644
--- a/plugins/ProfessionalServices/lang/fr.json
+++ b/plugins/ProfessionalServices/lang/fr.json
@@ -4,6 +4,7 @@
"PromoFunnels": "Entonnoirs",
"PromoHeatmaps": "Cartes de chaleur",
"PromoManage": "Gérer",
+ "PromoMediaAnalytics": "Média",
"PromoOverview": "Aperçu",
"WidgetPremiumServicesForPiwik": "Fonctionnalités Premium & Services pour Matomo"
}
diff --git a/plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js b/plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js
index 3e7ff270250..6cff1d92e43 100644
--- a/plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js
+++ b/plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js
@@ -18,7 +18,14 @@ describe("SegmentSelectorEditorTest", function () {
async function selectFieldValue(fieldName, textToSelect)
{
await (await page.jQuery(fieldName + ' input.select-dropdown', { waitFor: true })).click();
+
+ // wait for animation
+ await page.waitForTimeout(200);
+
await (await page.jQuery(fieldName + ' .dropdown-content li:contains("' + textToSelect + '"):first', { waitFor: true })).click();
+
+ // wait for animation
+ await page.waitForTimeout(300);
await page.mouse.move(-10, -10);
}
@@ -150,7 +157,7 @@ describe("SegmentSelectorEditorTest", function () {
expect(await page.screenshotSelector(selectorsToCapture)).to.matchImage('saved_details');
});
- it("should correctly should show a confirmation when changing segment definition", async function() {
+ it("should correctly show a confirmation when changing segment definition", async function() {
await page.click('.segmentEditorPanel .editSegmentName');
await page.$eval('.segmentEditorPanel .segmentRow0 .ui-autocomplete-input', e => e.blur());
diff --git a/plugins/Tour/lang/fr.json b/plugins/Tour/lang/fr.json
index edc31a72929..fe800236942 100644
--- a/plugins/Tour/lang/fr.json
+++ b/plugins/Tour/lang/fr.json
@@ -1,6 +1,7 @@
{
"Tour": {
"AddAnnotation": "Ajouter une annotation",
+ "AddAnotherWebsite": "Ajouter un autre site web",
"AddReport": "Ajouter un rapport planifié",
"AddSegment": "Ajouter un segment",
"BecomeMatomoExpert": "Devenir un expert Matomo",
@@ -21,6 +22,7 @@
"Engagement": "Engagement",
"FlattenActions": "Aplatir un rapport de page",
"FlattenActionsDescription": "Accédez à Comportement → Pages et cliquez sur l'icône en forme de rouage en bas du rapport pour l'aplatir. Cela modifie la hiérarchie d'un rapport groupé à une liste.",
+ "InviteUser": "Inviter un utilisateur",
"MatomoBeginner": "Matomo débutant",
"MatomoExpert": "Expert Matomo",
"MatomoIntermediate": "Matomo intermédiaire",
diff --git a/plugins/TrackingSpamPrevention b/plugins/TrackingSpamPrevention
index 09d8ecfcd30..4b5cd51f8c4 160000
--- a/plugins/TrackingSpamPrevention
+++ b/plugins/TrackingSpamPrevention
@@ -1 +1 @@
-Subproject commit 09d8ecfcd30dda213a2feaa1400d7abe562bffbd
+Subproject commit 4b5cd51f8c47a7a79ab9b9492cdfbecfba90311c
diff --git a/plugins/Transitions/tests/UI/Transitions_spec.js b/plugins/Transitions/tests/UI/Transitions_spec.js
index 81840847a83..1b2e2170d2f 100644
--- a/plugins/Transitions/tests/UI/Transitions_spec.js
+++ b/plugins/Transitions/tests/UI/Transitions_spec.js
@@ -42,14 +42,13 @@ describe("Transitions", function () {
await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=General_Pages&"
+ "popover=RowAction$3ATransitions$3Aurl$3Ahttp$3A$2F$2Fpiwik.net$2Fdocs$2Fmanage-websites$2F");
await page.waitForNetworkIdle();
- await page.waitForTimeout(500);
- // for some reason the tooltip isn't shown on the screenshot (even if the whole page is taken)
- // but it seems to be placed in the HTML code so, we check for it's contents
await (await page.$('.Transitions_CurveTextRight')).hover();
- await page.waitForSelector('.ui-tooltip');
- const toolTipHtml = await page.evaluate(() => $('.ui-tooltip:visible').html());
- expect(toolTipHtml).to.equal('
4 (out of 4) to internal pages
');
+ await page.waitForSelector('.ui-tooltip', { visible: true });
+
+ // the tooltip will, in most cases, not be visible in the screenshot
+ // removing and re-adding a clone to the DOM seems to fix that problem
+ await page.evaluate(() => $('.ui-dialog').append($('.ui-tooltip').remove().clone()));
expect(await page.screenshotSelector('.ui-dialog')).to.matchImage('transitions_popup_urls');
});
diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_popup_urls.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_popup_urls.png
index d7df2d2c619..9e6b4caa6a7 100644
--- a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_popup_urls.png
+++ b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_popup_urls.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:b4d2628c87a41c8a24566e70f8710ee94bc1f7036851d298ab4f468706299d92
-size 78803
+oid sha256:038c3a55d2c687a2dc54b968f54d876caad7c55a221f453331e60bf9f6161343
+size 80811
diff --git a/plugins/UserCountryMap/tests/UI/VisitorMap_spec.js b/plugins/UserCountryMap/tests/UI/VisitorMap_spec.js
index abb08c250cd..144c2d60af4 100644
--- a/plugins/UserCountryMap/tests/UI/VisitorMap_spec.js
+++ b/plugins/UserCountryMap/tests/UI/VisitorMap_spec.js
@@ -12,7 +12,7 @@ describe("VisitorMap", function () {
var url = "?module=Widgetize&action=iframe&moduleToWidgetize=UserCountryMap&idSite=1&period=year&date=2012-08-09&"
+ "actionToWidgetize=visitorMap&viewDataTable=table&filter_limit=5&isFooterExpandedInDashboard=1",
- urlWithCities = "?module=Widgetize&action=iframe&moduleToWidgetize=UserCountryMap&idSite=3&period=week&date=yesterday&"
+ urlWithCities = "?module=Widgetize&action=iframe&moduleToWidgetize=UserCountryMap&idSite=3&period=day&date=yesterday&"
+ "actionToWidgetize=visitorMap&viewDataTable=table&filter_limit=5&isFooterExpandedInDashboard=1";
it("should display the bounce rate metric correctly", async function() {
diff --git a/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_cities.png b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_cities.png
index 12febce0820..11621672c9c 100644
--- a/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_cities.png
+++ b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_cities.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e78608cb6511fe12c4671ac036d74b87f8557be14edf0601661d6015b7275d9d
-size 112487
+oid sha256:8ea3d772f63e11a59c1ac5ff7d0de0dc0054780ae880d1f7ee7916ce9f6a9dd6
+size 113888
diff --git a/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_regions.png b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_regions.png
index 04ec10633bc..5e2e93ec684 100644
--- a/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_regions.png
+++ b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_regions.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:6e5ee739257dd15445f529c9c13dfcfe5e6ab6bb92df5b9a3adbb4bae4fa75a6
-size 111261
+oid sha256:816ba48277bca270848ef2e66b466d7847e8f42a9b03370099bbf25cc293d32d
+size 112665
diff --git a/tests/PHPUnit/Framework/Mock/TestConfig.php b/tests/PHPUnit/Framework/Mock/TestConfig.php
index 59c31127222..17fef243719 100644
--- a/tests/PHPUnit/Framework/Mock/TestConfig.php
+++ b/tests/PHPUnit/Framework/Mock/TestConfig.php
@@ -11,12 +11,25 @@
use Piwik\Application\Kernel\GlobalSettingsProvider;
use Piwik\Config;
+use Piwik\Plugin\Manager;
use Piwik\Tests\Framework\TestingEnvironmentVariables;
class TestConfig extends Config
{
- private $allowSave = false;
- private $doSetTestEnvironment = false;
+ /**
+ * @var bool
+ */
+ private $allowSave;
+
+ /**
+ * @var bool
+ */
+ private $doSetTestEnvironment;
+
+ /**
+ * @var TestingEnvironmentVariables
+ */
+ private $testingEnvironment;
public function __construct(GlobalSettingsProvider $provider, TestingEnvironmentVariables $testingEnvironment, $allowSave = false, $doSetTestEnvironment = true)
{
@@ -24,6 +37,7 @@ public function __construct(GlobalSettingsProvider $provider, TestingEnvironment
$this->allowSave = $allowSave;
$this->doSetTestEnvironment = $doSetTestEnvironment;
+ $this->testingEnvironment = $testingEnvironment;
$this->reload();
@@ -42,6 +56,24 @@ public function forceSave()
if ($this->allowSave) {
parent::forceSave();
}
+
+ if (!$this->doSetTestEnvironment) {
+ return;
+ }
+
+ $environmentPlugins = $this->testingEnvironment->configOverride['PluginsInstalled']['PluginsInstalled'] ?? [];
+ $installedPlugins = Manager::getInstance()->getInstalledPluginsName();
+
+ $onlyEnvironment = array_diff($environmentPlugins, $installedPlugins);
+ $onlyInstalled = array_diff($installedPlugins, $environmentPlugins);
+
+ if ([] === $onlyEnvironment && [] === $onlyInstalled) {
+ // environment matches list of installed plugins
+ return;
+ }
+
+ $this->testingEnvironment->overrideConfig('PluginsInstalled', 'PluginsInstalled', $installedPlugins);
+ $this->testingEnvironment->save();
}
public function setTestEnvironment()
diff --git a/tests/UI/config.dist.js b/tests/UI/config.dist.js
index 746f2e2dbd0..bab41ad0bb6 100644
--- a/tests/UI/config.dist.js
+++ b/tests/UI/config.dist.js
@@ -40,7 +40,7 @@ exports.chai = 'chai-1.9.0';
/**
* Mocha reporters to use (can be multiple delimited by a comma).
*/
-if (process.env.TESTOMATIO) {
+if (process.env.TESTOMATIO && process.env.SHOULD_SEND_TO_TESTOMATIO === 'true') {
exports.reporter = 'mocha-multi-reporters';
exports.reporterOptions = {
reporterEnabled: 'spec, @testomatio/reporter/lib/adapter/mocha.js',
diff --git a/tests/UI/expected-screenshots/Comparison_goals_table.png b/tests/UI/expected-screenshots/Comparison_goals_table.png
index 33755831d57..a9e7d3c0c0e 100644
--- a/tests/UI/expected-screenshots/Comparison_goals_table.png
+++ b/tests/UI/expected-screenshots/Comparison_goals_table.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:c2dba1e4c53a574a256f8d8b16451a1e8b25b06f9ad8960ede2f74d4aeed6c51
-size 158863
+oid sha256:986ef94bb2d34b64ffd16759f1a30a5a77088d1b5a18c277c64c5825abe9038c
+size 153252
diff --git a/tests/UI/expected-screenshots/QuickAccess_search_1.png b/tests/UI/expected-screenshots/QuickAccess_search_1.png
index 33d303fe9d9..e1a37bdd2ee 100644
--- a/tests/UI/expected-screenshots/QuickAccess_search_1.png
+++ b/tests/UI/expected-screenshots/QuickAccess_search_1.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:86e59e5c164b59b6f2c1e088879dc3673fa148faeb50bebf72ebaa221a6df621
-size 96666
+oid sha256:3d7c1869cb6b944f78431c2a37948d17ee24af6afb2025b709c69c1609c8ea8b
+size 96975
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png b/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png
index 2cbbcae7153..2ef76402131 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:52843b299537c1334aa42ce4a549d43280004c18aee16a105b0869c2bb9ab5b9
-size 4935154
+oid sha256:ecff30e1cf793356317a9f40c100f003411e09edf53c4f54ececc6e9cdd00923
+size 4937549
diff --git a/tests/UI/expected-screenshots/ViewDataTableTest_5_goals.png b/tests/UI/expected-screenshots/ViewDataTableTest_5_goals.png
index d9fa09f83ff..3118e65e3b6 100644
--- a/tests/UI/expected-screenshots/ViewDataTableTest_5_goals.png
+++ b/tests/UI/expected-screenshots/ViewDataTableTest_5_goals.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:0f6baac0444a0f3d3ba78d6174ebb3e1d28dcb5577d43102c03f48d00d7a7658
-size 78237
+oid sha256:631d317dd58fc1d2dd4dc262798d4d546e5148b6cc2d44c61f046820e53c8039
+size 73676
diff --git a/tests/UI/specs/OptOutIframe_spec.js b/tests/UI/specs/OptOutIframe_spec.js
index abcbb20c5d4..495deba636b 100644
--- a/tests/UI/specs/OptOutIframe_spec.js
+++ b/tests/UI/specs/OptOutIframe_spec.js
@@ -21,9 +21,6 @@ describe("OptOutIframe", function () {
});
}
- after(async () => {
- await page.clearCookies();
- });
after(async () => {
await page.setUserAgent(page.originalUserAgent);
});
diff --git a/tests/UI/specs/OptOutJS_spec.js b/tests/UI/specs/OptOutJS_spec.js
index 7a71053f231..154c356eadb 100644
--- a/tests/UI/specs/OptOutJS_spec.js
+++ b/tests/UI/specs/OptOutJS_spec.js
@@ -12,10 +12,6 @@ describe('OptOutJS', function () {
const siteUrl = '/tests/resources/overlay-test-site-real/opt-out.php?implementation=js';
- after(async () => {
- await page.clearCookies();
- });
-
async function expectHasConsentToBe(useTracker, expectedState) {
let hasConsent;
diff --git a/tests/lib/screenshot-testing/run-tests.js b/tests/lib/screenshot-testing/run-tests.js
index 50423ea27bf..03ad2332d09 100644
--- a/tests/lib/screenshot-testing/run-tests.js
+++ b/tests/lib/screenshot-testing/run-tests.js
@@ -29,17 +29,14 @@ async function main() {
}
const browser = await puppeteer.launch(config.browserConfig);
- const webpage = await browser.newPage();
- await webpage._client.send('Animation.setPlaybackRate', { playbackRate: 50 }); // make animations run 50 times faster, so we don't have to wait as much
+ const originalUserAgent = await browser.userAgent();
// assume the URI points to a folder and make sure Piwik won't cut off the last path segment
if (config.phpServer.REQUEST_URI.slice(-1) !== '/') {
config.phpServer.REQUEST_URI += '/';
}
- const originalUserAgent = await browser.userAgent();
-
- setUpGlobals(config, webpage, originalUserAgent);
+ setUpGlobals(config, browser, originalUserAgent);
mocha = new Mocha({
ui: 'bdd',
diff --git a/tests/lib/screenshot-testing/support/app.js b/tests/lib/screenshot-testing/support/app.js
index fe2458f63b6..ac8f54c5d78 100644
--- a/tests/lib/screenshot-testing/support/app.js
+++ b/tests/lib/screenshot-testing/support/app.js
@@ -191,6 +191,10 @@ Application.prototype.loadTestModules = function () {
mocha.suite.suites.forEach(function (suite) {
var fixture = typeof suite.fixture === 'undefined' ? "Piwik\\Tests\\Fixtures\\UITestFixture" : suite.fixture;
+ suite.beforeAll(async function () {
+ await page.createPage();
+ });
+
suite.beforeAll(function (done) {
this.timeout(0); // no timeout for fixture setup (this requires normal anonymous function, not fat arrow function)
@@ -208,7 +212,8 @@ Application.prototype.loadTestModules = function () {
});
});
- // move to before other hooks
+ // move in front of other beforeAll hooks (called twice as we're adding two beforeAll handlers)
+ suite._beforeAll.unshift(suite._beforeAll.pop());
suite._beforeAll.unshift(suite._beforeAll.pop());
suite.afterAll(function (done) {
@@ -313,10 +318,6 @@ Application.prototype.doRunTests = function (mocha) {
}
});
- this.runner.on('suite', function() {
- page.webpage.mouse.move(-10, -10);
- });
-
this.runner.on('test', function () {
page._reset();
});
diff --git a/tests/lib/screenshot-testing/support/globals.js b/tests/lib/screenshot-testing/support/globals.js
index b3b77fa3229..e5bf8cd4974 100644
--- a/tests/lib/screenshot-testing/support/globals.js
+++ b/tests/lib/screenshot-testing/support/globals.js
@@ -10,7 +10,7 @@ const path = require('path');
const chai = require('chai');
const { PageRenderer } = require('./page-renderer');
-module.exports = function setUpGlobals(config, page, originalUserAgent) {
+module.exports = function setUpGlobals(config, browser, originalUserAgent) {
global.config = config;
global.PIWIK_INCLUDE_PATH = path.join(__dirname, '..', '..', '..', '..');
@@ -23,7 +23,7 @@ module.exports = function setUpGlobals(config, page, originalUserAgent) {
global.testEnvironment = require('./test-environment').TestingEnvironment;
global.app = require('./app').Application;
global.expect = chai.expect;
- global.page = new PageRenderer(config.piwikUrl + path.join("tests", "PHPUnit", "proxy"), page, originalUserAgent);
+ global.page = new PageRenderer(config.piwikUrl + path.join("tests", "PHPUnit", "proxy"), browser, originalUserAgent);
// The following variables need to be in sync with Fixture::ADMIN_USER_LOGIN and Fixture::ADMIN_USER_PASSWORD
global.superUserLogin = 'superUserLogin';
global.superUserPassword = 'pas3!"§$%&/()=?\'ㄨ<|-_#*+~>word';
diff --git a/tests/lib/screenshot-testing/support/page-renderer.js b/tests/lib/screenshot-testing/support/page-renderer.js
index d40f4385706..718a656431e 100644
--- a/tests/lib/screenshot-testing/support/page-renderer.js
+++ b/tests/lib/screenshot-testing/support/page-renderer.js
@@ -77,8 +77,9 @@ const AUTO_WAIT_METHODS = {// TODO: remove this to keep it consistent?
'reload': true,
};
-var PageRenderer = function (baseUrl, page, originalUserAgent) {
- this.webpage = page;
+var PageRenderer = function (baseUrl, browser, originalUserAgent) {
+
+ this.browser = browser;
this.originalUserAgent = originalUserAgent;
this.selectorMarkerClass = 0;
@@ -90,19 +91,6 @@ var PageRenderer = function (baseUrl, page, originalUserAgent) {
if (this.baseUrl.substring(-1) !== '/') {
this.baseUrl = this.baseUrl + '/';
}
-
- PAGE_PROPERTIES_TO_PROXY.forEach((propertyName) => {
- Object.defineProperty(this, propertyName, {
- value: page[propertyName],
- writable: false,
- });
- });
-
- this.webpage.setViewport({
- width: 1350,
- height: 768,
- });
- this._setupWebpageEvents();
};
PageRenderer.prototype._reset = function () {
@@ -113,6 +101,32 @@ PageRenderer.prototype._reset = function () {
});
};
+PageRenderer.prototype.createPage = async function () {
+ if (this.browserContext) {
+ await this.browserContext.close();
+ }
+ this.browserContext = await this.browser.createIncognitoBrowserContext();
+ this.webpage = await this.browserContext.newPage();
+
+ PAGE_PROPERTIES_TO_PROXY.forEach((propertyName) => {
+ Object.defineProperty(this, propertyName, {
+ value: this.webpage[propertyName],
+ writable: true,
+ });
+ });
+
+ await this.webpage._client.send('Animation.setPlaybackRate', { playbackRate: 50 }); // make animations run 50 times faster, so we don't have to wait as much
+ await this.webpage.setViewport({
+ width: 1350,
+ height: 768,
+ });
+ await this.webpage.mouse.move(0, 0);
+ await this.webpage.setExtraHTTPHeaders({
+ 'Accept-Language': 'en-US'
+ });
+ this._setupWebpageEvents();
+};
+
/**
* For BC only. Puppeteer drop support for waitFor function in Version 10
* @param selectorOrTimeoutOrFunction
@@ -367,9 +381,10 @@ PageRenderer.prototype._logMessage = function (message) {
this.pageLogs.push(message);
};
-PageRenderer.prototype.clearCookies = function () {
+PageRenderer.prototype.clearCookies = async function () {
// see https://github.com/GoogleChrome/puppeteer/issues/1632#issuecomment-353086292
- return this.webpage._client.send('Network.clearBrowserCookies');
+ await this.webpage._client.send('Network.clearBrowserCookies');
+ await this.webpage.waitForTimeout(250);
};
PageRenderer.prototype._setupWebpageEvents = function () {
@@ -456,20 +471,6 @@ PageRenderer.prototype._setupWebpageEvents = function () {
if (!VERBOSE) {
this._logMessage('Unable to load resource (URL:' + request.url() + '): ' + errorMessage);
}
-
- var type = '';
- if (type = request.url().match(/action=get(Css|CoreJs|NonCoreJs|UmdJs)/)) {
- if (errorMessage === 'net::ERR_ABORTED' && (!response || response.status() !== 500)) {
- console.log(type[1]+' request aborted.');
- } else if (request.url().indexOf('&reload=') === -1) {
- console.log('Loading '+type[1]+' failed (' + errorMessage + ')... Try adding it with another tag.');
- var method = type[1] == 'Css' ? 'addStyleTag' : 'addScriptTag';
- await this.webpage[method]({url: request.url() + '&reload=' + Date.now()}); // add another get parameter to ensure browser doesn't use cache
- await this.waitForNetworkIdle(); // wait for request to finish before continuing with tests
- } else {
- console.log('Reloading '+type[1]+' failed (' + errorMessage + ').');
- }
- }
});
this.webpage.on('requestfinished', async (request) => {
@@ -488,26 +489,6 @@ PageRenderer.prototype._setupWebpageEvents = function () {
const message = 'Response (size "' + bodyLength + '", status "' + response.status() + '"): ' + request.url() + "\n" + bodyContent.substring(0, 2000);
this._logMessage(message);
}
-
- // if response of css or js request does not start with /*, we assume it had an error and try to load it again
- // Note: We can't do that in requestfailed only, as the response code might be 200 even if it throws an exception
- var type = '';
- if (type = request.url().match(/action=get(Css|CoreJs|NonCoreJs)/)) {
- var body = await response.buffer();
- if (body.toString().substring(0, 2) === '/*') {
- return;
- }
- if (request.url().indexOf('&reload=') === -1) {
- console.log('Loading '+type[1]+' failed... Try adding it with another tag.');
- var method = type[1] == 'Css' ? 'addStyleTag' : 'addScriptTag';
- await this.waitForNetworkIdle(); // wait for other requests to finish before trying to reload
- await this.webpage[method]({url: request.url() + '&reload=' + Date.now()}); // add another get parameter to ensure browser doesn't use cache
- await this.webpage.waitForTimeout(1000);
- } else {
- console.log('Reloading '+type[1]+' failed.');
- }
- console.log('Response (size "' + body.length + '", status "' + response.status() + ', headers "' + JSON.stringify(response.headers()) + '"): ' + request.url() + "\n" + body.toString());
- }
});
this.webpage.on('console', async (consoleMessage) => {
diff --git a/tests/resources/OmniFixture-dump.sql b/tests/resources/OmniFixture-dump.sql
index e0bcb6846e9..6e28bae6bb0 100644
--- a/tests/resources/OmniFixture-dump.sql
+++ b/tests/resources/OmniFixture-dump.sql
@@ -29,7 +29,7 @@ CREATE TABLE `access` (
`access` varchar(50) DEFAULT NULL,
PRIMARY KEY (`idaccess`),
KEY `index_loginidsite` (`login`,`idsite`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -161,7 +161,7 @@ CREATE TABLE `archive_invalidations` (
`report` varchar(255) DEFAULT NULL,
PRIMARY KEY (`idinvalidation`),
KEY `index_idsite_dates_period_name` (`idsite`,`date1`,`period`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -187,7 +187,7 @@ CREATE TABLE `brute_force_log` (
`login` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id_brute_force_log`),
KEY `index_ip_address` (`ip_address`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -217,7 +217,7 @@ CREATE TABLE `changes` (
`link` varchar(255) DEFAULT NULL,
PRIMARY KEY (`idchange`),
UNIQUE KEY `unique_plugin_version_title` (`plugin_name`,`version`,`title`(100))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -281,7 +281,7 @@ CREATE TABLE `goal` (
`deleted` tinyint(4) NOT NULL DEFAULT '0',
`event_value_as_revenue` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`idsite`,`idgoal`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -306,7 +306,7 @@ CREATE TABLE `locks` (
`value` varchar(255) DEFAULT NULL,
`expiry_time` bigint(20) unsigned DEFAULT '9999999999',
PRIMARY KEY (`key`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -333,7 +333,7 @@ CREATE TABLE `log_action` (
`url_prefix` tinyint(2) DEFAULT NULL,
PRIMARY KEY (`idaction`),
KEY `index_type_hash` (`type`,`hash`)
-) ENGINE=InnoDB AUTO_INCREMENT=2764 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB AUTO_INCREMENT=2764 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -406,7 +406,7 @@ CREATE TABLE `log_conversion` (
PRIMARY KEY (`idvisit`,`idgoal`,`buster`),
UNIQUE KEY `unique_idsite_idorder` (`idsite`,`idorder`),
KEY `index_idsite_datetime` (`idsite`,`server_time`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -444,7 +444,7 @@ CREATE TABLE `log_conversion_item` (
`deleted` tinyint(1) unsigned NOT NULL,
PRIMARY KEY (`idvisit`,`idorder`,`idaction_sku`),
KEY `index_idsite_servertime` (`idsite`,`server_time`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -520,7 +520,7 @@ CREATE TABLE `log_link_visit_action` (
PRIMARY KEY (`idlink_va`),
KEY `index_idvisit` (`idvisit`),
KEY `index_idsite_servertime` (`idsite`,`server_time`)
-) ENGINE=InnoDB AUTO_INCREMENT=2833 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB AUTO_INCREMENT=2833 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -547,7 +547,7 @@ CREATE TABLE `log_profiling` (
`idprofiling` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`idprofiling`),
UNIQUE KEY `query` (`query`(100))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -641,7 +641,7 @@ CREATE TABLE `log_visit` (
KEY `index_idsite_config_datetime` (`idsite`,`config_id`,`visit_last_action_time`),
KEY `index_idsite_datetime` (`idsite`,`visit_last_action_time`),
KEY `index_idsite_idvisitor_time` (`idsite`,`idvisitor`,`visit_last_action_time`)
-) ENGINE=InnoDB AUTO_INCREMENT=500 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB AUTO_INCREMENT=500 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -668,7 +668,7 @@ CREATE TABLE `logger_message` (
`level` varchar(16) DEFAULT NULL,
`message` text,
PRIMARY KEY (`idlogger_message`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -693,7 +693,7 @@ CREATE TABLE `option` (
`autoload` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`option_name`),
KEY `autoload` (`autoload`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -722,7 +722,7 @@ CREATE TABLE `plugin_setting` (
`idplugin_setting` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`idplugin_setting`),
KEY `plugin_name` (`plugin_name`,`user_login`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -904,7 +904,7 @@ CREATE TABLE `sequence` (
`name` varchar(120) NOT NULL,
`value` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -929,7 +929,7 @@ CREATE TABLE `session` (
`lifetime` int(11) DEFAULT NULL,
`data` mediumtext,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -969,7 +969,7 @@ CREATE TABLE `site` (
`keep_url_fragment` tinyint(4) NOT NULL DEFAULT '0',
`creator_login` varchar(100) DEFAULT NULL,
PRIMARY KEY (`idsite`)
-) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -998,7 +998,7 @@ CREATE TABLE `site_setting` (
`idsite_setting` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`idsite_setting`),
KEY `idsite` (`idsite`,`plugin_name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -1021,7 +1021,7 @@ CREATE TABLE `site_url` (
`idsite` int(10) unsigned NOT NULL,
`url` varchar(190) NOT NULL,
PRIMARY KEY (`idsite`,`url`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -1257,7 +1257,7 @@ CREATE TABLE `tracking_failure` (
`date_first_occurred` datetime NOT NULL,
`request_url` mediumtext NOT NULL,
PRIMARY KEY (`idsite`,`idfailure`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -1281,7 +1281,7 @@ CREATE TABLE `twofactor_recovery_code` (
`login` varchar(100) NOT NULL,
`recovery_code` varchar(40) NOT NULL,
PRIMARY KEY (`idrecoverycode`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -1345,7 +1345,7 @@ CREATE TABLE `user` (
`ts_changes_shown` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`login`),
UNIQUE KEY `uniq_email` (`email`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -1428,7 +1428,7 @@ CREATE TABLE `user_token_auth` (
`secure_only` tinyint(2) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`idusertokenauth`),
UNIQUE KEY `uniq_password` (`password`)
-) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
diff --git a/tests/resources/overlay-test-site/opt-out.php b/tests/resources/overlay-test-site/opt-out.php
index 59341af2c89..0a9957a709a 100644
--- a/tests/resources/overlay-test-site/opt-out.php
+++ b/tests/resources/overlay-test-site/opt-out.php
@@ -30,7 +30,8 @@
$optOutArgs = [
'divId' => $_GET['divId'] ?? 'matomo-opt-out',
'showIntro' => '1',
- 'useCookiesIfNoTracker' => $loadTracker ? '0' : '1'
+ 'useCookiesIfNoTracker' => $loadTracker ? '0' : '1',
+ 'useCookiesTimeout' => $loadTracker ? '' : '1',
];
?>