Skip to content

Commit 3f57da5

Browse files
authored
V16 QA updated notification acceptance tests (#19469)
* Updated block grid tests * Updated notifications in tests * Updated tests * Added testIdAttribute * Bumped version of testHelpers * Added waits after creation * Updated more tests related to notifications * Bumped version * Cleaned up * updated tests * Bumped version * Updated tests * bumped version
1 parent ce2756f commit 3f57da5

File tree

113 files changed

+813
-1353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+813
-1353
lines changed

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

Lines changed: 5 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
@@ -21,7 +21,7 @@
2121
},
2222
"dependencies": {
2323
"@umbraco/json-models-builders": "^2.0.35",
24-
"@umbraco/playwright-testhelpers": "^16.0.20",
24+
"@umbraco/playwright-testhelpers": "^16.0.23",
2525
"camelize": "^1.0.0",
2626
"dotenv": "^16.3.1",
2727
"node-fetch": "^2.6.7"

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ test('can create content with a block grid with an empty block in a area', {tag:
5454
await umbracoUi.content.clickSaveAndPublishButton();
5555

5656
// Assert
57-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
57+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
5858
await umbracoUi.reloadPage();
5959
await umbracoUi.content.doesBlockContainBlockInAreaWithName(firstElementTypeName, firstAreaName, firstElementTypeName);
6060
await umbracoUi.content.doesBlockContainBlockCountInArea(firstElementTypeName, firstAreaName, 1);
@@ -80,7 +80,7 @@ test('can create content with a block grid with two empty blocks in a area', asy
8080
await umbracoUi.content.clickSaveAndPublishButton();
8181

8282
// Assert
83-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
83+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
8484
await umbracoUi.reloadPage();
8585
await umbracoUi.content.doesBlockContainCountOfBlockInArea(firstElementTypeName, firstAreaName, firstElementTypeName, 2);
8686

@@ -109,7 +109,7 @@ test('can create content with block grid area with a create label', async ({umbr
109109
await umbracoUi.content.clickSaveAndPublishButton();
110110

111111
// Assert
112-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
112+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
113113
await umbracoUi.content.doesBlockGridBlockWithAreaContainCreateLabel(firstElementTypeName, createLabel);
114114
});
115115

@@ -130,7 +130,7 @@ test('can create content with block grid area with column span', async ({umbraco
130130
await umbracoUi.content.clickSaveAndPublishButton();
131131

132132
// Assert
133-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
133+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
134134
await umbracoUi.content.doesBlockAreaContainColumnSpan(firstElementTypeName, firstAreaName, columnSpan, 0);
135135
});
136136

@@ -151,7 +151,7 @@ test('can create content with block grid area with row span', async ({umbracoApi
151151
await umbracoUi.content.clickSaveAndPublishButton();
152152

153153
// Assert
154-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
154+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
155155
await umbracoUi.content.doesBlockAreaContainRowSpan(firstElementTypeName, firstAreaName, rowSpan, 0);
156156
});
157157

@@ -181,7 +181,7 @@ test.fixme('can create content with block grid area with min allowed', async ({u
181181
await umbracoUi.content.clickSaveAndPublishButton();
182182

183183
// Assert
184-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
184+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
185185

186186
// Clean
187187
await umbracoApi.documentType.ensureNameNotExists(secondElementTypeName);
@@ -213,7 +213,7 @@ test.fixme('can create content with block grid area with max allowed', async ({u
213213
await umbracoUi.content.clickSaveAndPublishButton();
214214

215215
// Assert
216-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
216+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
217217

218218
// Clean
219219
await umbracoApi.documentType.ensureNameNotExists(secondElementTypeName);

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ test('can not publish a block grid with a mandatory radiobox without a value', a
5454
await umbracoUi.content.clickSaveAndPublishButton();
5555

5656
// Assert
57-
//await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
58-
await umbracoUi.content.isErrorNotificationVisible(false);
59-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
57+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
6058
});
6159

6260
test('can not publish a block grid with a mandatory checkbox list without a value', async ({umbracoApi, umbracoUi}) => {
@@ -84,9 +82,7 @@ test('can not publish a block grid with a mandatory checkbox list without a valu
8482
await umbracoUi.content.clickSaveAndPublishButton();
8583

8684
// Assert
87-
//await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
88-
await umbracoUi.content.isErrorNotificationVisible(false);
89-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
85+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
9086
});
9187

9288
test('can not publish a block grid with a mandatory dropdown without a value', async ({umbracoApi, umbracoUi}) => {
@@ -114,7 +110,5 @@ test('can not publish a block grid with a mandatory dropdown without a value', a
114110
await umbracoUi.content.clickSaveAndPublishButton();
115111

116112
// Assert
117-
//await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
118-
await umbracoUi.content.isErrorNotificationVisible(false);
119-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
120-
});
113+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
114+
});

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ test.afterEach(async ({umbracoApi}) => {
6464
await umbracoApi.dataType.ensureNameNotExists(richTextDataTypeName);
6565
});
6666

67-
// Needs to be updated as we are not asserting on save or publish notifications as we did in 15
68-
test.fixme('can update property value nested in a block grid area with an RTE with a block list editor', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
67+
test('can update property value nested in a block grid area with an RTE with a block list editor', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
6968
test.slow();
7069
// Arrange
7170
// ElementType with Textstring And REGEX only accept letters and numbers
@@ -106,10 +105,9 @@ test.fixme('can update property value nested in a block grid area with an RTE wi
106105
await umbracoUi.content.clickCreateButtonForModalWithElementTypeNameAndGroupName(richTextEditorElementTypeName, richTextEditorElementGroupName);
107106
await umbracoUi.content.clickSaveAndPublishButton();
108107
// Checks that the error notification is shown since the textstring block has the wrong value
109-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved, true, true);
108+
await umbracoUi.content.isFailedStateButtonVisible();
110109
await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished, true, true);
111110
// Updates the textstring block with the correct value
112-
await umbracoUi.waitForTimeout(1000);
113111
await umbracoUi.content.clickBlockElementWithName(blockListElementTypeName);
114112
await umbracoUi.content.clickEditBlockListEntryWithName(textStringElementTypeName);
115113
await umbracoUi.content.enterPropertyValue(textStringElementDataTypeName, correctPropertyValue);
@@ -118,10 +116,7 @@ test.fixme('can update property value nested in a block grid area with an RTE wi
118116
await umbracoUi.content.clickSaveAndPublishButton();
119117

120118
// Assert
121-
// await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved, true, true);
122-
// await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published, true, true);
123-
await umbracoUi.content.isErrorNotificationVisible(false);
124-
await umbracoUi.waitForTimeout(1000);
119+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
125120
// Checks if published
126121
const contentData = await umbracoApi.document.getByName(contentName);
127122
expect(contentData.variants[0].state).toBe('Published');

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

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ test('can create content with an empty block grid', async ({umbracoApi, umbracoU
3939
await umbracoUi.content.clickSaveButton();
4040

4141
// Assert
42-
//await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created);
43-
await umbracoUi.content.isErrorNotificationVisible(false);
42+
await umbracoUi.content.waitForContentToBeCreated();
4443
expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy();
4544
const contentData = await umbracoApi.document.getByName(contentName);
4645
expect(contentData.variants[0].state).toBe(expectedState);
@@ -63,8 +62,7 @@ test('can publish content with an empty block grid', async ({umbracoApi, umbraco
6362
await umbracoUi.content.clickSaveAndPublishButton();
6463

6564
// Assert
66-
//await umbracoUi.content.doesSuccessNotificationsHaveCount(2);
67-
await umbracoUi.content.isErrorNotificationVisible(false);
65+
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
6866
expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy();
6967
const contentData = await umbracoApi.document.getByName(contentName);
7068
expect(contentData.variants[0].state).toBe(expectedState);
@@ -89,8 +87,7 @@ test('can add a block element in the content', async ({umbracoApi, umbracoUi}) =
8987
await umbracoUi.content.clickSaveButton();
9088

9189
// Assert
92-
//await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
93-
await umbracoUi.content.isErrorNotificationVisible(false);
90+
await umbracoUi.content.isSuccessStateVisibleForSaveButton();
9491
expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy();
9592
const contentData = await umbracoApi.document.getByName(contentName);
9693
expect(contentData.values[0].value.contentData[0].values[0].value).toEqual(inputText);
@@ -112,8 +109,7 @@ test('can edit block element in the content', async ({umbracoApi, umbracoUi}) =>
112109
await umbracoUi.content.clickSaveButton();
113110

114111
// Assert
115-
//await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
116-
await umbracoUi.content.isErrorNotificationVisible(false);
112+
await umbracoUi.content.isSuccessStateVisibleForSaveButton();
117113
const contentData = await umbracoApi.document.getByName(contentName);
118114
expect(contentData.values[0].value.contentData[0].values[0].value).toEqual(updatedText);
119115
});
@@ -130,8 +126,7 @@ test('can delete block element in the content', async ({umbracoApi, umbracoUi})
130126
await umbracoUi.content.clickSaveButton();
131127

132128
// Assert
133-
//await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
134-
await umbracoUi.content.isErrorNotificationVisible(false);
129+
await umbracoUi.content.isSuccessStateVisibleForSaveButton();
135130
const contentData = await umbracoApi.document.getByName(contentName);
136131
const blockGridValue = contentData.values.find(item => item.value);
137132
expect(blockGridValue).toBeFalsy();
@@ -205,8 +200,7 @@ test('can set the label of block element in the content', async ({umbracoApi, um
205200
await umbracoUi.content.clickSaveButton();
206201

207202
// Assert
208-
//await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
209-
await umbracoUi.content.isErrorNotificationVisible(false);
203+
await umbracoUi.content.isSuccessStateVisibleForSaveButton();
210204
await umbracoUi.content.doesBlockElementHaveName(blockLabel);
211205
});
212206

@@ -227,8 +221,7 @@ test('can set the number of columns for the layout in the content', async ({umbr
227221
await umbracoUi.content.clickSaveButton();
228222

229223
// Assert
230-
//await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
231-
await umbracoUi.content.isErrorNotificationVisible(false);
224+
await umbracoUi.content.isSuccessStateVisibleForSaveButton();
232225
const contentData = await umbracoApi.document.getByName(contentName);
233226
const layoutValue = contentData.values[0]?.value.layout["Umbraco.BlockGrid"];
234227
expect(layoutValue[0].columnSpan).toBe(gridColumns);
@@ -260,7 +253,7 @@ test.skip('can add settings model for the block in the content', async ({umbraco
260253
await umbracoUi.content.clickSaveButton();
261254

262255
// Assert
263-
//await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
256+
await umbracoUi.content.isSuccessStateVisibleForSaveButton();
264257
await umbracoUi.content.isErrorNotificationVisible(false);
265258
const contentData = await umbracoApi.document.getByName(contentName);
266259
expect(contentData.values[0].value.contentData[0].values[0].value).toEqual(contentBlockInputText);
@@ -289,7 +282,6 @@ test('can create content with a block grid with the inline editing mode enabled'
289282
await umbracoUi.content.clickSaveButton();
290283

291284
// Assert
292-
//await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created);
293285
await umbracoUi.content.isErrorNotificationVisible(false);
294286
expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy();
295287
});
@@ -312,13 +304,11 @@ test('can add a block element with inline editing mode enabled', async ({umbraco
312304
await umbracoUi.content.clickSaveAndPublishButton();
313305

314306
// Assert
315-
//await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
316-
await umbracoUi.content.isErrorNotificationVisible(false);
317-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
307+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
318308
expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy();
319309
const contentData = await umbracoApi.document.getByName(contentName);
320310
expect(contentData.values[0].value.contentData[0].values[0].value).toEqual(inputText);
321311
const blockListValue = contentData.values.find(item => item.editorAlias === "Umbraco.BlockGrid")?.value;
322312
expect(blockListValue).toBeTruthy();
323313
await umbracoUi.content.doesPropertyContainValue(propertyInBlock, inputText);
324-
});
314+
});

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ test('can publish a block grid editor with a rich text editor', async ({umbracoA
5858
await umbracoUi.content.clickSaveAndPublishButton();
5959

6060
// Assert
61-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
62-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
61+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton()
6362
// Asserts that the value in the RTE is as expected
6463
const documentData = await umbracoApi.document.getByName(contentName);
6564
const documentValues = documentData.values.find(value => value.alias === AliasHelper.toAlias(blockGridDataTypeName));
@@ -102,8 +101,7 @@ test('can publish a block grid editor with a block list editor', async ({umbraco
102101
await umbracoUi.content.clickSaveAndPublishButton();
103102

104103
// Assert
105-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
106-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
104+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton()
107105
// Asserts that the value in the BlockList is as expected
108106
const documentData = await umbracoApi.document.getByName(contentName);
109107
const documentValues = documentData.values.find(value => value.alias === AliasHelper.toAlias(blockGridDataTypeName));
@@ -147,8 +145,7 @@ test('can publish a block grid editor with a block grid editor', async ({umbraco
147145
await umbracoUi.content.clickSaveAndPublishButton();
148146

149147
// Assert
150-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved);
151-
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published);
148+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton()
152149
// Asserts that the value in the BlockGrid is as expected
153150
const documentData = await umbracoApi.document.getByName(contentName);
154151
const documentValues = documentData.values.find(value => value.alias === AliasHelper.toAlias(blockGridDataTypeName));

0 commit comments

Comments
 (0)