Skip to content

Commit 25bc7bb

Browse files
victorg1991brianchandotcom
authored andcommitted
LPD-68645 Update test to check view mode
1 parent 3dbc9e8 commit 25bc7bb

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

modules/test/playwright/tests/site-cms-site-initializer/main/contentEditor.spec.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ const testWithRepeatableFF = mergeTests(
733733
testWithRepeatableFF(
734734
'Create item with repeatable groups',
735735
{
736-
tag: '@LPD-50378',
736+
tag: ['@LPD-50378', '@LPD-68645'],
737737
},
738738
async ({contentsPage, page, structureBuilderPage}) => {
739739

@@ -817,6 +817,22 @@ testWithRepeatableFF(
817817

818818
await contentsPage.saveContent();
819819

820+
// View content and check that the repeatable buttons are not showed
821+
822+
await contentsPage.viewContent(title);
823+
824+
expect(
825+
page
826+
.getByRole('dialog', {name: title})
827+
.frameLocator('iframe')
828+
.getByLabel('Add new')
829+
).not.toBeVisible();
830+
831+
await page
832+
.getByRole('dialog', {name: title})
833+
.getByRole('button', {name: 'close'})
834+
.click();
835+
820836
// Edit the content again and check values
821837

822838
await contentsPage.editContent(title);

modules/test/playwright/tests/site-cms-site-initializer/main/pages/ContentsPage.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,23 @@ export class ContentsPage {
237237
this.page.locator('.management-bar').getByText('Publish')
238238
).toBeVisible();
239239
}
240+
241+
async viewContent(title: string) {
242+
const card = this.page
243+
.locator('tr', {hasText: title})
244+
.or(this.page.locator('.card-row', {hasText: title}));
245+
246+
await clickAndExpectToBeVisible({
247+
autoClick: true,
248+
target: this.page.getByRole('menuitem', {
249+
exact: true,
250+
name: 'View',
251+
}),
252+
trigger: card.locator('button'),
253+
});
254+
255+
await expect(
256+
this.page.getByRole('dialog', {name: title})
257+
).toBeVisible();
258+
}
240259
}

0 commit comments

Comments
 (0)