Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@matomo.org>2020-02-17 12:21:32 +0300
committerGitHub <noreply@github.com>2020-02-17 12:21:32 +0300
commitf16d27ec5b93d0ce4a082ac13590460df6bd8a52 (patch)
tree7a446849e27e2d5643d9068f0dad2320b2d6a7b1 /plugins/Dashboard
parent05823da5c2cbac57014cae81382eee057fa9fc7f (diff)
Fix some failing tests (#15564)
* Ensure https warning is hidden in optout ui test * ensure to include image tests on travis * try to fix update test * improve feedback ui test * fix update ui test * try to fix 2factorauth ui test * updates expected test files * improve 2fa ui tests * improve usersmanager ui test * updates expected test file * try killing cookies on logout * allow some pixels difference for usermanager tests * try to fix randomly failing dashboard test * try to fix emptysite ui test * remove no longer needed ui file
Diffstat (limited to 'plugins/Dashboard')
-rw-r--r--plugins/Dashboard/tests/UI/DashboardManager_spec.js21
-rw-r--r--plugins/Dashboard/tests/UI/Dashboard_spec.js21
-rw-r--r--plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png4
3 files changed, 40 insertions, 6 deletions
diff --git a/plugins/Dashboard/tests/UI/DashboardManager_spec.js b/plugins/Dashboard/tests/UI/DashboardManager_spec.js
index 42c15f432b..03f1d393b7 100644
--- a/plugins/Dashboard/tests/UI/DashboardManager_spec.js
+++ b/plugins/Dashboard/tests/UI/DashboardManager_spec.js
@@ -65,8 +65,25 @@ describe("DashboardManager", function () {
await page.click('.dashboard-manager .title');
await page.click('li[data-action="createDashboard"]');
await page.waitFor('#createDashboardName', { visible: true });
- await page.type('#createDashboardName', 'newdash2');
- await page.waitFor(200); // sometimes the text doesn't seem to type fast enough
+
+ // try to type the text a few times, as it sometimes doesn't get the full value
+ var name = 'newdash2';
+ for (var i=0; i<5; i++) {
+ await page.evaluate(function() {
+ $('#createDashboardName').val('');
+ });
+ await page.type('#createDashboardName', name);
+ await page.waitFor(500); // sometimes the text doesn't seem to type fast enough
+
+ var value = await page.evaluate(function() {
+ return $('#createDashboardName').attr('value');
+ });
+
+ if (value === name) {
+ break;
+ }
+ }
+
button = await page.jQuery('.modal.open .modal-footer a:contains(Ok)');
await button.click();
diff --git a/plugins/Dashboard/tests/UI/Dashboard_spec.js b/plugins/Dashboard/tests/UI/Dashboard_spec.js
index c684c501da..6ac640b7a8 100644
--- a/plugins/Dashboard/tests/UI/Dashboard_spec.js
+++ b/plugins/Dashboard/tests/UI/Dashboard_spec.js
@@ -261,8 +261,25 @@ describe("Dashboard", function () {
await page.click('.dashboard-manager .title');
await page.click('li[data-action="createDashboard"]');
await page.waitFor('#createDashboardName', { visible: true });
- await page.type('#createDashboardName', 'newdash2');
- await page.waitFor(500); // sometimes the text doesn't seem to type fast enough
+
+ // try to type the text a few times, as it sometimes doesn't get the full value
+ var name = 'newdash2';
+ for (var i=0; i<5; i++) {
+ await page.evaluate(function() {
+ $('#createDashboardName').val('');
+ });
+ await page.type('#createDashboardName', name);
+ await page.waitFor(500); // sometimes the text doesn't seem to type fast enough
+
+ var value = await page.evaluate(function() {
+ return $('#createDashboardName').attr('value');
+ });
+
+ if (value === name) {
+ break;
+ }
+ }
+
var button = await page.jQuery('.modal.open .modal-footer a:contains(Ok)');
await button.click();
await page.mouse.move(-10, -10);
diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png
index 2dd8c4dc43..7086a4ca37 100644
--- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png
+++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:4a7714eb47d44749f1186072224763e568fa6e0a0d750e6fd9dfe3ea7dd8c80e
-size 470401
+oid sha256:a75b852ec9bd80070105bd5de268747e0f858fbac3fd8715ff5556d4cd03fd80
+size 471753