forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LPD-23390 Test if all persisted notifications are visible in the combo
- Loading branch information
1 parent
d80d388
commit 4d1c84d
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
modules/test/playwright/tests/object-web/objectActions.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} | ||
}); | ||
}); |