Skip to content

Commit d31b88b

Browse files
authored
V16 Added acceptance tests for the regression issue #19529 (#19713)
* Added tests for regression issue that cannot create a variant document blueprint * Make tests run in the pipeline * Reverted npm command
1 parent 0442ddc commit d31b88b

File tree

1 file changed

+35
-6
lines changed

1 file changed

+35
-6
lines changed

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentBlueprint/DocumentBlueprint.spec.ts

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ import {expect} from "@playwright/test";
33

44
const documentBlueprintName = 'TestDocumentBlueprints';
55
const documentTypeName = 'DocumentTypeForBlueprint';
6-
let documentTypeId = '';
76

8-
test.beforeEach(async ({umbracoApi, umbracoUi}) => {
7+
test.beforeEach(async ({umbracoApi}) => {
98
await umbracoApi.documentBlueprint.ensureNameNotExists(documentBlueprintName);
109
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
11-
documentTypeId = await umbracoApi.documentType.createDefaultDocumentType(documentTypeName);
12-
await umbracoUi.goToBackOffice();
1310
});
1411

1512
test.afterEach(async ({umbracoApi}) => {
@@ -19,6 +16,8 @@ test.afterEach(async ({umbracoApi}) => {
1916

2017
test('can create a document blueprint from the settings menu', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
2118
// Arrange
19+
await umbracoApi.documentType.createDefaultDocumentType(documentTypeName);
20+
await umbracoUi.goToBackOffice();
2221
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);
2322

2423
// Act
@@ -29,17 +28,19 @@ test('can create a document blueprint from the settings menu', {tag: '@smoke'},
2928
await umbracoUi.documentBlueprint.clickSaveButton();
3029

3130
// Assert
32-
await umbracoUi.documentBlueprint.waitForDocumentBlueprintToBeCreated()
31+
await umbracoUi.documentBlueprint.waitForDocumentBlueprintToBeCreated();
3332
expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy();
3433
await umbracoUi.documentBlueprint.isDocumentBlueprintRootTreeItemVisible(documentBlueprintName, true);
3534
});
3635

3736
test('can rename a document blueprint', async ({umbracoApi, umbracoUi}) => {
3837
// Arrange
38+
const documentTypeId = await umbracoApi.documentType.createDefaultDocumentType(documentTypeName);
3939
const wrongDocumentBlueprintName = 'Wrong Document Blueprint';
4040
await umbracoApi.documentBlueprint.ensureNameNotExists(wrongDocumentBlueprintName);
4141
await umbracoApi.documentBlueprint.createDefaultDocumentBlueprint(wrongDocumentBlueprintName, documentTypeId);
4242
expect(await umbracoApi.documentBlueprint.doesNameExist(wrongDocumentBlueprintName)).toBeTruthy();
43+
await umbracoUi.goToBackOffice();
4344
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);
4445

4546
// Act
@@ -57,8 +58,10 @@ test('can rename a document blueprint', async ({umbracoApi, umbracoUi}) => {
5758

5859
test('can delete a document blueprint', async ({umbracoApi, umbracoUi}) => {
5960
// Arrange
61+
const documentTypeId = await umbracoApi.documentType.createDefaultDocumentType(documentTypeName);
6062
await umbracoApi.documentBlueprint.createDefaultDocumentBlueprint(documentBlueprintName, documentTypeId);
6163
expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy();
64+
await umbracoUi.goToBackOffice();
6265
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);
6366

6467
// Act
@@ -75,9 +78,9 @@ test('can delete a document blueprint', async ({umbracoApi, umbracoUi}) => {
7578

7679
test('can create a document blueprint from the content menu', async ({umbracoApi, umbracoUi}) => {
7780
// Arrange
78-
const documentTypeName = 'DocumentTypeForContent';
7981
const documentTypeId = await umbracoApi.documentType.createDefaultDocumentTypeWithAllowAsRoot(documentTypeName);
8082
await umbracoApi.document.createDefaultDocument(documentBlueprintName, documentTypeId);
83+
await umbracoUi.goToBackOffice();
8184
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
8285

8386
// Act
@@ -94,3 +97,29 @@ test('can create a document blueprint from the content menu', async ({umbracoApi
9497
// Clean
9598
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
9699
});
100+
101+
test('can create a variant document blueprint', {tag: '@release'}, async ({umbracoApi, umbracoUi}) => {
102+
// Arrange
103+
await umbracoApi.language.createDanishLanguage();
104+
await umbracoApi.documentType.createDocumentTypeWithAllowVaryByCulture(documentTypeName);
105+
await umbracoUi.goToBackOffice();
106+
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);
107+
108+
// Act
109+
await umbracoUi.documentBlueprint.clickActionsMenuAtRoot();
110+
await umbracoUi.documentBlueprint.clickCreateActionMenuOption();
111+
await umbracoUi.documentBlueprint.clickTextButtonWithName(documentTypeName);
112+
await umbracoUi.documentBlueprint.enterDocumentBlueprintName(documentBlueprintName);
113+
await umbracoUi.documentBlueprint.clickSaveButton();
114+
115+
// Assert
116+
await umbracoUi.documentBlueprint.waitForDocumentBlueprintToBeCreated();
117+
expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy();
118+
await umbracoUi.documentBlueprint.isDocumentBlueprintRootTreeItemVisible(documentBlueprintName, true);
119+
await umbracoUi.documentBlueprint.page.on('console', message => {
120+
expect(message.type()).not.toBe('error');
121+
});
122+
123+
// Clean
124+
await umbracoApi.language.ensureIsoCodeNotExists('da');
125+
});

0 commit comments

Comments
 (0)