-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
V14 QA Added tests for rendering content with checkboxlist and date p…
…icker (#17332) * Added tests for rendering content with numeric * Added tests for rendering content with textarea * Added tests for rendering content with approved color * Added tests for rendering content with numeric * Added tests for rendering content with tags * Added tests for rendering content with textarea * Updated tests for rendering content with textstring due to test helper changes * Added tests for rendering content with truefalse * Added tests for rendering content with checkbox list * Added tests for rendering content with date picker - not done * Updated tests for rendering content with date picker * Updated tests for rendering content due to ui helper changes * Bumped version * Removed blank lines * Make Rendering Content tests run in the pipeline * Changed method name due to test helper changes * Reverted
- Loading branch information
1 parent
aa9f194
commit 11ccafe
Showing
10 changed files
with
94 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
40 changes: 40 additions & 0 deletions
40
...eptanceTest/tests/DefaultConfig/RenderingContent/RenderingContentWithCheckboxList.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,40 @@ | ||
import {AliasHelper, test} from '@umbraco/playwright-testhelpers'; | ||
|
||
const contentName = 'Test Rendering Content'; | ||
const documentTypeName = 'TestDocumentTypeForContent'; | ||
const customDataTypeName = 'Custom Checkbox List'; | ||
const templateName = 'TestTemplateForContent'; | ||
const propertyName = 'Test Checkbox List'; | ||
|
||
test.afterEach(async ({umbracoApi}) => { | ||
await umbracoApi.document.ensureNameNotExists(contentName); | ||
await umbracoApi.documentType.ensureNameNotExists(documentTypeName); | ||
await umbracoApi.template.ensureNameNotExists(templateName); | ||
await umbracoApi.dataType.ensureNameNotExists(customDataTypeName); | ||
}); | ||
|
||
const checkboxList = [ | ||
{type: 'an empty list of checkboxes', value: []}, | ||
{type: 'one checkbox', value: ['Test checkbox']}, | ||
{type: 'multiple checkboxes', value: ['Test checkbox 1', 'Test checkbox 2', 'Test checkbox 3']}, | ||
]; | ||
|
||
for (const checkbox of checkboxList) { | ||
test(`can render content with ${checkbox.type}`, async ({umbracoApi, umbracoUi}) => { | ||
// Arrange | ||
const checkboxValue = checkbox.value; | ||
const dataTypeId = await umbracoApi.dataType.createCheckboxListDataType(customDataTypeName, checkboxValue); | ||
const templateId = await umbracoApi.template.createTemplateWithDisplayingCheckboxListValue(templateName, AliasHelper.toAlias(propertyName)); | ||
await umbracoApi.document.createPublishedDocumentWithValue(contentName, checkboxValue, dataTypeId, templateId, propertyName, documentTypeName); | ||
const contentData = await umbracoApi.document.getByName(contentName); | ||
const contentURL = contentData.urls[0].url; | ||
|
||
// Act | ||
await umbracoUi.contentRender.navigateToRenderedContentPage(contentURL); | ||
|
||
// Assert | ||
checkboxValue.forEach(async value => { | ||
await umbracoUi.contentRender.doesContentRenderValueContainText(value); | ||
}); | ||
}); | ||
} |
35 changes: 35 additions & 0 deletions
35
...cceptanceTest/tests/DefaultConfig/RenderingContent/RenderingContentWithDatePicker.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,35 @@ | ||
import {AliasHelper, test} from '@umbraco/playwright-testhelpers'; | ||
|
||
const contentName = 'Test Rendering Content'; | ||
const documentTypeName = 'TestDocumentTypeForContent'; | ||
const templateName = 'TestTemplateForContent'; | ||
const propertyName = 'Test Date Picker'; | ||
|
||
test.afterEach(async ({umbracoApi}) => { | ||
await umbracoApi.document.ensureNameNotExists(contentName); | ||
await umbracoApi.documentType.ensureNameNotExists(documentTypeName); | ||
await umbracoApi.template.ensureNameNotExists(templateName); | ||
}); | ||
|
||
const dateTimes = [ | ||
{type: 'with AM time', value: '2024-10-29 09:09:09', expectedValue: '10/29/2024 9:09:09 AM', dataTypeName: 'Date Picker with time'}, | ||
{type: 'with PM time', value: '2024-10-29 21:09:09', expectedValue: '10/29/2024 9:09:09 PM', dataTypeName: 'Date Picker with time'}, | ||
// TODO: Uncomment this when the front-end is ready. Currently the time still be rendered. | ||
//{type: 'without time', value: '2024-10-29 00:00:00', expectedValue: '10/29/2024', dataTypeName: 'Date Picker'} | ||
]; | ||
|
||
for (const dateTime of dateTimes) { | ||
test(`can render content with a date ${dateTime.type}`, async ({umbracoApi, umbracoUi}) => { | ||
const dataTypeData = await umbracoApi.dataType.getByName(dateTime.dataTypeName); | ||
const templateId = await umbracoApi.template.createTemplateWithDisplayingStringValue(templateName, AliasHelper.toAlias(propertyName)); | ||
await umbracoApi.document.createPublishedDocumentWithValue(contentName, dateTime.value, dataTypeData.id, templateId, propertyName, documentTypeName); | ||
const contentData = await umbracoApi.document.getByName(contentName); | ||
const contentURL = contentData.urls[0].url; | ||
|
||
// Act | ||
await umbracoUi.contentRender.navigateToRenderedContentPage(contentURL); | ||
|
||
// Assert | ||
await umbracoUi.contentRender.doesContentRenderValueContainText(dateTime.expectedValue, true); | ||
}); | ||
} |
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
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
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