Skip to content

V15 Rename slider id to toggle #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2025
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
2 changes: 1 addition & 1 deletion lib/helpers/ContentUiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class ContentUiHelper extends UiBaseLocators {
this.linkTitleTxt = this.linkPickerModal.getByLabel('Title');
this.tagItems = page.locator('uui-tag');
this.removeFilesBtn = page.locator('umb-input-upload-field [label="Remove file(s)"]');
this.toggleBtn = page.locator('umb-property-editor-ui-toggle #slider');
this.toggleBtn = page.locator('umb-property-editor-ui-toggle #toggle');
this.toggleInput = page.locator('umb-property-editor-ui-toggle span');
this.documentTypeWorkspace = this.sidebarModal.locator('umb-document-type-workspace-editor');
this.addMultipleTextStringBtn = page.locator('umb-input-multiple-text-string').getByLabel('Add');
Expand Down
138 changes: 69 additions & 69 deletions lib/helpers/DataTypeUiHelper.ts

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions lib/helpers/DocumentTypeUiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {expect, Locator, Page} from "@playwright/test";

export class DocumentTypeUiHelper extends UiBaseLocators {
private readonly newDocumentTypeBtn: Locator;
private readonly varyByCultureSlider: Locator;
private readonly varyByCultureToggle: Locator;
private readonly documentTypeSettingsTabBtn: Locator;
private readonly documentTypeTemplatesTabBtn: Locator;
private readonly varyBySegmentsBtn: Locator;
Expand All @@ -20,7 +20,7 @@ export class DocumentTypeUiHelper extends UiBaseLocators {
constructor(page: Page) {
super(page);
this.newDocumentTypeBtn = page.getByLabel('New Document Type…');
this.varyByCultureSlider = page.locator('label').filter({hasText: 'Vary by culture'}).locator('#slider');
this.varyByCultureToggle = page.locator('label').filter({hasText: 'Vary by culture'}).locator('#toggle');
this.tabGroup = page.locator('[data-mark="workspace:view-links"]');
this.documentTypeSettingsTabBtn = this.tabGroup.locator('[data-mark*="Settings"]');
this.documentTypeTemplatesTabBtn = this.tabGroup.locator('[data-mark*="Templates"]');
Expand Down Expand Up @@ -52,9 +52,9 @@ export class DocumentTypeUiHelper extends UiBaseLocators {
await this.newDocumentTypeBtn.click();
}

async clickVaryByCultureSlider() {
await expect(this.varyByCultureSlider).toBeVisible();
await this.varyByCultureSlider.click();
async clickVaryByCultureToggle() {
await expect(this.varyByCultureToggle).toBeVisible();
await this.varyByCultureToggle.click();
}

async clickDocumentTypeSettingsTab() {
Expand Down
14 changes: 7 additions & 7 deletions lib/helpers/FormsUiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class FormsUiHelper extends UiBaseLocators{
this.formEditWorkflowModal = page.locator('form-edit-workflow-modal');
this.formInputTxt = page.locator('input[type = "text"]');
this.formInputNumber = page.locator('input[type = "number"]');
this.formToggleSlider = page.locator('uui-toggle #slider');
this.formToggleSlider = page.locator('uui-toggle #toggle');
this.prevalueSourceExpandBtn = page.locator('#menu-item button[aria-label="Expand child items for Prevalue Sources"] svg');
this.prevalueSourceTree = page.locator('umb-tree[alias="Forms.Tree.PrevalueSources"]');
this.prevalueSourceDeleteBtn = page.locator('uui-button[label="Delete..."]');
Expand Down Expand Up @@ -307,7 +307,7 @@ export class FormsUiHelper extends UiBaseLocators{
}

async toggleFieldSetting(settingAlias: string) {
const settingFieldLocator = this.page.locator('umb-property-layout[alias="' + settingAlias + '"] #slider');
const settingFieldLocator = this.page.locator('umb-property-layout[alias="' + settingAlias + '"] #toggle');
await expect(settingFieldLocator).toBeVisible();
await settingFieldLocator.click();
}
Expand All @@ -323,15 +323,15 @@ export class FormsUiHelper extends UiBaseLocators{
}

async applyFieldSettingViaSlider(settingAlias: string) {
const settingFieldLocator = this.page.locator('umb-property[alias="' + settingAlias + '"] #slider');
const settingFieldLocator = this.page.locator('umb-property[alias="' + settingAlias + '"] #toggle');
await expect(settingFieldLocator).toBeVisible();
await settingFieldLocator.click();
}

async applyFieldFileUploadSettings(settingAlias: string, allowedProvidedExtensions: Array<string>, allowedCustomExtensions: Array<string>, allowMultiple: boolean) {
const settingFieldLocator = this.page.locator('umb-property-layout[alias="' + settingAlias + '"]');
for (var i = 0; i < allowedProvidedExtensions.length; i++) {
const checkBoxLocator = settingFieldLocator.locator('uui-toggle', {hasText: allowedProvidedExtensions[i].toUpperCase()}).locator('#slider');
const checkBoxLocator = settingFieldLocator.locator('uui-toggle', {hasText: allowedProvidedExtensions[i].toUpperCase()}).locator('#toggle');
await expect(checkBoxLocator).toBeVisible();
await checkBoxLocator.click();
}
Expand All @@ -347,7 +347,7 @@ export class FormsUiHelper extends UiBaseLocators{

if (allowMultiple) {
const alias = "allowMultipleFileUploads";
const multipleUploadLocator = this.page.locator('umb-property-layout[alias="' + alias + '"] #slider');
const multipleUploadLocator = this.page.locator('umb-property-layout[alias="' + alias + '"] #toggle');
await expect(multipleUploadLocator).toBeVisible();
await multipleUploadLocator.click();
}
Expand Down Expand Up @@ -439,7 +439,7 @@ export class FormsUiHelper extends UiBaseLocators{

for (let i = 0; i < settingValue.length; i++) {
if (settingValue[i].include) {
const includeButtonLocator = settingFieldLocator.locator('div[data-umb-standard-field-mapping-include="' + settingValue[i].alias + '"] #slider');
const includeButtonLocator = settingFieldLocator.locator('div[data-umb-standard-field-mapping-include="' + settingValue[i].alias + '"] #toggle');
await includeButtonLocator.click();
}

Expand All @@ -450,7 +450,7 @@ export class FormsUiHelper extends UiBaseLocators{

async setFieldMandatory(message: string) {
await expect(this.formFieldMandatory).toBeVisible();
await this.formFieldMandatory.locator("#slider").click();
await this.formFieldMandatory.locator("#toggle").click();
await this.page.waitForTimeout(1000);
const inputLocator = this.formFieldMandatory.locator(this.formInputTxt);
await expect(inputLocator).toBeVisible();
Expand Down
4 changes: 2 additions & 2 deletions lib/helpers/LanguageUiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export class LanguageUiHelper extends UiBaseLocators{
super(page);
this.languagesMenu = page.locator('umb-menu').getByLabel('Languages');
this.languageDropdown = page.locator('umb-input-culture-select #expand-symbol-wrapper');
this.defaultLanguageToggle = page.locator('uui-toggle').filter({ hasText: /Default language/ }).locator('#slider');
this.mandatoryLanguageToggle = page.locator('uui-toggle').filter({ hasText: /Mandatory language/ }).locator('#slider');
this.defaultLanguageToggle = page.locator('uui-toggle').filter({ hasText: /Default language/ }).locator('#toggle');
this.mandatoryLanguageToggle = page.locator('uui-toggle').filter({ hasText: /Mandatory language/ }).locator('#toggle');
this.addFallbackLanguageBtn = page.locator('#add-button');
this.languageTable = page.locator('umb-language-table-collection-view');
}
Expand Down
24 changes: 12 additions & 12 deletions lib/helpers/MemberUiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export class MemberUiHelper extends UiBaseLocators {
private readonly emailTxt: Locator;
private readonly passwordTxt: Locator;
private readonly confirmNewPasswordTxt: Locator;
private readonly approvedSlider: Locator;
private readonly lockedOutSlider: Locator;
private readonly twoFactorAuthenticationSlider: Locator;
private readonly approvedToggle: Locator;
private readonly lockedOutToggle: Locator;
private readonly twoFactorAuthenticationToggle: Locator;
private readonly memberInfoItems: Locator;
private readonly changePasswordBtn: Locator;
private readonly membersMenu: Locator;
Expand All @@ -33,9 +33,9 @@ export class MemberUiHelper extends UiBaseLocators {
this.emailTxt = page.getByLabel('Email', {exact: true});
this.passwordTxt = page.getByLabel('Enter your new password', {exact: true});
this.confirmNewPasswordTxt = page.getByLabel('Confirm new password', {exact: true});
this.approvedSlider = page.locator('[label="Approved"] #slider');
this.lockedOutSlider = page.locator('[label="Locked out"] #slider');
this.twoFactorAuthenticationSlider = page.locator('[label="Two-Factor authentication"] #slider');
this.approvedToggle = page.locator('[label="Approved"] #toggle');
this.lockedOutToggle = page.locator('[label="Locked out"] #toggle');
this.twoFactorAuthenticationToggle = page.locator('[label="Two-Factor authentication"] #toggle');
this.memberInfoItems = page.locator('umb-stack > div');
this.changePasswordBtn = page.getByLabel('Change password', {exact: true});
this.membersMenu = page.locator('umb-menu').getByLabel('Members', {exact: true});
Expand Down Expand Up @@ -115,16 +115,16 @@ export class MemberUiHelper extends UiBaseLocators {
return expect(this.memberInfoItems.filter({hasText: infoName}).locator('span')).toHaveText(value);
}

async clickApprovedSlider() {
await this.approvedSlider.click();
async clickApprovedToggle() {
await this.approvedToggle.click();
}

async clickLockedOutSlider() {
await this.lockedOutSlider.click();
async clickLockedOutToggle() {
await this.lockedOutToggle.click();
}

async clickTwoFactorAuthenticationSlider() {
await this.twoFactorAuthenticationSlider.click();
async clickTwoFactorAuthenticationToggle() {
await this.twoFactorAuthenticationToggle.click();
}

async clickChangePasswordButton() {
Expand Down
10 changes: 5 additions & 5 deletions lib/helpers/ProfilingUiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ import {UiBaseLocators} from "./UiBaseLocators";

export class ProfilingUiHelper extends UiBaseLocators {
private readonly profilingTab: Locator;
private readonly activateProfilerByDefaultSlider: Locator;
private readonly activateProfilerByDefaultToggle: Locator;
private readonly activateProfilerByDefaultCheckbox: Locator;

constructor(page: Page) {
super(page);
this.profilingTab = page.getByRole('tab', {name: 'Profiling'});
this.activateProfilerByDefaultSlider = page.locator("[label='Activate the profiler by default'] #slider");
this.activateProfilerByDefaultToggle = page.locator("[label='Activate the profiler by default'] #toggle");
this.activateProfilerByDefaultCheckbox = page.getByLabel('Activate the profiler by default');
}

async clickProfilingTab() {
await this.profilingTab.click();
}

async clickActivateProfilerByDefaultSlider() {
await this.activateProfilerByDefaultSlider.click();
async clickActivateProfilerByDefaultToggle() {
await this.activateProfilerByDefaultToggle.click();
}

async isActivateProfilerByDefaultSliderChecked(isChecked: boolean) {
async isActivateProfilerByDefaultToggleChecked(isChecked: boolean) {
return expect(this.activateProfilerByDefaultCheckbox).toBeChecked({checked: isChecked});
}
}
8 changes: 4 additions & 4 deletions lib/helpers/RelationTypeUiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class RelationTypeUiHelper extends UiBaseLocators{
private readonly relationTypeNameTxt: Locator;
private readonly parentToChildRadioBtn: Locator;
private readonly bidirectionalRadioBtn: Locator;
private readonly isDependencySlider: Locator;
private readonly isDependencyToggle: Locator;
private readonly parentDropDownBox: Locator;
private readonly childDropDownBox: Locator;

Expand All @@ -14,7 +14,7 @@ export class RelationTypeUiHelper extends UiBaseLocators{
this.relationTypeNameTxt = page.locator('#name #input');
this.parentToChildRadioBtn = page.locator("uui-radio[label='Parent to child'] #button");
this.bidirectionalRadioBtn = page.locator("uui-radio[label='Bidirectional'] #button");
this.isDependencySlider = page.locator("umb-property-layout[label='Is dependency'] #slider");
this.isDependencyToggle = page.locator("umb-property-layout[label='Is dependency'] #toggle");
this.parentDropDownBox = page.locator("umb-property-layout[label='Parent'] #native");
this.childDropDownBox = page.locator("umb-property-layout[label='Child'] #native");
}
Expand Down Expand Up @@ -49,8 +49,8 @@ export class RelationTypeUiHelper extends UiBaseLocators{
await this.bidirectionalRadioBtn.click();
}

async clickIsDependencySlider() {
await this.isDependencySlider.click();
async clickIsDependencyToggle() {
await this.isDependencyToggle.click();
}

async selectParentOption(option: string) {
Expand Down
8 changes: 4 additions & 4 deletions lib/helpers/TelemetryDataUiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ import {UiBaseLocators} from "./UiBaseLocators";

export class TelemetryDataUiHelper extends UiBaseLocators {
private readonly telemetryDataTab: Locator;
private readonly telemetryDataLevelSlider: Locator;
private readonly telemetryDataLevelToggle: Locator;

constructor(page: Page) {
super(page);
this.telemetryDataTab = page.getByRole('tab', {name: 'Telemetry Data'});
this.telemetryDataLevelSlider = page.locator('[name="telemetryLevel"] >> input[id=input]');
this.telemetryDataLevelToggle = page.locator('[name="telemetryLevel"] >> input[id=input]');
}

async clickTelemetryDataTab() {
await this.telemetryDataTab.click();
}

async changeTelemetryDataLevelValue(value: string) {
await this.telemetryDataLevelSlider.fill(value);
await this.telemetryDataLevelToggle.fill(value);
}

async doesTelemetryDataLevelHaveValue(value: string) {
return await expect(this.telemetryDataLevelSlider).toHaveValue(value);
return await expect(this.telemetryDataLevelToggle).toHaveValue(value);
}
}
8 changes: 4 additions & 4 deletions lib/helpers/UiBaseLocators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class UiBaseLocators {
public readonly addTabBtn: Locator;
public readonly descriptionBtn: Locator;
public readonly enterDescriptionTxt: Locator;
public readonly mandatorySlider: Locator;
public readonly mandatoryToggle: Locator;
public readonly validation: Locator;
public readonly regexTxt: Locator;
public readonly regexMessageTxt: Locator;
Expand Down Expand Up @@ -194,7 +194,7 @@ export class UiBaseLocators {
this.addTabBtn = page.getByLabel('Add tab');
this.descriptionBtn = page.getByLabel('Description');
this.enterDescriptionTxt = page.getByLabel('Enter a description...');
this.mandatorySlider = page.locator('#mandatory #slider');
this.mandatoryToggle = page.locator('#mandatory #toggle');
this.validation = page.locator('#native');
this.regexTxt = page.locator('input[name="pattern"]');
this.regexMessageTxt = page.locator('textarea[name="pattern-message"]');
Expand Down Expand Up @@ -697,8 +697,8 @@ export class UiBaseLocators {
await this.labelAboveBtn.click();
}

async clickMandatorySlider() {
await this.mandatorySlider.click();
async clickMandatoryToggle() {
await this.mandatoryToggle.click();
}

async selectValidationOption(option: string) {
Expand Down
16 changes: 8 additions & 8 deletions lib/helpers/UserUiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export class UserUiHelper extends UiBaseLocators {
private readonly statusBtn: Locator;
private readonly groupBtn: Locator;
private readonly chooseUserGroupsBtn: Locator;
private readonly allowAccessToAllDocumentsBtn: Locator;
private readonly allowAccessToAllMediaBtn: Locator;
private readonly allowAccessToAllDocumentsToggle: Locator;
private readonly allowAccessToAllMediaToggle: Locator;
private readonly mediaInput: Locator;
private readonly chooseContainerBtn: Locator;
private readonly languageBtn: Locator;
Expand Down Expand Up @@ -54,8 +54,8 @@ export class UserUiHelper extends UiBaseLocators {
this.userSectionCard = page.locator('uui-card-user');
this.statusBtn = page.locator('uui-button', {hasText: 'Status'});
this.groupBtn = page.locator('uui-button', {hasText: 'Groups'});
this.allowAccessToAllDocumentsBtn = page.locator('umb-property-layout').filter({hasText: 'Allow access to all documents'}).locator('#slider');
this.allowAccessToAllMediaBtn = page.locator('umb-property-layout').filter({hasText: 'Allow access to all media'}).locator('#slider');
this.allowAccessToAllDocumentsToggle = page.locator('umb-property-layout').filter({hasText: 'Allow access to all documents'}).locator('#toggle');
this.allowAccessToAllMediaToggle = page.locator('umb-property-layout').filter({hasText: 'Allow access to all media'}).locator('#toggle');
this.mediaInput = page.locator('umb-input-media');
this.chooseContainerBtn = page.locator('#container').getByLabel('Choose');
this.languageBtn = page.locator('[label="UI Culture"] select');
Expand Down Expand Up @@ -191,12 +191,12 @@ export class UserUiHelper extends UiBaseLocators {
await this.mediaInput.locator('[name="' + name + '"]').locator('[label="Remove"]').click();
}

async clickAllowAccessToAllDocumentsSlider() {
await this.allowAccessToAllDocumentsBtn.click();
async clickAllowAccessToAllDocumentsToggle() {
await this.allowAccessToAllDocumentsToggle.click();
}

async clickAllowAccessToAllMediaSlider() {
await this.allowAccessToAllMediaBtn.click();
async clickAllowAccessToAllMediaToggle() {
await this.allowAccessToAllMediaToggle.click();
}

async isUserDisabledTextVisible() {
Expand Down