Skip to content

Commit 7fe6971

Browse files
authored
V15 Updated acceptance tests for unsupported invariant content item with variant blocks (#18919)
* Updated tests for invariant block grid with variant blocks * Updated tests for invariant block list with variant blocks * Updated tests for invariant document with variant blocks * Bumped version * Changed npm command * Updated isValidationMessageVisible * Fixed name * Fixed comments * Reverted npm command
1 parent 9ef2b37 commit 7fe6971

File tree

3 files changed

+31
-77
lines changed

3 files changed

+31
-77
lines changed

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

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ test.beforeEach(async ({umbracoApi}) => {
3232

3333
test.afterEach(async ({umbracoApi}) => {
3434
await umbracoApi.language.ensureIsoCodeNotExists('da');
35-
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
3635
await umbracoApi.documentType.ensureNameNotExists(blockName);
3736
await umbracoApi.dataType.ensureNameNotExists(blockGridName);
37+
await umbracoApi.document.ensureNameNotExists(contentName);
38+
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
3839
});
3940

4041
test('invariant document type with invariant block grid with invariant block with an invariant textString', async ({umbracoApi, umbracoUi}) => {
@@ -63,57 +64,41 @@ test('invariant document type with invariant block grid with invariant block wit
6364
await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText);
6465
});
6566

66-
test('invariant document type with invariant block grid with variant block with an invariant textString', async ({umbracoApi, umbracoUi}) => {
67+
test('can not create unsupported invariant document type with invariant block grid with variant block with an invariant textString', async ({umbracoApi, umbracoUi}) => {
6768
// Arrange
6869
elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, false);
6970
blockGridId = await umbracoApi.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridName, elementTypeId, true);
7071
documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockGridName, blockGridId, documentTypeGroupName);
7172
await umbracoApi.document.createDefaultDocument(contentName, documentTypeId);
7273
await umbracoUi.goToBackOffice();
73-
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
74-
await umbracoUi.content.goToContentWithName(contentName);
7574

7675
// Act
77-
await umbracoUi.content.clickAddBlockElementButton();
78-
await umbracoUi.content.clickBlockElementWithName(blockName);
79-
await umbracoUi.content.enterTextstring(textStringText);
80-
await umbracoUi.content.clickCreateModalButton();
76+
await umbracoUi.content.goToContentWithName(contentName);
77+
await umbracoUi.content.isValidationMessageVisible(ConstantHelper.validationMessages.unsupportInvariantContentItemWithVariantBlocks);
8178
await umbracoUi.content.clickSaveAndPublishButton();
8279

8380
// Assert
8481
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
85-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
86-
87-
await umbracoUi.reloadPage();
88-
await umbracoUi.content.goToBlockGridBlockWithName(documentTypeGroupName, blockGridName, blockName);
89-
await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText);
82+
await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished);
9083
});
9184

92-
// Remove fixme when this test works. Currently, the textstring value is not saved when saving / publishing the document
93-
test.fixme('invariant document type with invariant block grid with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => {
85+
test('can not create unsupported invariant document type with invariant block grid with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => {
9486
// Arrange
9587
elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, true);
9688
blockGridId = await umbracoApi.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridName, elementTypeId, true);
9789
documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockGridName, blockGridId, documentTypeGroupName);
9890
await umbracoApi.document.createDefaultDocument(contentName, documentTypeId);
9991
await umbracoUi.goToBackOffice();
10092
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
101-
await umbracoUi.content.goToContentWithName(contentName);
10293

10394
// Act
104-
await umbracoUi.content.clickAddBlockElementButton();
105-
await umbracoUi.content.clickBlockElementWithName(blockName)
106-
await umbracoUi.content.enterTextstring(textStringText);
107-
await umbracoUi.content.clickCreateModalButton();
95+
await umbracoUi.content.goToContentWithName(contentName);
96+
await umbracoUi.content.isValidationMessageVisible(ConstantHelper.validationMessages.unsupportInvariantContentItemWithVariantBlocks);
10897
await umbracoUi.content.clickSaveAndPublishButton();
10998

