Add system console settings for mobile security (#30456)

* Add config settings for additional security features on mobile

* Add system console settings for mobile security

* Update svg and link

* Fix strings

* Add test for the discovery feature

* Fix tests

* Add permission migrations

* Add relevant e2e tests

* Fix key alignment

* fix tests

* Fix lint

* Mock new migration

* Fix playwright prettier

* Add new section to delegated permissions

* Update snapshots

* Fix flakyness in playwright test

---------

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Daniel Espino García
2025-03-27 13:13:20 +01:00
коммит произвёл GitHub
родитель 8ce78c302d
Коммит 7999239ccf
29 изменённых файлов: 2990 добавлений и 5 удалений

Просмотреть файл

@@ -36,6 +36,8 @@ import {SystemUsersColumnToggleMenu} from './system_console/sections/system_user
import ChannelsPostEdit from '@e2e-support/ui/components/channels/post_edit';
import DeletePostConfirmationDialog from '@e2e-support/ui/components/channels/delete_post_confirmation_dialog';
import RestorePostConfirmationDialog from '@e2e-support/ui/components/channels/restore_post_confirmation_dialog';
import MobileSecurity from './system_console/sections/system_users/mobile_security';
import FeatureDiscovery from './system_console/sections/system_users/feature_discovery';
const components = {
GlobalHeader,
@@ -71,6 +73,8 @@ const components = {
UserProfilePopover,
DeletePostConfirmationDialog,
RestorePostConfirmationDialog,
MobileSecurity,
FeatureDiscovery,
};
export {

Просмотреть файл

@@ -0,0 +1,25 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {expect, Locator} from '@playwright/test';
/**
* System Console -> Feature Discovery
*/
export default class FeatureDiscovery {
readonly container: Locator;
constructor(container: Locator) {
this.container = container;
}
async toBeVisible() {
await expect(this.container).toBeVisible();
}
async toHaveTitle(title: string) {
await expect(this.container.getByTestId('featureDiscovery_title')).toHaveText(title);
}
}
export {FeatureDiscovery};

Просмотреть файл

@@ -0,0 +1,81 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {expect, Locator} from '@playwright/test';
/**
* System Console -> Environment -> Mobile Security
*/
export default class MobileSecurity {
readonly container: Locator;
readonly enableBiometricAuthenticationToggleTrue: Locator;
readonly enableBiometricAuthenticationToggleFalse: Locator;
readonly preventScreenCaptureToggleTrue: Locator;
readonly preventScreenCaptureToggleFalse: Locator;
readonly jailbreakProtectionToggleTrue: Locator;
readonly jailbreakProtectionToggleFalse: Locator;
readonly saveButton: Locator;
constructor(container: Locator) {
this.container = container;
this.enableBiometricAuthenticationToggleTrue = this.container.getByTestId(
'NativeAppSettings.MobileEnableBiometricstrue',
);
this.enableBiometricAuthenticationToggleFalse = this.container.getByTestId(
'NativeAppSettings.MobileEnableBiometricsfalse',
);
this.preventScreenCaptureToggleTrue = this.container.getByTestId(
'NativeAppSettings.MobilePreventScreenCapturetrue',
);
this.preventScreenCaptureToggleFalse = this.container.getByTestId(
'NativeAppSettings.MobilePreventScreenCapturefalse',
);
this.jailbreakProtectionToggleTrue = this.container.getByTestId(
'NativeAppSettings.MobileJailbreakProtectiontrue',
);
this.jailbreakProtectionToggleFalse = this.container.getByTestId(
'NativeAppSettings.MobileJailbreakProtectionfalse',
);
this.saveButton = this.container.getByRole('button', {name: 'Save'});
}
async toBeVisible() {
await expect(this.container).toBeVisible();
}
async clickEnableBiometricAuthenticationToggleTrue() {
await this.enableBiometricAuthenticationToggleTrue.click();
}
async clickEnableBiometricAuthenticationToggleFalse() {
await this.enableBiometricAuthenticationToggleFalse.click();
}
async clickPreventScreenCaptureToggleTrue() {
await this.preventScreenCaptureToggleTrue.click();
}
async clickPreventScreenCaptureToggleFalse() {
await this.preventScreenCaptureToggleFalse.click();
}
async clickJailbreakProtectionToggleTrue() {
await this.jailbreakProtectionToggleTrue.click();
}
async clickJailbreakProtectionToggleFalse() {
await this.jailbreakProtectionToggleFalse.click();
}
async clickSaveButton() {
await this.saveButton.click();
}
}
export {MobileSecurity};