Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V14 QA Added acceptance tests for rendering content with Dropdown, Radiobutton and ImageCropper #17357

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7385857
Added tests for rendering content with numeric
nhudinh0309 Oct 11, 2024
ba8fa65
Added tests for rendering content with textarea
nhudinh0309 Oct 11, 2024
0001d17
Merge branch 'v14/dev' into v14/QA/rendering-content/textarea-tests
nhudinh0309 Oct 15, 2024
add62b6
Added tests for rendering content with approved color
nhudinh0309 Oct 17, 2024
da71189
Added tests for rendering content with numeric
nhudinh0309 Oct 17, 2024
212f4e2
Added tests for rendering content with tags
nhudinh0309 Oct 17, 2024
b021788
Added tests for rendering content with textarea
nhudinh0309 Oct 17, 2024
13c609b
Updated tests for rendering content with textstring due to test helpe…
nhudinh0309 Oct 17, 2024
27d9ebe
Added tests for rendering content with truefalse
nhudinh0309 Oct 17, 2024
7b527d5
Bumped version of test helper
nhudinh0309 Oct 17, 2024
31055c9
Make all tests for rendering content run in the pipeline
nhudinh0309 Oct 17, 2024
438742a
Merge branch 'v14/dev' into v14/QA/rendering-content/textarea-truefal…
nhudinh0309 Oct 17, 2024
a7722a1
Merge branch 'v14/dev' into v14/QA/rendering-content/textarea-truefal…
nhudinh0309 Oct 18, 2024
a3cf5fc
Fixed comments
nhudinh0309 Oct 18, 2024
756a2b1
Removed blank lines
nhudinh0309 Oct 18, 2024
44df48f
Fixed name
nhudinh0309 Oct 18, 2024
26c7ebe
Merge branch 'v14/dev' into v14/QA/rendering-content/textarea-truefal…
nhudinh0309 Oct 22, 2024
fa5df0a
Make all smoke tests run in the pipeline
nhudinh0309 Oct 22, 2024
2967474
Merge branch 'v14/dev' into v14/QA/rendering-content/dropdown-label-r…
nhudinh0309 Oct 22, 2024
968c3fc
Added tests for rendering content with dropdown
nhudinh0309 Oct 22, 2024
0eff084
Added tests for rendering content with Image Cropper - not done
nhudinh0309 Oct 22, 2024
2012e6a
Updated tests for rendering content due to ui helper changes
nhudinh0309 Oct 22, 2024
081b666
Updated tests for rendering content with image cropper
nhudinh0309 Oct 25, 2024
d188d44
Merge branch 'v14/dev' into v14/QA/rendering-content/dropdown-radio-i…
nhudinh0309 Oct 25, 2024
c059f61
Updated tests due to the api helper changes
nhudinh0309 Oct 25, 2024
d71b979
Bumped version of test helper
nhudinh0309 Oct 25, 2024
ba3a216
Make all the tests for rendering content run in the pipeline
nhudinh0309 Oct 25, 2024
4641ae6
Removed blank lines
nhudinh0309 Oct 25, 2024
c4cc694
Format code
nhudinh0309 Oct 25, 2024
559876e
Fixed test name
nhudinh0309 Oct 25, 2024
d26b93e
Reverted
nhudinh0309 Oct 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions tests/Umbraco.Tests.AcceptanceTest/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/Umbraco.Tests.AcceptanceTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"typescript": "^4.8.3"
},
"dependencies": {
"@umbraco/json-models-builders": "^2.0.22",
"@umbraco/playwright-testhelpers": "^2.0.0-beta.92",
"@umbraco/json-models-builders": "^2.0.23",
"@umbraco/playwright-testhelpers": "^2.0.0-beta.95",
"camelize": "^1.0.0",
"dotenv": "^16.3.1",
"node-fetch": "^2.6.7"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ test('can render content with an approved color without label', async ({umbracoA

// Assert
await umbracoUi.contentRender.doesContentRenderValueContainText(colorValue.value);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ for (const checkbox of checkboxList) {
// Arrange
const checkboxValue = checkbox.value;
const dataTypeId = await umbracoApi.dataType.createCheckboxListDataType(customDataTypeName, checkboxValue);
const templateId = await umbracoApi.template.createTemplateWithDisplayingCheckboxListValue(templateName, AliasHelper.toAlias(propertyName));
const templateId = await umbracoApi.template.createTemplateWithDisplayingMulitpleStringValue(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;
Expand All @@ -37,4 +37,4 @@ for (const checkbox of checkboxList) {
await umbracoUi.contentRender.doesContentRenderValueContainText(value);
});
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import {AliasHelper, test} from '@umbraco/playwright-testhelpers';

const contentName = 'Test Rendering Content';
const documentTypeName = 'TestDocumentTypeForContent';
const customDataTypeName = 'Custom Dropdown';
const templateName = 'TestTemplateForContent';
const propertyName = 'Test Dropdown';

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 dropdownValues = [
{type: 'an empty dropdown list', value: [], isMultiple: false},
{type: 'a single dropdown value', value: ['Test checkbox'], isMultiple: false},
{type: 'multiple dropdown values', value: ['Test option 1', 'Test option 2'], isMultiple: true}
];

for (const dropdown of dropdownValues) {
test(`can render content with ${dropdown.type}`, async ({umbracoApi, umbracoUi}) => {
// Arrange
const dataTypeId = await umbracoApi.dataType.createDropdownDataType(customDataTypeName, dropdown.isMultiple, dropdown.value);
let templateId = '';
if (dropdown.isMultiple) {
templateId = await umbracoApi.template.createTemplateWithDisplayingMulitpleStringValue(templateName, AliasHelper.toAlias(propertyName));
} else {
templateId = await umbracoApi.template.createTemplateWithDisplayingStringValue(templateName, AliasHelper.toAlias(propertyName));
}
await umbracoApi.document.createPublishedDocumentWithValue(contentName, dropdown.value, dataTypeId, templateId, propertyName, documentTypeName);
const contentData = await umbracoApi.document.getByName(contentName);
const contentURL = contentData.urls[0].url;

// Act
await umbracoUi.contentRender.navigateToRenderedContentPage(contentURL);

// Assert
dropdown.value.forEach(async value => {
await umbracoUi.contentRender.doesContentRenderValueContainText(value);
});
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {AliasHelper, test} from '@umbraco/playwright-testhelpers';

const contentName = 'Test Rendering Content';
const documentTypeName = 'TestDocumentTypeForContent';
const customDataTypeName = 'Custom Image Cropper';
const templateName = 'TestTemplateForContent';
const propertyName = 'Test Image Cropper';
const cropLabel = 'Test Crop';
const cropValue = {label: cropLabel, alias: AliasHelper.toAlias(cropLabel), width: 500, height: 700};
let dataTypeId = null;

test.beforeEach(async ({umbracoApi}) => {
dataTypeId = await umbracoApi.dataType.createImageCropperDataTypeWithOneCrop(customDataTypeName, cropValue.label, cropValue.width, cropValue.height);
});

test.afterEach(async ({umbracoApi}) => {
await umbracoApi.document.ensureNameNotExists(contentName);
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
await umbracoApi.template.ensureNameNotExists(templateName);
await umbracoApi.dataType.ensureNameNotExists(customDataTypeName);
});

test('can render content with an image cropper', async ({umbracoApi, umbracoUi}) => {
// Arrange
const templateId = await umbracoApi.template.createTemplateWithDisplayingImageCropperValue(templateName, AliasHelper.toAlias(propertyName), AliasHelper.toAlias(cropValue.label));
await umbracoApi.document.createPublishedDocumentWithImageCropper(contentName, cropValue, dataTypeId, templateId, propertyName, documentTypeName);
const contentData = await umbracoApi.document.getByName(contentName);
const contentURL = contentData.urls[0].url;
const imageSrc = contentData.values[0].value.src;

// Act
await umbracoUi.contentRender.navigateToRenderedContentPage(contentURL);

// Assert
await umbracoUi.contentRender.doesContentRenderValueHaveImage(imageSrc, cropValue.width, cropValue.height);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {AliasHelper, test} from '@umbraco/playwright-testhelpers';

const contentName = 'Test Rendering Content';
const documentTypeName = 'TestDocumentTypeForContent';
const customDataTypeName = 'Custom Radiobox';
const templateName = 'TestTemplateForContent';
const propertyName = 'Test Radiobox';

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 radioboxValues = [
{type: 'an empty radiobox', value: ''},
{type: 'a radiobox value', value: 'Test radiobox option'}
];

for (const radiobox of radioboxValues) {
test(`can render content with ${radiobox.type}`, async ({umbracoApi, umbracoUi}) => {
// Arrange
const dataTypeId = await umbracoApi.dataType.createRadioboxDataType(customDataTypeName, [radiobox.value]);
const templateId = await umbracoApi.template.createTemplateWithDisplayingStringValue(templateName, AliasHelper.toAlias(propertyName));
await umbracoApi.document.createPublishedDocumentWithValue(contentName, radiobox.value, dataTypeId, 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(radiobox.value);
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ for (const tag of tags) {
test(`can render content with ${tag.type}`, async ({umbracoApi, umbracoUi}) => {
// Arrange
const tagValue = tag.value;
const templateId = await umbracoApi.template.createTemplateWithDisplayingTagsValue(templateName, AliasHelper.toAlias(propertyName));
const templateId = await umbracoApi.template.createTemplateWithDisplayingMulitpleStringValue(templateName, AliasHelper.toAlias(propertyName));
await umbracoApi.document.createPublishedDocumentWithValue(contentName, tagValue, dataTypeData.id, templateId, propertyName, documentTypeName);
const contentData = await umbracoApi.document.getByName(contentName);
const contentURL = contentData.urls[0].url;
Expand Down
Loading