11099
// Assert
111100
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
112-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
113-
114-
await umbracoUi.reloadPage();
115-
await umbracoUi.content.goToBlockGridBlockWithName(documentTypeGroupName, blockGridName, blockName);
116-
await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText);
101+
await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished);
117102
});
118103

119104
test('variant document type with variant block grid with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => {
@@ -195,4 +180,4 @@ test('variant document type with invariant block grid with variant block with an
195180
await umbracoUi.reloadPage();
196181
await umbracoUi.content.goToBlockGridBlockWithName(documentTypeGroupName, blockGridName, blockName);
197182
await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText);
198-
});
183+
});

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

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ test.beforeEach(async ({umbracoApi}) => {
3232

3333
test.afterEach(async ({umbracoApi}) => {
3434
await umbracoApi.language.ensureIsoCodeNotExists('da');
35-
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
3635
await umbracoApi.documentType.ensureNameNotExists(blockName);
3736
await umbracoApi.dataType.ensureNameNotExists(blockListName);
37+
await umbracoApi.document.ensureNameNotExists(contentName);
38+
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
3839
});
3940

4041
test('invariant document type with invariant block list with invariant block with an invariant textString', async ({umbracoApi, umbracoUi}) => {
@@ -63,57 +64,40 @@ test('invariant document type with invariant block list with invariant block wit
6364
await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText);
6465
});
6566

66-
test('invariant document type with invariant block list with variant block with an invariant textString', async ({umbracoApi, umbracoUi}) => {
67+
test('can not create unsupported invariant document type with invariant block list with variant block with an invariant textString', async ({umbracoApi, umbracoUi}) => {
6768
// Arrange
6869
elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, false);
6970
blockListId = await umbracoApi.dataType.createBlockListDataTypeWithABlock(blockListName, elementTypeId);
7071
documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListName, blockListId, documentTypeGroupName);
7172
await umbracoApi.document.createDefaultDocument(contentName, documentTypeId);
7273
await umbracoUi.goToBackOffice();
73-
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
74-
await umbracoUi.content.goToContentWithName(contentName);
7574

7675
// Act
77-
await umbracoUi.content.clickAddBlockElementButton();
78-
await umbracoUi.content.clickBlockElementWithName(blockName);
79-
await umbracoUi.content.enterTextstring(textStringText);
80-
await umbracoUi.content.clickCreateModalButton();
76+
await umbracoUi.content.goToContentWithName(contentName);
77+
await umbracoUi.content.isValidationMessageVisible(ConstantHelper.validationMessages.unsupportInvariantContentItemWithVariantBlocks);
8178
await umbracoUi.content.clickSaveAndPublishButton();
8279

8380
// Assert
8481
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
85-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
86-
87-
await umbracoUi.reloadPage();
88-
await umbracoUi.content.goToBlockListBlockWithName(documentTypeGroupName, blockListName, blockName);
89-
await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText);
82+
await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished);
9083
});
9184

92-
// Remove fixme when this test works. Currently the textstring value is is not saved when saving / publishing the document
93-
test.fixme('invariant document type with invariant block list with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => {
85+
test('can not create unsupported invariant document type with invariant block list with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => {
9486
// Arrange
9587
elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, true);
9688
blockListId = await umbracoApi.dataType.createBlockListDataTypeWithABlock(blockListName, elementTypeId);
9789
documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListName, blockListId, documentTypeGroupName);
9890
await umbracoApi.document.createDefaultDocument(contentName, documentTypeId);
9991
await umbracoUi.goToBackOffice();
100-
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
101-
await umbracoUi.content.goToContentWithName(contentName);
10292

10393
// Act
104-
await umbracoUi.content.clickAddBlockElementButton();
105-
await umbracoUi.content.clickBlockElementWithName(blockName)
106-
await umbracoUi.content.enterTextstring(textStringText);
107-
await umbracoUi.content.clickCreateModalButton();
94+
await umbracoUi.content.goToContentWithName(contentName);
95+
await umbracoUi.content.isValidationMessageVisible(ConstantHelper.validationMessages.unsupportInvariantContentItemWithVariantBlocks);
10896
await umbracoUi.content.clickSaveAndPublishButton();
10997

