Skip to content

Commit 11bf60a

Browse files
authored
E2E: Updated exisiting acceptance tests to match updates from front end (#20525)
* Updated tests * E2E: Updated acceptance tests to match changes (#20493) * Updated tests to match changes * More updates * Bumped version * Reverted change
1 parent 8beb7f2 commit 11bf60a

File tree

12 files changed

+23
-22
lines changed

12 files changed

+23
-22
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.40",
25-
"@umbraco/playwright-testhelpers": "^17.0.0-beta.1",
25+
"@umbraco/playwright-testhelpers": "^17.0.0-beta.4",
2626
"camelize": "^1.0.0",
2727
"dotenv": "^16.3.1",
2828
"node-fetch": "^2.6.7"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ test('can duplicate a content node to other parent', async ({umbracoApi, umbraco
234234
await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.duplicated);
235235
await umbracoUi.content.isContentInTreeVisible(contentName);
236236
await umbracoUi.content.isContentInTreeVisible(parentContentName);
237-
await umbracoUi.content.openContentCaretButtonForName(parentContentName);
238-
await umbracoUi.content.isChildContentInTreeVisible(parentContentName, contentName);
237+
await umbracoUi.content.goToContentWithName(parentContentName);
238+
await umbracoUi.content.isContentWithNameVisibleInList(contentName);
239239

240240
// Clean
241241
await umbracoApi.document.ensureNameNotExists(parentContentName);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test.afterEach(async ({umbracoApi}) => {
1717

1818
test('can see correct information when published', async ({umbracoApi, umbracoUi}) => {
1919
// Arrange
20-
const notPublishContentLink = 'This item is not published';
20+
const notPublishContentLink = 'Not created';
2121
const dataTypeName = 'Textstring';
2222
const contentText = 'This is test content text';
2323
const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName);

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedChildNodes.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ test('cannot create child content if allowed child node is disabled', async ({um
5151

5252
// Assert
5353
await umbracoUi.content.isDocumentTypeNameVisible(documentTypeName, false);
54-
await umbracoUi.content.doesModalHaveText(noAllowedDocumentTypeAvailableMessage);
54+
await umbracoUi.content.doesDocumentModalHaveText(noAllowedDocumentTypeAvailableMessage);
5555
});
5656

5757
test('can create multiple child nodes with different document types', async ({umbracoApi, umbracoUi}) => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ test('can publish content with the true/false data type', async ({umbracoApi, um
5858
expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy();
5959
const contentData = await umbracoApi.document.getByName(contentName);
6060
expect(contentData.variants[0].state).toBe(expectedState);
61-
expect(contentData.values).toEqual([]);
61+
expect(contentData.values[0].value).toEqual(false);
6262
});
6363

6464
test('can toggle the true/false value in the content', {tag: '@release'}, async ({umbracoApi, umbracoUi}) => {

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ test('can create content using an invariant document blueprint', async ({umbraco
5151
await umbracoUi.content.clickActionsMenuAtRoot();
5252
await umbracoUi.content.clickCreateActionMenuOption();
5353
await umbracoUi.content.chooseDocumentType(documentTypeName);
54-
await umbracoUi.content.clickModalMenuItemWithName(documentBlueprintName);
54+
await umbracoUi.content.selectDocumentBlueprintWithName(documentBlueprintName);
5555
await umbracoUi.content.clickSaveButtonForContent();
5656

5757
// Assert
@@ -75,7 +75,7 @@ test('can create content using a variant document blueprint', async ({umbracoApi
7575
await umbracoUi.content.clickActionsMenuAtRoot();
7676
await umbracoUi.content.clickCreateActionMenuOption();
7777
await umbracoUi.content.chooseDocumentType(documentTypeName);
78-
await umbracoUi.content.clickModalMenuItemWithName(documentBlueprintName);
78+
await umbracoUi.content.selectDocumentBlueprintWithName(documentBlueprintName);
7979
await umbracoUi.content.clickSaveButtonForContent();
8080
await umbracoUi.content.clickSaveButton();
8181

@@ -104,7 +104,7 @@ test('can create content with different name using an invariant document bluepri
104104
await umbracoUi.content.clickActionsMenuAtRoot();
105105
await umbracoUi.content.clickCreateActionMenuOption();
106106
await umbracoUi.content.chooseDocumentType(documentTypeName);
107-
await umbracoUi.content.clickModalMenuItemWithName(documentBlueprintName);
107+
await umbracoUi.content.selectDocumentBlueprintWithName(documentBlueprintName);
108108
await umbracoUi.content.enterContentName(contentName);
109109
await umbracoUi.content.clickSaveButtonForContent();
110110

@@ -130,7 +130,7 @@ test('can create content with different name using a variant document blueprint'
130130
await umbracoUi.content.clickActionsMenuAtRoot();
131131
await umbracoUi.content.clickCreateActionMenuOption();
132132
await umbracoUi.content.chooseDocumentType(documentTypeName);
133-
await umbracoUi.content.clickModalMenuItemWithName(documentBlueprintName);
133+
await umbracoUi.content.selectDocumentBlueprintWithName(documentBlueprintName);
134134
await umbracoUi.content.enterContentName(contentName);
135135
await umbracoUi.content.clickSaveButtonForContent();
136136
await umbracoUi.content.clickSaveButton();
@@ -161,7 +161,7 @@ test('can create content using a document blueprint with block list', async ({um
161161
await umbracoUi.content.clickActionsMenuAtRoot();
162162
await umbracoUi.content.clickCreateActionMenuOption();
163163
await umbracoUi.content.chooseDocumentType(documentTypeName);
164-
await umbracoUi.content.clickModalMenuItemWithName(documentBlueprintName);
164+
await umbracoUi.content.selectDocumentBlueprintWithName(documentBlueprintName);
165165
await umbracoUi.content.clickSaveButtonForContent();
166166

167167
// Assert
@@ -187,7 +187,7 @@ test('can create content using a document blueprint with block grid', async ({um
187187
await umbracoUi.content.clickActionsMenuAtRoot();
188188
await umbracoUi.content.clickCreateActionMenuOption();
189189
await umbracoUi.content.chooseDocumentType(documentTypeName);
190-
await umbracoUi.content.clickModalMenuItemWithName(documentBlueprintName);
190+
await umbracoUi.content.selectDocumentBlueprintWithName(documentBlueprintName);
191191
await umbracoUi.content.clickSaveButtonForContent();
192192

193193
// Assert
@@ -197,4 +197,4 @@ test('can create content using a document blueprint with block grid', async ({um
197197
expect(contentData.values[0].value.contentData[0].values[0].value.markup).toEqual(textContent);
198198
const blockListValue = contentData.values.find(item => item.editorAlias === "Umbraco.BlockGrid")?.value;
199199
expect(blockListValue).toBeTruthy();
200-
});
200+
});

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/BlockGridEditor.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ test('max can not be less than min in a block grid editor', async ({umbracoApi,
275275

276276
// Assert
277277
await umbracoUi.dataType.isFailedStateButtonVisible();
278-
await umbracoUi.dataType.doesAmountContainErrorMessageWithText('The low value must not be exceed the high value');
278+
await umbracoUi.dataType.doesAmountContainErrorMessageWithText('The low value must not exceed the high value.');
279279
const dataTypeData = await umbracoApi.dataType.getByName(blockGridEditorName);
280280
expect(dataTypeData.values[0].value.min).toBe(minAmount);
281281
// The max value should not be updated

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockListEditor/BlockListEditor.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ test('max can not be less than min', async ({umbracoApi, umbracoUi}) => {
173173
// Assert
174174
await umbracoUi.dataType.isFailedStateButtonVisible();
175175
const dataTypeData = await umbracoApi.dataType.getByName(blockListEditorName);
176-
await umbracoUi.dataType.doesAmountContainErrorMessageWithText('The low value must not be exceed the high value');
176+
await umbracoUi.dataType.doesAmountContainErrorMessageWithText('The low value must not exceed the high value.');
177177
expect(dataTypeData.values[0].value.min).toBe(minAmount);
178178
// The max value should not be updated
179179
expect(dataTypeData.values[0].value.max).toBe(oldMaxAmount);

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/Media.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ for (const mediaFileType of mediaFileTypes) {
7373

7474
// Assert
7575
await umbracoUi.media.waitForMediaItemToBeCreated();
76+
await umbracoUi.media.goToSection(ConstantHelper.sections.media);
7677
const mediaData = await umbracoApi.media.getByName(mediaFileType.fileName);
7778
const mediaUrl = await umbracoApi.media.getFullMediaUrl(mediaData.id);
7879
await umbracoUi.media.doesMediaHaveThumbnail(mediaData.id, mediaFileType.thumbnail, mediaUrl);

0 commit comments

Comments
 (0)