Skip to content

Commit 0d4780c

Browse files
nhudinh0309andr317cnikolajlauridsen
authored
V16 Merged release/16.0 branch to v16/dev branch (#253)
* V16 Updated test helper for label for entity actions (#245) * Applied new implementation of the entity action interaction * Bumped version * Renamed * Updated ui helper for acrion menu * Cleaned up * V16 Updated test helper to resolve E2E issues in PR #19242 (#246) * Updated ui helper due to new implementation of action entity label * Bumped verision * Fixed comment * V16 Updated test helper for fixing the failing tests in 16.0.0-rc2 (#248) * Updated ui helper due to UI changes * Bumped version * Added data mark * bumped version * V16 Updated test helper for updating fixme() and skip() tests (#251) * Updated ui helper due to UI changes * Bumped version * Updated ui helper for stylesheet and media * Applied getByTestIds for data-mark * Updated validation message for emptyLinkPicker * Updated ui helper for content * Updated ui helper for data type * Updated locator for query result element * Bumped version * Fixed comment --------- Co-authored-by: Andreas Zerbst <[email protected]> Co-authored-by: Mole <[email protected]>
1 parent 7cc8066 commit 0d4780c

16 files changed

+263
-143
lines changed

lib/helpers/ConstantHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818

1919
public static readonly validationMessages = {
20-
emptyLinkPicker: 'Please enter an anchor or querystring, or select a published document or media item, or manually configure the URL',
20+
emptyLinkPicker: 'Please enter an anchor or querystring, select a document or media item, or manually configure the URL.',
2121
invalidValue: 'Value is invalid, it does not match the correct pattern',
2222
unsupportInvariantContentItemWithVariantBlocks: 'One or more Block Types of this Block Editor is using a Element-Type that is configured to Vary By Culture or Vary By Segment. This is not supported on a Content item that does not vary by Culture or Segment.',
2323
emptyValue: 'Value cannot be empty'

lib/helpers/ContentRenderUiHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class ContentRenderUiHelper extends UiBaseLocators {
77

88
constructor(page: Page) {
99
super(page);
10-
this.contentRenderValue = page.locator('[data-mark="content-render-value"]');
10+
this.contentRenderValue = page.getByTestId('content-render-value');
1111
}
1212

1313
async navigateToRenderedContentPage(contentURL: string) {

lib/helpers/ContentUiHelper.ts

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ export class ContentUiHelper extends UiBaseLocators {
9595
private readonly publicAccessBtn: Locator;
9696
private readonly uuiCheckbox: Locator;
9797
private readonly sortBtn: Locator;
98-
private readonly modalChooseBtn: Locator;
9998
private readonly containerSaveBtn: Locator
10099
private readonly groupBasedProtectionBtn: Locator;
101100
private readonly nextBtn: Locator;
@@ -143,8 +142,8 @@ export class ContentUiHelper extends UiBaseLocators {
143142
private readonly workspaceActionMenu: Locator;
144143
private readonly workspaceActionMenuItem: Locator;
145144
private readonly viewMoreOptionsBtn: Locator;
146-
private readonly scheduleBtn: Locator;
147-
private readonly scheduleModalBtn: Locator;
145+
private readonly schedulePublishBtn: Locator;
146+
private readonly schedulePublishModalBtn: Locator;
148147
private readonly documentScheduleModal: Locator;
149148
private readonly publishAtFormLayout: Locator;
150149
private readonly unpublishAtFormLayout: Locator;
@@ -177,7 +176,7 @@ export class ContentUiHelper extends UiBaseLocators {
177176
this.contentNameTxt = page.locator('#name-input input');
178177
this.publishBtn = page.getByLabel(/^Publish()?$/);
179178
this.unpublishBtn = page.getByLabel(/^Unpublish()?$/);
180-
this.actionMenuForContentBtn = page.locator('#header [label="Open actions menu"]');
179+
this.actionMenuForContentBtn = page.locator('#header #action-modal');
181180
this.openedModal = page.locator('uui-modal-container[backdrop]');
182181
this.textstringTxt = page.locator('umb-property-editor-ui-text-box #input');
183182
this.reloadChildrenThreeDotsBtn = page.getByRole('button', {name: 'Reload children…'});
@@ -195,7 +194,7 @@ export class ContentUiHelper extends UiBaseLocators {
195194
this.chooseMemberPickerBtn = page.locator('umb-property-editor-ui-member-picker #btn-add');
196195
this.numericTxt = page.locator('umb-property-editor-ui-number input');
197196
this.addMultiURLPickerBtn = page.locator('umb-property-editor-ui-multi-url-picker #btn-add');
198-
this.linkTxt = page.locator('[data-mark="input:url"] #input');
197+
this.linkTxt = page.getByTestId('input:url').locator('#input');
199198
this.anchorQuerystringTxt = page.getByLabel('#value or ?key=value');
200199
this.linkTitleTxt = this.linkPickerModal.getByLabel('Title');
201200
this.tagItems = page.locator('uui-tag');
@@ -219,7 +218,7 @@ export class ContentUiHelper extends UiBaseLocators {
219218
this.documentLanguageSelectPopover = page.locator('umb-popover-layout');
220219
this.documentReadOnly = this.documentWorkspace.locator('#name-input').getByText('Read-only');
221220
// Info tab
222-
this.infoTab = page.locator('uui-tab[data-mark="workspace:view-link:Umb.WorkspaceView.Document.Info"]');
221+
this.infoTab = page.getByTestId('workspace:view-link:Umb.WorkspaceView.Document.Info');
223222
this.linkContent = page.locator('umb-document-links-workspace-info-app');
224223
this.historyItems = page.locator('umb-history-item');
225224
this.generalItem = page.locator('.general-item');
@@ -239,7 +238,7 @@ export class ContentUiHelper extends UiBaseLocators {
239238
this.saveModalBtn = this.sidebarModal.getByLabel('Save', {exact: true});
240239
this.resetFocalPointBtn = page.getByLabel('Reset focal point');
241240
// List View
242-
this.enterNameInContainerTxt = this.container.locator('[data-mark="input:entity-name"] #input');
241+
this.enterNameInContainerTxt = this.container.getByTestId('input:entity-name').locator('#input');
243242
this.listView = page.locator('umb-document-table-collection-view');
244243
this.nameBtn = page.getByRole('button', {name: 'Name'});
245244
this.listViewTableRow = this.listView.locator('uui-table-row');
@@ -269,7 +268,6 @@ export class ContentUiHelper extends UiBaseLocators {
269268
this.publicAccessBtn = page.getByRole('button', {name: 'Public Access'});
270269
this.uuiCheckbox = page.locator('uui-checkbox');
271270
this.sortBtn = page.getByLabel('Sort', {exact: true});
272-
this.modalChooseBtn = page.locator('umb-tree-picker-modal').getByLabel('Choose');
273271
this.containerSaveBtn = this.container.getByLabel('Save');
274272
this.groupBasedProtectionBtn = page.locator('span').filter({hasText: 'Group based protection'});
275273
this.nextBtn = page.getByLabel('Next');
@@ -278,9 +276,9 @@ export class ContentUiHelper extends UiBaseLocators {
278276
this.selectErrorPageDocument = page.locator('.select-item').filter({hasText: 'Error Page'}).locator('umb-input-document');
279277
this.rollbackItem = page.locator('.rollback-item');
280278
this.actionsMenu = page.locator('uui-scroll-container');
281-
this.linkToDocumentBtn = this.linkPickerModal.locator('[data-mark="action:document"] #button');
282-
this.linkToMediaBtn = this.linkPickerModal.locator('[data-mark="action:media"] #button');
283-
this.linkToManualBtn = this.linkPickerModal.locator('[data-mark="action:external"] #button');
279+
this.linkToDocumentBtn = this.linkPickerModal.getByTestId('action:document').locator('#button');
280+
this.linkToMediaBtn = this.linkPickerModal.getByTestId('action:media').locator('#button');
281+
this.linkToManualBtn = this.linkPickerModal.getByTestId('action:external').locator('#button');
284282
this.umbDocumentCollection = page.locator('umb-document-collection');
285283
this.documentTableColumnName = this.listView.locator('umb-document-table-column-name');
286284
//Block Grid - Block List
@@ -300,7 +298,7 @@ export class ContentUiHelper extends UiBaseLocators {
300298
this.workspaceEditTab = page.locator('umb-content-workspace-view-edit-tab');
301299
this.blockWorkspaceEditTab = page.locator('umb-block-workspace-view-edit-tab');
302300
this.workspaceEditProperties = page.locator('umb-content-workspace-view-edit-properties');
303-
this.openActionsMenu = page.getByLabel('Open actions menu');
301+
this.openActionsMenu = page.locator('#action-menu');
304302
this.replaceExactBtn = page.getByRole('button', {name: 'Replace', exact: true});
305303
this.clipboardEntryPicker = page.locator('umb-clipboard-entry-picker');
306304
this.blockGridAreasContainer = page.locator('umb-block-grid-areas-container');
@@ -322,9 +320,9 @@ export class ContentUiHelper extends UiBaseLocators {
322320
this.workspaceActionMenu = page.locator('umb-workspace-action-menu');
323321
this.workspaceActionMenuItem = page.locator('umb-workspace-action-menu-item');
324322
this.viewMoreOptionsBtn = this.workspaceActionMenu.locator('#popover-trigger');
325-
this.scheduleBtn = this.workspaceActionMenuItem.getByLabel('Schedule', {exact: true});
323+
this.schedulePublishBtn = this.workspaceActionMenuItem.getByLabel('Schedule publish', {exact: true});
326324
this.documentScheduleModal = page.locator('umb-document-schedule-modal');
327-
this.scheduleModalBtn = this.documentScheduleModal.getByLabel('Schedule', {exact: true});
325+
this.schedulePublishModalBtn = this.documentScheduleModal.getByLabel('Schedule publish', {exact: true});
328326
this.publishAtFormLayout = this.documentScheduleModal.locator('uui-form-layout-item').first();
329327
this.unpublishAtFormLayout = this.documentScheduleModal.locator('uui-form-layout-item').last();
330328
this.publishAtValidationMessage = this.publishAtFormLayout.locator('#messages');
@@ -1055,13 +1053,13 @@ export class ContentUiHelper extends UiBaseLocators {
10551053
await this.nextBtn.click();
10561054
await this.chooseMemberGroupBtn.click();
10571055
await this.page.getByLabel(memberGroupName).click();
1058-
await this.clickSubmitButton();
1056+
await this.clickChooseModalButton();
10591057
await this.selectLoginPageDocument.click();
10601058
await this.container.getByLabel(documentName, {exact: true}).click();
1061-
await this.modalChooseBtn.click();
1059+
await this.clickChooseModalButton();
10621060
await this.selectErrorPageDocument.click();
10631061
await this.container.getByLabel(documentName, {exact: true}).click();
1064-
await this.modalChooseBtn.click();
1062+
await this.clickChooseModalButton();
10651063
await this.containerSaveBtn.click();
10661064
}
10671065

@@ -1423,15 +1421,15 @@ export class ContentUiHelper extends UiBaseLocators {
14231421
}
14241422

14251423
async doesRichTextEditorBlockContainLabel(richTextEditorAlias: string, label: string) {
1426-
await expect(this.page.locator('[data-mark="property:' + richTextEditorAlias + '"]').locator(this.rteBlock)).toContainText(label);
1424+
await expect(this.page.getByTestId('property:' + richTextEditorAlias).locator(this.rteBlock)).toContainText(label);
14271425
}
14281426

14291427
async doesBlockEditorModalContainEditorSize(editorSize: string, elementName: string) {
14301428
await expect(this.backofficeModalContainer.locator('[size="' + editorSize + '"]').locator('[headline="Add ' + elementName + '"]')).toBeVisible();
14311429
}
14321430

14331431
async doesBlockEditorModalContainInline(richTextEditorAlias: string, elementName: string) {
1434-
await expect(this.page.locator('[data-mark="property:' + richTextEditorAlias + '"]').locator(this.tiptapInput).locator(this.rteBlockInline)).toContainText(elementName);
1432+
await expect(this.page.getByTestId('property:' + richTextEditorAlias).locator(this.tiptapInput).locator(this.rteBlockInline)).toContainText(elementName);
14351433
}
14361434

14371435
async doesBlockHaveBackgroundColor(elementName: string, backgroundColor: string) {
@@ -1456,14 +1454,14 @@ export class ContentUiHelper extends UiBaseLocators {
14561454
await this.viewMoreOptionsBtn.click();
14571455
}
14581456

1459-
async clickScheduleButton() {
1460-
await expect(this.scheduleBtn).toBeVisible();
1461-
await this.scheduleBtn.click();
1457+
async clickSchedulePublishButton() {
1458+
await expect(this.schedulePublishBtn).toBeVisible();
1459+
await this.schedulePublishBtn.click();
14621460
}
14631461

1464-
async clickScheduleModalButton() {
1465-
await expect(this.scheduleModalBtn).toBeVisible();
1466-
await this.scheduleModalBtn.click();
1462+
async clickSchedulePublishModalButton() {
1463+
await expect(this.schedulePublishModalBtn).toBeVisible();
1464+
await this.schedulePublishModalBtn.click();
14671465
}
14681466

14691467
async enterPublishTime(time: string, index: number = 0) {
@@ -1504,12 +1502,10 @@ export class ContentUiHelper extends UiBaseLocators {
15041502
}
15051503

15061504
async doesSchedulePublishModalButtonContainDisabledTag(hasDisabledTag: boolean = false) {
1507-
const button = this.page.locator('uui-button[label="Schedule"]');
1508-
15091505
if (!hasDisabledTag) {
1510-
return await expect(button).not.toHaveAttribute('disabled', '');
1506+
return await expect(this.schedulePublishModalBtn).not.toHaveAttribute('disabled', '');
15111507
}
1512-
return await expect(button).toHaveAttribute('disabled', '');
1508+
return await expect(this.schedulePublishModalBtn).toHaveAttribute('disabled', '');
15131509
}
15141510

15151511
async clickInlineBlockCaretButtonForName(blockEditorName: string, index: number = 0) {
@@ -1561,4 +1557,9 @@ export class ContentUiHelper extends UiBaseLocators {
15611557
async doesDocumentVariantLanguageItemHaveName(name: string) {
15621558
await expect(this.documentVariantLanguagePicker).toContainText(name);
15631559
}
1560+
1561+
async clickSchedulePublishLanguageButton(languageName: string) {
1562+
await expect(this.page.getByRole('menu').filter({hasText: languageName})).toBeVisible();
1563+
await this.page.getByRole('menu').filter({hasText: languageName}).click();
1564+
}
15641565
}

lib/helpers/CurrentUserProfileUiHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class CurrentUserProfileUiHelper extends UiBaseLocators {
66

77
constructor(page: Page) {
88
super(page);
9-
this.changePasswordBtn = page.getByLabel('Change password');
9+
this.changePasswordBtn = page.getByLabel('Change your password');
1010
}
1111

1212
async clickChangePasswordButton() {

0 commit comments

Comments
 (0)