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:
Diffstat (limited to 'plugins/UsersManager/tests/UI/UsersManager_spec.js')
-rw-r--r--plugins/UsersManager/tests/UI/UsersManager_spec.js52
1 files changed, 28 insertions, 24 deletions
diff --git a/plugins/UsersManager/tests/UI/UsersManager_spec.js b/plugins/UsersManager/tests/UI/UsersManager_spec.js
index 6b4018ef15..d5f9930193 100644
--- a/plugins/UsersManager/tests/UI/UsersManager_spec.js
+++ b/plugins/UsersManager/tests/UI/UsersManager_spec.js
@@ -74,9 +74,9 @@ describe("UsersManager", function () {
});
it('should select rows when individual row select is clicked', async function () {
- await (await page.jQuery('td.select-cell label:eq(0)', { waitFor: true })).click();
- await (await page.jQuery('td.select-cell label:eq(3)', { waitFor: true })).click();
- await (await page.jQuery('td.select-cell label:eq(8)', { waitFor: true })).click();
+ await (await page.jQuery('td.select-cell input:eq(0) + span', { waitFor: true })).click();
+ await (await page.jQuery('td.select-cell input:eq(3) + span', { waitFor: true })).click();
+ await (await page.jQuery('td.select-cell input:eq(8) + span', { waitFor: true })).click();
await page.mouse.move(0, 0);
await page.waitFor(500); // for checkbox animations
@@ -84,7 +84,7 @@ describe("UsersManager", function () {
});
it('should select all rows when all row select is clicked', async function () {
- await page.click('th.select-cell label');
+ await page.click('th.select-cell input + span');
await page.mouse.move(0, 0);
await page.waitFor(500); // for checkbox animations
@@ -116,7 +116,7 @@ describe("UsersManager", function () {
await page.click('.toggle-select-all-in-search'); // reselect all in search
await page.click('.bulk-actions.btn');
- await (await page.jQuery('#user-list-bulk-actions>li:first > a')).hover();
+ await (await page.jQuery('a[data-target=user-list-bulk-actions]')).hover();
await (await page.jQuery('#bulk-set-access a:contains(Admin)')).click();
await page.waitFor(350); // wait for animation
@@ -131,7 +131,7 @@ describe("UsersManager", function () {
});
it('should remove access to the currently selected site when the bulk remove access option is clicked', async function () {
- await page.click('th.select-cell label'); // select displayed rows
+ await page.click('th.select-cell input + span'); // select displayed rows
await page.click('.bulk-actions.btn');
await (await page.jQuery('#user-list-bulk-actions a:contains(Remove Permissions)')).click();
@@ -172,7 +172,7 @@ describe("UsersManager", function () {
});
it('should delete selected users when delete users bulk action is used', async function () {
- await page.click('th.select-cell label'); // select displayed rows
+ await page.click('th.select-cell input + span'); // select displayed rows
await page.click('.bulk-actions.btn');
await (await page.jQuery('#user-list-bulk-actions a:contains(Delete Users)')).click();
@@ -224,7 +224,7 @@ describe("UsersManager", function () {
});
await page.waitForNetworkIdle();
- await page.click('.userPermissionsEdit th.select-cell label');
+ await page.click('.userPermissionsEdit th.select-cell input + span');
await page.waitFor(500); // for angular to re-render
await page.evaluate(() => $('.userPermissionsEdit tr.select-all-row a').click());
await page.waitFor(500); // for angular to re-render
@@ -240,8 +240,12 @@ describe("UsersManager", function () {
await (await page.jQuery('#user-permissions-edit-bulk-actions>li:first>a')).hover();
await (await page.jQuery('#user-permissions-edit-bulk-actions a:contains(Write)')).click();
+ await page.waitFor(250); // animation
await page.waitFor('.change-access-confirm-modal', { visible: true });
- await page.evaluate(() => $('.userPermissionsEdit .change-access-confirm-modal .modal-close:not(.modal-no):visible').click());
+
+ const yes = await page.jQuery('.userPermissionsEdit .change-access-confirm-modal .modal-close:not(.modal-no):visible');
+ await yes.click();
+
await page.waitForNetworkIdle();
await page.waitFor(250); // animation
@@ -266,7 +270,7 @@ describe("UsersManager", function () {
await page.waitFor('.change-access-confirm-modal', { visible: true });
await page.waitFor(250); // animation
- await page.evaluate(() => $('.userPermissionsEdit .change-access-confirm-modal .modal-close:not(.modal-no):visible').click());
+ await (await page.jQuery('.userPermissionsEdit .change-access-confirm-modal .modal-close:not(.modal-no):visible')).click();
await page.waitForNetworkIdle();
await page.waitFor(250); // animation
@@ -277,9 +281,9 @@ describe("UsersManager", function () {
});
it('should select multiple rows when individual row selects are clicked', async function () {
- await (await page.jQuery('#sitesForPermission td.select-cell label:eq(0)')).click();
- await (await page.jQuery('#sitesForPermission td.select-cell label:eq(3)')).click();
- await (await page.jQuery('#sitesForPermission td.select-cell label:eq(8)')).click();
+ await (await page.jQuery('#sitesForPermission td.select-cell input:eq(0) + span')).click();
+ await (await page.jQuery('#sitesForPermission td.select-cell input:eq(3) + span')).click();
+ await (await page.jQuery('#sitesForPermission td.select-cell input:eq(8) + span')).click();
await page.mouse.move(-10, -10);
await page.waitFor(1000); // for checkbox animations
@@ -298,7 +302,7 @@ describe("UsersManager", function () {
await page.waitFor('.change-access-confirm-modal');
- await page.evaluate(() => $('.change-access-confirm-modal .modal-close:not(.modal-no):visible').click());
+ await (await page.jQuery('.change-access-confirm-modal .modal-close:not(.modal-no):visible')).click();
await page.mouse.move(-10, -10);
await page.waitForNetworkIdle();
await page.waitFor(100);
@@ -326,7 +330,7 @@ describe("UsersManager", function () {
});
it('should select all displayed rows when the select all checkbox is clicked', async function () {
- await page.click('.userPermissionsEdit th.select-cell label');
+ await page.click('.userPermissionsEdit th.select-cell input + span');
await page.waitFor(250); // for checkbox animations
expect(await page.screenshotSelector('.usersManager')).to.matchImage({
@@ -343,7 +347,7 @@ describe("UsersManager", function () {
await (await page.jQuery('#user-permissions-edit-bulk-actions a:contains(View)', { waitFor: true })).click();
await page.waitFor(250); // animation
- await page.evaluate(() => $('.change-access-confirm-modal .modal-close:not(.modal-no):visible').click());
+ await (await page.jQuery('.change-access-confirm-modal .modal-close:not(.modal-no):visible')).click();
await page.waitForNetworkIdle();
await page.evaluate(function () { // remove filter
@@ -365,7 +369,7 @@ describe("UsersManager", function () {
await page.waitFor('.userPermissionsEdit .change-access-confirm-modal', { visible: true });
await page.waitFor(100); // animation
- await page.evaluate(() => $('.userPermissionsEdit .change-access-confirm-modal .modal-close:not(.modal-no):visible').click());
+ await (await page.jQuery('.userPermissionsEdit .change-access-confirm-modal .modal-close:not(.modal-no):visible')).click();
await page.waitForNetworkIdle();
expect(await page.screenshotSelector('.usersManager')).to.matchImage({
@@ -381,7 +385,7 @@ describe("UsersManager", function () {
await page.waitFor(250); // animation
- await page.evaluate(() => $('.userPermissionsEdit .confirmCapabilityToggle .modal-close:not(.modal-no):visible').click());
+ await (await page.jQuery('.userPermissionsEdit .confirmCapabilityToggle .modal-close:not(.modal-no):visible')).click();
await page.waitForNetworkIdle();
await page.waitFor(250); // animation
@@ -400,7 +404,7 @@ describe("UsersManager", function () {
});
await page.waitForNetworkIdle();
- await page.click('label[for=perm_edit_select_all]');
+ await page.click('input#perm_edit_select_all + span');
await page.waitFor('.userPermissionsEdit tr.select-all-row a');
await page.click('.userPermissionsEdit tr.select-all-row a');
@@ -410,7 +414,7 @@ describe("UsersManager", function () {
await page.click('.userPermissionsEdit .bulk-actions > .dropdown-trigger.btn');
await (await page.jQuery('.userPermissionsEdit a:contains(Remove Permissions)')).click();
- await page.evaluate(() => $('.delete-access-confirm-modal .modal-close:not(.modal-no):visible').click());
+ await (await page.jQuery('.delete-access-confirm-modal .modal-close:not(.modal-no):visible')).click();
await page.waitForNetworkIdle();
expect(await page.screenshotSelector('.usersManager')).to.matchImage('permissions_remove_access');
@@ -424,7 +428,7 @@ describe("UsersManager", function () {
});
it('should show superuser confirm modal when the superuser toggle is clicked', async function () {
- await page.click('.userEditForm #superuser_access+label');
+ await page.click('.userEditForm #superuser_access+span');
await page.waitFor(500);
const elem = await page.$('.superuser-confirm-modal');
@@ -433,7 +437,7 @@ describe("UsersManager", function () {
it('should fail to set superuser access if password is wrong', async function () {
await page.type('input#currentUserPasswordForSuperUser', 'wrongpassword');
- await page.evaluate(() => $('.superuser-confirm-modal .modal-close:not(.modal-no):visible').click());
+ await (await page.jQuery('.superuser-confirm-modal .modal-close:not(.modal-no):visible')).click();
await page.waitForNetworkIdle();
await page.waitFor('.notification-error', { visible: true });
@@ -443,11 +447,11 @@ describe("UsersManager", function () {
});
it('should give the user superuser access when the superuser modal is confirmed', async function () {
- await page.click('.userEditForm #superuser_access+label');
+ await page.click('.userEditForm #superuser_access+span');
await page.waitFor(500);
await page.type('input#currentUserPasswordForSuperUser', 'superUserPass');
- await page.evaluate(() => $('.superuser-confirm-modal .modal-close:not(.modal-no):visible').click());
+ await (await page.jQuery('.superuser-confirm-modal .modal-close:not(.modal-no):visible')).click();
await page.waitForNetworkIdle();
await page.waitFor(500);