Skip to content

Commit 3f34c8f

Browse files
authored
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
1 parent 44aa5dc commit 3f34c8f

File tree

6 files changed

+49
-10
lines changed

6 files changed

+49
-10
lines changed

tests/Umbraco.Tests.AcceptanceTest/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Umbraco.Tests.AcceptanceTest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"dependencies": {
2424
"@umbraco/json-models-builders": "^2.0.37",
25-
"@umbraco/playwright-testhelpers": "^16.0.32",
25+
"@umbraco/playwright-testhelpers": "^16.0.33",
2626
"camelize": "^1.0.0",
2727
"dotenv": "^16.3.1",
2828
"node-fetch": "^2.6.7"

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/ContentWithBlockGrid.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ test('can add a block element in the content', async ({umbracoApi, umbracoUi}) =
9696
});
9797

9898
test('can edit block element in the content', async ({umbracoApi, umbracoUi}) => {
99+
// Arrange
99100
const updatedText = 'This updated block test';
100101
await umbracoApi.document.createDefaultDocumentWithABlockGridEditor(contentName, elementTypeId, documentTypeName, customDataTypeName);
101102
await umbracoUi.goToBackOffice();
@@ -115,6 +116,7 @@ test('can edit block element in the content', async ({umbracoApi, umbracoUi}) =>
115116
});
116117

117118
test('can delete block element in the content', async ({umbracoApi, umbracoUi}) => {
119+
// Arrange
118120
await umbracoApi.document.createDefaultDocumentWithABlockGridEditor(contentName, elementTypeId, documentTypeName, customDataTypeName);
119121
await umbracoUi.goToBackOffice();
120122
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
@@ -147,7 +149,7 @@ test('cannot add block element if allow in root is disabled', async ({umbracoApi
147149
await umbracoUi.content.isAddBlockElementButtonVisible(false);
148150
});
149151

150-
test('cannot add number of block element greater than the maximum amount', async ({umbracoApi, umbracoUi}) => {
152+
test('cannot add number of block element greater than the maximum amount', {tag: '@release'}, async ({umbracoApi, umbracoUi}) => {
151153
// Arrange
152154
const customDataTypeId = await umbracoApi.dataType.createBlockGridWithABlockAndMinAndMaxAmount(customDataTypeName, elementTypeId, 0, 0);
153155
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
163165
await umbracoUi.content.clickCreateModalButton();
164166

165167
// Assert
166-
await umbracoUi.content.doesFormValidationMessageContainText('Maximum');
167-
await umbracoUi.content.doesFormValidationMessageContainText('too many');
168+
await umbracoUi.content.doesFormValidationMessageContainText('Maximum 0 entries, you have entered 1 too many.');
168169
});
169170

170171
test('can set the label of create button in root', async ({umbracoApi, umbracoUi}) => {

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/ContentWithBlockList.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ test('cannot add number of block element greater than the maximum amount', async
153153
await umbracoUi.content.clickCreateModalButton();
154154

155155
// Assert
156-
await umbracoUi.content.doesFormValidationMessageContainText('Maximum');
157-
await umbracoUi.content.doesFormValidationMessageContainText('too many');
156+
await umbracoUi.content.doesFormValidationMessageContainText('Maximum 1 entries, you have entered 1 too many.');
158157
});
159158

160159
test('can set the label of block element in the content', async ({umbracoApi, umbracoUi}) => {

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/IssueWithScheduledPublishing.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ test('can schedule publish after unselecting all languages', async ({umbracoUi})
3838

3939
// Assert
4040
await umbracoUi.content.doesSchedulePublishModalButtonContainDisabledTag(false);
41+
await umbracoUi.content.clickSchedulePublishModalButton();
4142
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import {test} from '@umbraco/playwright-testhelpers';
2+
3+
// Content
4+
const contentName = 'Test Content';
5+
const secondContentName = 'SecondContent';
6+
7+
// Document Type
8+
const documentTypeName = 'DocumentTypeForContent';
9+
const secondDocumentTypeName = 'TestSecondType';
10+
11+
// Template
12+
const templateName = 'TestTemplateForContent';
13+
14+
test.afterEach(async ({umbracoApi}) => {
15+
await umbracoApi.document.ensureNameNotExists(contentName);
16+
await umbracoApi.document.ensureNameNotExists(secondContentName);
17+
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
18+
await umbracoApi.documentType.ensureNameNotExists(secondDocumentTypeName);
19+
await umbracoApi.template.ensureNameNotExists(templateName);
20+
});
21+
22+
test('can get a sibling of a content item of a different content type using SiblingsOfType method', {tag: '@release'}, async ({umbracoApi, umbracoUi}) => {
23+
// Arrange
24+
const secondDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentTypeWithAllowAsRoot(secondDocumentTypeName);
25+
const secondContentId = await umbracoApi.document.createDefaultDocument(secondContentName, secondDocumentTypeId);
26+
await umbracoApi.document.publish(secondContentId);
27+
const templateId = await umbracoApi.template.createTemplateUsingSiblingOfTypeMethod(templateName, secondDocumentTypeName);
28+
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedTemplate(documentTypeName, templateId, true);
29+
const contentId = await umbracoApi.document.createDocumentWithTemplate(contentName, documentTypeId, templateId);
30+
await umbracoApi.document.publish(contentId);
31+
const contentURL = await umbracoApi.document.getDocumentUrl(contentId);
32+
33+
// Act
34+
await umbracoUi.contentRender.navigateToRenderedContentPage(contentURL);
35+
36+
// Assert
37+
await umbracoUi.contentRender.doesContentRenderValueContainText(secondContentName, true);
38+
});

0 commit comments

Comments
 (0)