Skip to content

Commit c448190

Browse files
authored
V15 QA added fixes for flaky/failing acceptance tests (#18149)
* Fixed tests * More fixes * More fixes * Skipped waits * Added necessary updates to tests * Bumped versions * Removed skipped waits * Removed more waits * Cleaned up PR * Updated tests * Bumped version * Added more timeout
1 parent 739a24b commit c448190

Some content is hidden

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

43 files changed

+107
-141
lines changed

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

Lines changed: 21 additions & 21 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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
"smokeTestSqlite": "npx playwright test DefaultConfig --grep \"@smoke\" --grep-invert \"Users\""
1414
},
1515
"devDependencies": {
16-
"@playwright/test": "^1.43",
16+
"@playwright/test": "^1.50",
1717
"@types/node": "^20.9.0",
1818
"prompt": "^1.2.0",
1919
"tslib": "^2.4.0",
2020
"typescript": "^4.8.3"
2121
},
2222
"dependencies": {
23-
"@umbraco/json-models-builders": "^2.0.26",
24-
"@umbraco/playwright-testhelpers": "^15.0.7",
23+
"@umbraco/json-models-builders": "^2.0.27",
24+
"@umbraco/playwright-testhelpers": "^15.0.13",
2525
"camelize": "^1.0.0",
2626
"dotenv": "^16.3.1",
2727
"node-fetch": "^2.6.7"

tests/Umbraco.Tests.AcceptanceTest/tests/ApiTesting/User/User.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test.describe('User Tests', () => {
1919

2020
test('can create a user', async ({umbracoApi}) => {
2121
// Act
22-
userId = await umbracoApi.user.createDefaultUser(userName, userEmail, userGroupId);
22+
userId = await umbracoApi.user.createDefaultUser(userName, userEmail, [userGroupId]);
2323

2424
// Assert
2525
expect(await umbracoApi.user.doesExist(userId)).toBeTruthy();
@@ -28,7 +28,7 @@ test.describe('User Tests', () => {
2828
test('can update a user', async ({umbracoApi}) => {
2929
// Arrange
3030
const anotherUserGroup = await umbracoApi.userGroup.getByName("Translators");
31-
userId = await umbracoApi.user.createDefaultUser(userName, userEmail, userGroupId);
31+
userId = await umbracoApi.user.createDefaultUser(userName, userEmail, [userGroupId]);
3232
const userData = await umbracoApi.user.get(userId);
3333
const newUserGroupData = [
3434
userGroupId,
@@ -48,7 +48,7 @@ test.describe('User Tests', () => {
4848

4949
test('can delete a user', async ({umbracoApi}) => {
5050
// Arrange
51-
userId = await umbracoApi.user.createDefaultUser(userName, userEmail, userGroupId);
51+
userId = await umbracoApi.user.createDefaultUser(userName, userEmail, [userGroupId]);
5252
expect(await umbracoApi.user.doesExist(userId)).toBeTruthy();
5353

5454
// Act

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ test('can create child node', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) =
3333
await umbracoUi.content.clickActionsMenuForContent(contentName);
3434
await umbracoUi.content.clickCreateButton();
3535
await umbracoUi.content.chooseDocumentType(childDocumentTypeName);
36-
// This wait is needed
37-
await umbracoUi.waitForTimeout(500);
3836
await umbracoUi.content.enterContentName(childContentName);
3937
await umbracoUi.content.clickSaveButton();
4038

@@ -74,7 +72,6 @@ test('can create child node in child node', async ({umbracoApi, umbracoUi}) => {
7472
await umbracoUi.content.clickCreateButton();
7573
await umbracoUi.content.chooseDocumentType(childOfChildDocumentTypeName);
7674
// This wait is needed
77-
await umbracoUi.waitForTimeout(500);
7875
await umbracoUi.content.enterContentName(childOfChildContentName);
7976
await umbracoUi.content.clickSaveButton();
8077

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ test('can see correct information when published', async ({umbracoApi, umbracoUi
3434

3535
// Assert
3636
await umbracoUi.content.isSuccessNotificationVisible();
37-
await umbracoUi.waitForTimeout(2000);
3837
const contentData = await umbracoApi.document.getByName(contentName);
3938
await umbracoUi.content.doesIdHaveText(contentData.id);
4039
const expectedCreatedDate = new Date(contentData.variants[0].createDate).toLocaleString("en-US", {
@@ -134,8 +133,6 @@ test('cannot change to a template that is not allowed in the document type', asy
134133
await umbracoUi.content.clickEditTemplateByName(firstTemplateName);
135134

136135
// Assert
137-
// This wait is needed to make sure the template name is visible when the modal is opened
138-
await umbracoUi.waitForTimeout(1000);
139136
await umbracoUi.content.isTemplateNameDisabled(secondTemplateName);
140137

141138
// Clean

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test.beforeEach(async ({umbracoApi, umbracoUi}) => {
1111
});
1212

1313
test.afterEach(async ({umbracoApi}) => {
14-
await umbracoApi.document.ensureNameNotExists(contentName);
14+
await umbracoApi.document.ensureNameNotExists(contentName);
1515
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
1616
});
1717

@@ -29,7 +29,7 @@ test('can create content with allowed child node enabled', async ({umbracoApi, u
2929
await umbracoUi.content.chooseDocumentType(documentTypeName);
3030
await umbracoUi.content.enterContentName(contentName);
3131
await umbracoUi.content.clickSaveButton();
32-
32+
3333
// Assert
3434
await umbracoUi.content.isSuccessNotificationVisible();
3535
expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy();
@@ -71,8 +71,6 @@ test('can create multiple child nodes with different document types', async ({um
7171
await umbracoUi.content.clickActionsMenuForContent(contentName);
7272
await umbracoUi.content.clickCreateButton();
7373
await umbracoUi.content.chooseDocumentType(secondChildDocumentTypeName);
74-
// This wait is needed
75-
await umbracoUi.waitForTimeout(500);
7674
await umbracoUi.content.enterContentName(secondChildContentName);
7775
await umbracoUi.content.clickSaveButton();
7876

@@ -95,4 +93,4 @@ test('can create multiple child nodes with different document types', async ({um
9593
await umbracoApi.document.ensureNameNotExists(secondChildContentName);
9694
await umbracoApi.documentType.ensureNameNotExists(firstChildDocumentTypeName);
9795
await umbracoApi.documentType.ensureNameNotExists(secondChildDocumentTypeName);
98-
});
96+
});

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ test('can create child content in a collection', async ({umbracoApi, umbracoUi})
5353
await umbracoUi.content.clickActionsMenuForContent(contentName);
5454
await umbracoUi.content.clickCreateButton();
5555
await umbracoUi.content.chooseDocumentType(childDocumentTypeName);
56-
// This wait is needed
57-
await umbracoUi.waitForTimeout(500);
5856
await umbracoUi.content.enterContentName(firstChildContentName);
5957
await umbracoUi.content.clickSaveButton();
6058

@@ -63,11 +61,9 @@ test('can create child content in a collection', async ({umbracoApi, umbracoUi})
6361
expect(childData.length).toBe(expectedNames.length);
6462
expect(childData[0].variants[0].name).toBe(firstChildContentName);
6563
// verify that the child content displays in collection list after reloading tree
66-
await umbracoUi.waitForTimeout(1000);
6764
await umbracoUi.content.clickActionsMenuForContent(contentName);
6865
await umbracoUi.content.clickReloadButton();
6966
await umbracoUi.content.goToContentWithName(contentName);
70-
await umbracoUi.waitForTimeout(500);
7167
await umbracoUi.content.doesDocumentTableColumnNameValuesMatch(expectedNames);
7268

7369
// Clean
@@ -89,8 +85,6 @@ test('can create multiple child nodes in a collection', async ({umbracoApi, umbr
8985
await umbracoUi.content.clickActionsMenuForContent(contentName);
9086
await umbracoUi.content.clickCreateButton();
9187
await umbracoUi.content.chooseDocumentType(childDocumentTypeName);
92-
// This wait is needed
93-
await umbracoUi.waitForTimeout(500);
9488
await umbracoUi.content.enterContentName(secondChildContentName);
9589
await umbracoUi.content.clickSaveButton();
9690

@@ -100,11 +94,9 @@ test('can create multiple child nodes in a collection', async ({umbracoApi, umbr
10094
expect(childData[0].variants[0].name).toBe(firstChildContentName);
10195
expect(childData[1].variants[0].name).toBe(secondChildContentName);
10296
// verify that the child content displays in collection list after reloading tree
103-
await umbracoUi.waitForTimeout(1000);
10497
await umbracoUi.content.clickActionsMenuForContent(contentName);
10598
await umbracoUi.content.clickReloadButton();
10699
await umbracoUi.content.goToContentWithName(contentName);
107-
await umbracoUi.waitForTimeout(500);
108100
await umbracoUi.content.doesDocumentTableColumnNameValuesMatch(expectedNames);
109101

110102
// Clean

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ test('can publish content with the image cropper data type', {tag: '@smoke'}, as
7575
test('can create content with the custom image cropper data type', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
7676
// Arrange
7777
const customDataTypeName = 'CustomImageCropper';
78-
const cropValue = ['TestCropLabel', 100, 50];
79-
const customDataTypeId = await umbracoApi.dataType.createImageCropperDataTypeWithOneCrop(customDataTypeName, cropValue[0], cropValue[1], cropValue[2]);
78+
const cropAlias = 'TestCropLabel';
79+
const cropWidth = 100;
80+
const cropHeight = 50;
81+
const customDataTypeId = await umbracoApi.dataType.createImageCropperDataTypeWithOneCrop(customDataTypeName, AliasHelper.toAlias(cropAlias), cropWidth, cropHeight);
8082
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, customDataTypeName, customDataTypeId);
8183
await umbracoApi.document.createDefaultDocument(contentName, documentTypeId);
8284
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
@@ -93,9 +95,9 @@ test('can create content with the custom image cropper data type', {tag: '@smoke
9395
expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName));
9496
expect(contentData.values[0].value.src).toContain(AliasHelper.toAlias(imageFileName));
9597
expect(contentData.values[0].value.focalPoint).toEqual(defaultFocalPoint);
96-
expect(contentData.values[0].value.crops[0].alias).toEqual(AliasHelper.toAlias(cropValue[0]));
97-
expect(contentData.values[0].value.crops[0].width).toEqual(cropValue[1]);
98-
expect(contentData.values[0].value.crops[0].height).toEqual(cropValue[2]);
98+
expect(contentData.values[0].value.crops[0].alias).toEqual(AliasHelper.toAlias(cropAlias));
99+
expect(contentData.values[0].value.crops[0].width).toEqual(cropWidth);
100+
expect(contentData.values[0].value.crops[0].height).toEqual(cropHeight);
99101

100102
// Clean
101103
await umbracoApi.dataType.ensureNameNotExists(customDataTypeName);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ test('can add an image to the image media picker', async ({umbracoApi, umbracoUi
7373
// Act
7474
await umbracoUi.content.goToContentWithName(contentName);
7575
await umbracoUi.content.clickChooseButtonAndSelectMediaWithName(mediaName);
76-
await umbracoUi.content.clickSubmitButton();
76+
await umbracoUi.content.clickChooseModalButton();
7777
await umbracoUi.content.clickSaveButton();
7878

7979
// Assert
@@ -168,7 +168,7 @@ test('can add an image from the image media picker with a start node', async ({u
168168
// Act
169169
await umbracoUi.content.goToContentWithName(contentName);
170170
await umbracoUi.content.clickChooseButtonAndSelectMediaWithName(mediaName);
171-
await umbracoUi.content.clickSubmitButton();
171+
await umbracoUi.content.clickChooseModalButton();
172172
await umbracoUi.content.clickSaveButton();
173173

174174
// Assert

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test('can create content with the media picker data type', {tag: '@smoke'}, asyn
3535
await umbracoUi.content.chooseDocumentType(documentTypeName);
3636
await umbracoUi.content.enterContentName(contentName);
3737
await umbracoUi.content.clickChooseButtonAndSelectMediaWithName(mediaFileName);
38-
await umbracoUi.content.clickSubmitButton();
38+
await umbracoUi.content.clickChooseModalButton();
3939
await umbracoUi.content.clickSaveButton();
4040

4141
// Assert
@@ -64,7 +64,7 @@ test('can publish content with the media picker data type', async ({umbracoApi,
6464
await umbracoUi.content.chooseDocumentType(documentTypeName);
6565
await umbracoUi.content.enterContentName(contentName);
6666
await umbracoUi.content.clickChooseButtonAndSelectMediaWithName(mediaFileName);
67-
await umbracoUi.content.clickSubmitButton();
67+
await umbracoUi.content.clickChooseModalButton();
6868
await umbracoUi.content.clickSaveAndPublishButton();
6969

7070
// Assert

0 commit comments

Comments
 (0)