11098
// Assert
11199
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
112-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
113-
114-
await umbracoUi.reloadPage();
115-
await umbracoUi.content.goToBlockListBlockWithName(documentTypeGroupName, blockListName, blockName);
116-
await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText);
100+
await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished);
117101
});
118102

119103
test('variant document type with variant block list with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => {

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/VariantTipTapBlocks.spec.ts

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ test.beforeEach(async ({umbracoApi}) => {
3232

3333
test.afterEach(async ({umbracoApi}) => {
3434
await umbracoApi.language.ensureIsoCodeNotExists('da');
35-
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
3635
await umbracoApi.documentType.ensureNameNotExists(blockName);
3736
await umbracoApi.dataType.ensureNameNotExists(tipTapName);
37+
await umbracoApi.document.ensureNameNotExists(contentName);
38+
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
3839
});
3940

4041
test('invariant document type with invariant tiptap RTE with invariant block with an invariant textString', async ({umbracoApi, umbracoUi}) => {
@@ -64,57 +65,41 @@ test('invariant document type with invariant tiptap RTE with invariant block wit
6465
await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText);
6566
});
6667

67-
test('invariant document type with invariant tiptap RTE with variant block with an invariant textString', async ({umbracoApi, umbracoUi}) => {
68+
test('can not create unsupported invariant document type with invariant tiptap RTE with variant block with an invariant textString', async ({umbracoApi, umbracoUi}) => {
6869
// Arrange
6970
elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, false);
7071
tipTapId = await umbracoApi.dataType.createTipTapDataTypeWithABlock(tipTapName, elementTypeId);
7172
documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, tipTapName, tipTapId, documentTypeGroupName);
7273
await umbracoApi.document.createDefaultDocument(contentName, documentTypeId);
7374
await umbracoUi.goToBackOffice();
74-
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
75-
await umbracoUi.content.goToContentWithName(contentName);
7675

7776
// Act
78-
await umbracoUi.content.clickInsertBlockButton();
79-
await umbracoUi.content.clickBlockElementWithName(blockName);
80-
await umbracoUi.content.enterTextstring(textStringText);
81-
await umbracoUi.content.clickCreateModalButton();
77+
await umbracoUi.content.goToContentWithName(contentName);
78+
await umbracoUi.content.isValidationMessageVisible(ConstantHelper.validationMessages.unsupportInvariantContentItemWithVariantBlocks);
8279
await umbracoUi.content.clickSaveAndPublishButton();
8380

8481
// Assert
8582
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
86-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
87-
88-
await umbracoUi.reloadPage();
89-
await umbracoUi.content.clickBlockElementWithName(blockName);
90-
await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText);
83+
await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished);
9184
});
9285

93-
// Remove fixme when this test works. Currently the textstring value is is not saved when saving / publishing the document
94-
test.fixme('invariant document type with invariant tiptap RTE with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => {
86+
test('can not create unsupported invariant document type with invariant tiptap RTE with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => {
9587
// Arrange
9688
elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, true);
9789
tipTapId = await umbracoApi.dataType.createTipTapDataTypeWithABlock(tipTapName, elementTypeId);
9890
documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, tipTapName, tipTapId, documentTypeGroupName);
9991
await umbracoApi.document.createDefaultDocument(contentName, documentTypeId);
10092
await umbracoUi.goToBackOffice();
101-
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
10293
await umbracoUi.content.goToContentWithName(contentName);
10394

10495
// Act
105-
await umbracoUi.content.clickInsertBlockButton();
106-
await umbracoUi.content.clickBlockElementWithName(blockName);
107-
await umbracoUi.content.enterTextstring(textStringText);
108-
await umbracoUi.content.clickCreateModalButton();
96+
await umbracoUi.content.goToContentWithName(contentName);
97+
await umbracoUi.content.isValidationMessageVisible(ConstantHelper.validationMessages.unsupportInvariantContentItemWithVariantBlocks);
10998
await umbracoUi.content.clickSaveAndPublishButton();
11099

111100
// Assert
112101
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
113-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
114-
115-
await umbracoUi.reloadPage();
116-
await umbracoUi.content.clickBlockElementWithName(blockName);
117-
await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText);
102+
await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished);
118103
});
119104

120105
test('variant document type with variant tiptap RTE with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => {

0 commit comments

Comments
 (0)