Skip to content

Commit

Permalink
LPD-23390 Test if all persisted notifications are visible in the combo
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-oliveira446 authored and brianchandotcom committed May 2, 2024
1 parent d80d388 commit 4d1c84d
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions modules/test/playwright/tests/object-web/objectActions.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { expect, mergeTests } from "@playwright/test";
import { apiHelpersTest } from "../../fixtures/apiHelpersTest";
import { loginTest } from "../../fixtures/loginTest";
import { objectPagesTest } from "../../fixtures/objectPagesTest";
import { getRandomInt } from "../../utils/getRandomInt";
import { editObjectDefinitionPagesTest } from "../../fixtures/editObjectDefinitionPagesTest";

export const test = mergeTests(apiHelpersTest, editObjectDefinitionPagesTest,loginTest(), objectPagesTest);

test.describe('manage object actions through object actions tab', () => {
test('notification action section must display all persisted notifications', async ({
actionBuilderPage,
apiHelpers,
editObjectDefinitionPage,
page,
sidePanelObjectActionPage,
viewObjectActionsPage,
viewObjectDefinitionsPage,
}) => {
const ids: number[] = [];
const names: string[] = [];

for(let index=1;index <= 21;index++){
const notificationTemplate = await apiHelpers.notification.postRandomNotificationTemplate(
"notification template test " + getRandomInt()
)
ids.push(notificationTemplate.id)
names.push(notificationTemplate.name + " " + notificationTemplate.type)
}

const objectDefinition =
await apiHelpers.objectAdmin.postRandomObjectDefinition(
'default'
);

await viewObjectDefinitionsPage.goto()

await viewObjectDefinitionsPage.clickEditObjectDefinitionLink(objectDefinition.name);

await editObjectDefinitionPage.openActionsTab();

await viewObjectActionsPage.openObjectActionSidePanel();

await sidePanelObjectActionPage.openActionBuilderTab();

await actionBuilderPage.chooseNotificationOption();

await actionBuilderPage.clickInputNotificationsCombo();

for (let index = 0; index < names.length; index++) {
await expect(
page.frameLocator('iframe').getByRole('option', { name: names[index] })
).toBeVisible();
}

// Clean up

await apiHelpers.objectAdmin.deleteObjectDefinition(objectDefinition.id);

for (let index = 0; index < ids.length; index++) {
await apiHelpers.notification.deleteNotificationTemplate(ids[index]);
}
});
});

0 comments on commit 4d1c84d

Please sign in to comment.