Skip to content

Commit e82da17

Browse files
authored
V16 QA added acceptance test for issue 10431 (#19999)
* Added test * Bumped version
1 parent da7454e commit e82da17

File tree

3 files changed

+42
-10
lines changed

3 files changed

+42
-10
lines changed

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

Lines changed: 8 additions & 8 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
},
2323
"dependencies": {
2424
"@umbraco/json-models-builders": "^2.0.37",
25-
"@umbraco/playwright-testhelpers": "^16.0.39",
25+
"@umbraco/playwright-testhelpers": "^16.0.41",
2626
"camelize": "^1.0.0",
2727
"dotenv": "^16.3.1",
2828
"node-fetch": "^2.6.7"
2929
}
30-
}
30+
}

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,35 @@ test.fixme('can not publish a mandatory media picker with an empty value', async
158158
expect(contentData.values[0].value[0].focalPoint).toBeNull();
159159
expect(contentData.values[0].value[0].crops).toEqual([]);
160160
});
161+
162+
// This is a test for the regression issue #10431
163+
test('can add a media image to a media picker in variant content, remove it and then add it again', async ({umbracoApi, umbracoUi}) => {
164+
// Arrange
165+
const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName);
166+
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, dataTypeName, dataTypeData.id, 'Test Group', true, true, false);
167+
await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId);
168+
const mediaFileId = await umbracoApi.media.createDefaultMediaWithImage(mediaFileName);
169+
await umbracoUi.goToBackOffice();
170+
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
171+
172+
// Act
173+
await umbracoUi.content.goToContentWithName(contentName);
174+
// Adds media item to a media picker
175+
await umbracoUi.content.clickChooseButtonAndSelectMediaWithKey(mediaFileId);
176+
await umbracoUi.content.clickChooseModalButton();
177+
await umbracoUi.content.clickSaveAndPublishButton();
178+
await umbracoUi.content.clickContainerSaveAndPublishButton();
179+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
180+
// Removes media item from the media picker
181+
await umbracoUi.content.removeMediaPickerByName(mediaFileName);
182+
await umbracoUi.content.clickSaveAndPublishButton();
183+
await umbracoUi.content.clickContainerSaveAndPublishButton();
184+
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
185+
186+
// Adds media item to a media picker again
187+
await umbracoUi.content.clickChooseButtonAndSelectMediaWithKey(mediaFileId);
188+
await umbracoUi.content.clickChooseModalButton();
189+
190+
// Assert
191+
await umbracoUi.content.isMediaNameVisible(mediaFileName);
192+
});

0 commit comments

Comments
 (0)