-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing running test on pipeline after some configuration (#30932)
### Proposed Changes * Content Search Portlet integrity test * Content Editing tests ### Checklist - [x] Tests
- Loading branch information
Showing
7 changed files
with
253 additions
and
39 deletions.
There are no files selected for viewing
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
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
12 changes: 9 additions & 3 deletions
12
e2e/dotcms-e2e-node/frontend/tests/contentSearch/contentData.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 |
---|---|---|
@@ -1,17 +1,23 @@ | ||
/** | ||
* Content to add a Rich Text content | ||
*/ | ||
export const richTextContent = { | ||
export const genericContent1 = { | ||
title: "Automation Test", | ||
body: "This is a sample content" | ||
body: "This is a sample content", | ||
newTitle : "Automation Test edited", | ||
newBody : "This is a sample content edited" | ||
} | ||
|
||
/** | ||
* Content actions text content locators | ||
*/ | ||
export const contentProperties = { | ||
language: "English (US)", | ||
publishWfAction: "Publish" | ||
publishWfAction: "Publish", | ||
unpublishWfAction: "Unpublish", | ||
unlockWfAction: "Unlock", | ||
archiveWfAction: "Archive", | ||
deleteWfAction: "Delete" | ||
} | ||
|
||
|
77 changes: 77 additions & 0 deletions
77
e2e/dotcms-e2e-node/frontend/tests/contentSearch/contentEditing.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,77 @@ | ||
import {expect, test} from '@playwright/test'; | ||
import {dotCMSUtils, waitForVisibleAndCallback} from '../../utils/dotCMSUtils'; | ||
import { | ||
GroupEntriesLocators, | ||
MenuEntriesLocators, | ||
ToolEntriesLocators | ||
} from '../../locators/navigation/menuLocators'; | ||
import {ContentUtils} from "../../utils/contentUtils"; | ||
import {iFramesLocators, contentGeneric} from "../../locators/globalLocators"; | ||
import {genericContent1, contentProperties} from "./contentData"; | ||
import {assert} from "console"; | ||
|
||
const cmsUtils = new dotCMSUtils(); | ||
|
||
/** | ||
* Test to navigate to the content portlet and login to the dotCMS instance | ||
* @param page | ||
*/ | ||
test.beforeEach('Navigate to content portlet', async ({page}) => { | ||
// Instance the menu Navigation locators | ||
const menuLocators = new MenuEntriesLocators(page); | ||
const groupsLocators = new GroupEntriesLocators(page); | ||
const toolsLocators = new ToolEntriesLocators(page); | ||
|
||
// Get the username and password from the environment variables | ||
const username = process.env.USERNAME as string; | ||
const password = process.env.PASSWORD as string; | ||
|
||
// Login to dotCMS | ||
await cmsUtils.login(page, username, password); | ||
await cmsUtils.navigate(menuLocators.EXPAND, groupsLocators.CONTENT, toolsLocators.SEARCH_ALL); | ||
|
||
// Validate the portlet title | ||
const breadcrumbLocator = page.locator('p-breadcrumb'); | ||
await waitForVisibleAndCallback(breadcrumbLocator, () => expect(breadcrumbLocator).toContainText('Search All')); | ||
}); | ||
|
||
|
||
test('Add a new pice of content', async ({page}) => { | ||
const contentUtils = new ContentUtils(page); | ||
const iframe = page.frameLocator(iFramesLocators.main_iframe); | ||
|
||
// Adding new rich text content | ||
await contentUtils.addNewContentAction(page, contentGeneric.locator, contentGeneric.label); | ||
await contentUtils.fillRichTextForm(page, genericContent1.title, genericContent1.body, contentProperties.publishWfAction); | ||
await waitForVisibleAndCallback(iframe.locator('#results_table tbody tr').first(), async () => {}); | ||
|
||
await contentUtils.validateContentExist(page, genericContent1.title).then(assert); | ||
}); | ||
|
||
/** | ||
* Test to edit an existing piece of content | ||
*/ | ||
test('Edit a piece of content', async ({page}) => { | ||
const contentUtils = new ContentUtils(page); | ||
const iframe = page.frameLocator(iFramesLocators.main_iframe); | ||
|
||
// Edit the content | ||
await contentUtils.editContent(page, genericContent1.title, genericContent1.newTitle, genericContent1.newBody, contentProperties.publishWfAction); | ||
await waitForVisibleAndCallback(iframe.locator('#results_table tbody tr').first(), async () => {}); | ||
|
||
await contentUtils.validateContentExist(page, genericContent1.newTitle).then(assert); | ||
}); | ||
|
||
|
||
/** | ||
* Test to delete an existing piece of content | ||
*/ | ||
test('Delete a piece of content', async ({ page }) => { | ||
const contentUtils = new ContentUtils(page); | ||
// Delete the content | ||
await contentUtils.deleteContent(page, genericContent1.newTitle); | ||
} | ||
); | ||
|
||
|
||
|
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
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
Oops, something went wrong.