Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions e2e-tests/playwright/lib/src/server/default_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ const defaultServerConfig: AdminConfig = {
IntegratedBoards: false,
CJKSearch: false,
ManagedChannelCategories: false,
MobileEphemeralMode: true,
},
ImportSettings: {
Directory: './import',
Expand Down Expand Up @@ -868,4 +869,10 @@ const defaultServerConfig: AdminConfig = {
LLMServiceID: '',
},
},
MobileEphemeralModeSettings: {
Enable: false,
DisconnectionTimeoutSeconds: 60,
OfflinePersistenceTimerHours: 24,
AutoCacheCleanupDays: 7,
},
};
10 changes: 9 additions & 1 deletion e2e-tests/playwright/lib/src/ui/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ import BurnOnReadTimerChip from './channels/burn_on_read_timer_chip';
import BurnOnReadConcealedPlaceholder from './channels/burn_on_read_concealed_placeholder';
import BurnOnReadConfirmationModal from './channels/burn_on_read_confirmation_modal';
// System Console Components
import {AdminSectionPanel, DropdownSetting, RadioSetting, TextInputSetting} from './system_console/base_components';
import {
AdminSectionPanel,
DropdownSetting,
NumberInputSetting,
RadioSetting,
TextInputSetting,
} from './system_console/base_components';
import DelegatedGranularAdministration from './system_console/sections/user_management/delegated_granular_administration';
import UserDetail from './system_console/sections/user_management/user_detail';
import EditionAndLicense from './system_console/sections/about/edition_and_license';
Expand Down Expand Up @@ -132,6 +138,7 @@ const components = {
EditionAndLicense,
MobileSecurity,
Notifications,
NumberInputSetting,
RadioSetting,
UsersAndTeams,
SystemConsoleFeatureDiscovery,
Expand Down Expand Up @@ -210,6 +217,7 @@ export {
EditionAndLicense,
MobileSecurity,
Notifications,
NumberInputSetting,
RadioSetting,
UsersAndTeams,
SystemConsoleFeatureDiscovery,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,40 @@ export class TextInputSetting {
}
}

/**
* Number Input Setting - represents a number input field
* Uses getByRole('spinbutton') since <input type="number"> has ARIA role spinbutton
*/
export class NumberInputSetting {
readonly container: Locator;
readonly label: Locator;
readonly input: Locator;
readonly helpText: Locator;

constructor(container: Locator, labelText: string) {
this.container = container;
this.label = container.getByText(labelText);
this.input = container.getByRole('spinbutton');
this.helpText = container.locator('.help-text');
}

async fill(value: string) {
await this.input.fill(value);
}

async getValue(): Promise<string> {
return (await this.input.inputValue()) ?? '';
}

async clear() {
await this.input.clear();
}

async toBeVisible() {
await expect(this.container).toBeVisible();
}
}

/**
* Dropdown Setting - represents a select dropdown
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@

import {Locator, expect} from '@playwright/test';

import {RadioSetting, TextInputSetting, DropdownSetting, AdminSectionPanel} from '../../base_components';
import {
RadioSetting,
TextInputSetting,
NumberInputSetting,
DropdownSetting,
AdminSectionPanel,
} from '../../base_components';

/**
* System Console -> Environment -> Mobile Security
Expand All @@ -17,6 +23,7 @@ export default class MobileSecurity {
// Panels
readonly generalMobileSecurity: GeneralMobileSecurityPanel;
readonly microsoftIntune: MicrosoftIntunePanel;
readonly mobileEphemeralMode: MobileEphemeralModePanel;

// Save section
readonly saveButton: Locator;
Expand All @@ -33,6 +40,9 @@ export default class MobileSecurity {
this.microsoftIntune = new MicrosoftIntunePanel(
container.locator('.AdminSectionPanel').filter({hasText: 'Microsoft Intune'}),
);
this.mobileEphemeralMode = new MobileEphemeralModePanel(
container.locator('.AdminSectionPanel').filter({hasText: 'Mobile Ephemeral Mode'}),
);

this.saveButton = container.getByRole('button', {name: 'Save'});
this.errorMessage = container.locator('.error-message');
Expand Down Expand Up @@ -77,6 +87,20 @@ export default class MobileSecurity {
get clientId() {
return this.microsoftIntune.clientId;
}

// Convenience shortcuts for Mobile Ephemeral Mode settings
get enableMobileEphemeralMode() {
return this.mobileEphemeralMode.enableMobileEphemeralMode;
}
get disconnectionTimeout() {
return this.mobileEphemeralMode.disconnectionTimeout;
}
get offlinePersistenceTimer() {
return this.mobileEphemeralMode.offlinePersistenceTimer;
}
get autoCacheCleanup() {
return this.mobileEphemeralMode.autoCacheCleanup;
}
}

class GeneralMobileSecurityPanel extends AdminSectionPanel {
Expand Down Expand Up @@ -105,6 +129,33 @@ class GeneralMobileSecurityPanel extends AdminSectionPanel {
}
}

class MobileEphemeralModePanel extends AdminSectionPanel {
readonly enableMobileEphemeralMode: RadioSetting;
readonly disconnectionTimeout: NumberInputSetting;
readonly offlinePersistenceTimer: NumberInputSetting;
readonly autoCacheCleanup: NumberInputSetting;

constructor(container: Locator) {
super(container, 'Mobile Ephemeral Mode');

this.enableMobileEphemeralMode = new RadioSetting(
this.body.getByRole('group', {name: /Enable Mobile Ephemeral Mode/}),
);
this.disconnectionTimeout = new NumberInputSetting(
this.body.locator('.form-group').filter({hasText: 'Disconnection Timeout (seconds):'}),
'Disconnection Timeout (seconds):',
);
this.offlinePersistenceTimer = new NumberInputSetting(
this.body.locator('.form-group').filter({hasText: 'Offline Persistence Timer (hours):'}),
'Offline Persistence Timer (hours):',
);
this.autoCacheCleanup = new NumberInputSetting(
this.body.locator('.form-group').filter({hasText: 'Auto Cache Cleanup (days):'}),
'Auto Cache Cleanup (days):',
);
}
}

class MicrosoftIntunePanel extends AdminSectionPanel {
readonly enableIntuneMAM: RadioSetting;
readonly authProvider: DropdownSetting;
Expand Down
Loading
Loading