V16 Added acceptance tests for regression issues (#19874)

* Updated the block editor validation message

* Updated tests for schedule publishing after unselecting all languages

* Added tests for sibdlingsOfType extension

* Updated tests due to test helper changes

* Bumped version of test helper

* Added release tag for regression issue

* Make tests for siblingsOfType run in the pipeline

* Reverted npm command
This commit is contained in:
Nhu Dinh
2025-08-07 15:42:55 +07:00
committed by GitHub
parent 44aa5dcf1c
commit 3f34c8f433
6 changed files with 49 additions and 10 deletions

View File

@@ -8,7 +8,7 @@
"hasInstallScript": true,
"dependencies": {
"@umbraco/json-models-builders": "^2.0.37",
"@umbraco/playwright-testhelpers": "^16.0.32",
"@umbraco/playwright-testhelpers": "^16.0.33",
"camelize": "^1.0.0",
"dotenv": "^16.3.1",
"node-fetch": "^2.6.7"
@@ -67,9 +67,9 @@
}
},
"node_modules/@umbraco/playwright-testhelpers": {
"version": "16.0.32",
"resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-16.0.32.tgz",
"integrity": "sha512-HB/xHnu36XOyQjNnpSe1j9DoZ61tY7OvnkNQT73MhGcrhfnNdn/Hf+6nFN7gutUTcxn+L6COeXzexQclSjYr+g==",
"version": "16.0.33",
"resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-16.0.33.tgz",
"integrity": "sha512-sqUWuGmKwfhvQ+mmDCQwIWRu07tGVILuQaVs4dF1R7Z3KGPsQY0PKIulzDSgOyTHZLUnlxQudtr4i0alm3XHgQ==",
"dependencies": {
"@umbraco/json-models-builders": "2.0.37",
"node-fetch": "^2.6.7"

View File

@@ -22,7 +22,7 @@
},
"dependencies": {
"@umbraco/json-models-builders": "^2.0.37",
"@umbraco/playwright-testhelpers": "^16.0.32",
"@umbraco/playwright-testhelpers": "^16.0.33",
"camelize": "^1.0.0",
"dotenv": "^16.3.1",
"node-fetch": "^2.6.7"

View File

@@ -96,6 +96,7 @@ test('can add a block element in the content', async ({umbracoApi, umbracoUi}) =
});
test('can edit block element in the content', async ({umbracoApi, umbracoUi}) => {
// Arrange
const updatedText = 'This updated block test';
await umbracoApi.document.createDefaultDocumentWithABlockGridEditor(contentName, elementTypeId, documentTypeName, customDataTypeName);
await umbracoUi.goToBackOffice();
@@ -115,6 +116,7 @@ test('can edit block element in the content', async ({umbracoApi, umbracoUi}) =>
});
test('can delete block element in the content', async ({umbracoApi, umbracoUi}) => {
// Arrange
await umbracoApi.document.createDefaultDocumentWithABlockGridEditor(contentName, elementTypeId, documentTypeName, customDataTypeName);
await umbracoUi.goToBackOffice();
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
@@ -147,7 +149,7 @@ test('cannot add block element if allow in root is disabled', async ({umbracoApi
await umbracoUi.content.isAddBlockElementButtonVisible(false);
});
test('cannot add number of block element greater than the maximum amount', async ({umbracoApi, umbracoUi}) => {
test('cannot add number of block element greater than the maximum amount', {tag: '@release'}, async ({umbracoApi, umbracoUi}) => {
// Arrange
const customDataTypeId = await umbracoApi.dataType.createBlockGridWithABlockAndMinAndMaxAmount(customDataTypeName, elementTypeId, 0, 0);
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, customDataTypeName, customDataTypeId);
@@ -163,8 +165,7 @@ test('cannot add number of block element greater than the maximum amount', async
await umbracoUi.content.clickCreateModalButton();
// Assert
await umbracoUi.content.doesFormValidationMessageContainText('Maximum');
await umbracoUi.content.doesFormValidationMessageContainText('too many');
await umbracoUi.content.doesFormValidationMessageContainText('Maximum 0 entries, you have entered 1 too many.');
});
test('can set the label of create button in root', async ({umbracoApi, umbracoUi}) => {

View File

@@ -153,8 +153,7 @@ test('cannot add number of block element greater than the maximum amount', async
await umbracoUi.content.clickCreateModalButton();
// Assert
await umbracoUi.content.doesFormValidationMessageContainText('Maximum');
await umbracoUi.content.doesFormValidationMessageContainText('too many');
await umbracoUi.content.doesFormValidationMessageContainText('Maximum 1 entries, you have entered 1 too many.');
});
test('can set the label of block element in the content', async ({umbracoApi, umbracoUi}) => {

View File

@@ -38,4 +38,5 @@ test('can schedule publish after unselecting all languages', async ({umbracoUi})
// Assert
await umbracoUi.content.doesSchedulePublishModalButtonContainDisabledTag(false);
await umbracoUi.content.clickSchedulePublishModalButton();
});

View File

@@ -0,0 +1,38 @@
import {test} from '@umbraco/playwright-testhelpers';
// Content
const contentName = 'Test Content';
const secondContentName = 'SecondContent';
// Document Type
const documentTypeName = 'DocumentTypeForContent';
const secondDocumentTypeName = 'TestSecondType';
// Template
const templateName = 'TestTemplateForContent';
test.afterEach(async ({umbracoApi}) => {
await umbracoApi.document.ensureNameNotExists(contentName);
await umbracoApi.document.ensureNameNotExists(secondContentName);
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
await umbracoApi.documentType.ensureNameNotExists(secondDocumentTypeName);
await umbracoApi.template.ensureNameNotExists(templateName);
});
test('can get a sibling of a content item of a different content type using SiblingsOfType method', {tag: '@release'}, async ({umbracoApi, umbracoUi}) => {
// Arrange
const secondDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentTypeWithAllowAsRoot(secondDocumentTypeName);
const secondContentId = await umbracoApi.document.createDefaultDocument(secondContentName, secondDocumentTypeId);
await umbracoApi.document.publish(secondContentId);
const templateId = await umbracoApi.template.createTemplateUsingSiblingOfTypeMethod(templateName, secondDocumentTypeName);
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedTemplate(documentTypeName, templateId, true);
const contentId = await umbracoApi.document.createDocumentWithTemplate(contentName, documentTypeId, templateId);
await umbracoApi.document.publish(contentId);
const contentURL = await umbracoApi.document.getDocumentUrl(contentId);
// Act
await umbracoUi.contentRender.navigateToRenderedContentPage(contentURL);
// Assert
await umbracoUi.contentRender.doesContentRenderValueContainText(secondContentName, true);
});