V15 QA Added acceptance tests to verify the SVG thumbnail (#17966)
* Added tests to verify the media thumbnail * Added tests to verify the media thumbnail * Bumped version * Make the SVG tests run in the pipeline * Cleaned code * Updated smokeTest command * Reverted * Updated the thumbnail file for audio * Reverted
This commit is contained in:
@@ -80,10 +80,10 @@ test(`can upload a file with the svg extension in the content`, async ({umbracoA
|
||||
const contentData = await umbracoApi.document.getByName(contentName);
|
||||
expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName));
|
||||
expect(contentData.values[0].value.src).toContain(AliasHelper.toAlias(vectorGraphicsName));
|
||||
await umbracoUi.content.doesUploadedSvgThumbnailHaveSrc(contentData.values[0].value.src);
|
||||
});
|
||||
|
||||
// TODO: Remove skip when the front-end is ready. Currently the uploaded vector graphics file still displays after removing.
|
||||
test.skip('can remove an svg file in the content', async ({umbracoApi, umbracoUi}) => {
|
||||
test('can remove an svg file in the content', async ({umbracoApi, umbracoUi}) => {
|
||||
// Arrange
|
||||
const uploadVectorGraphicsName = 'VectorGraphics.svg';
|
||||
const mineType = 'image/svg+xml';
|
||||
|
||||
@@ -50,12 +50,12 @@ test('can rename a media file', async ({umbracoApi, umbracoUi}) => {
|
||||
});
|
||||
|
||||
const mediaFileTypes = [
|
||||
{fileName: 'Article', filePath: 'Article.pdf'},
|
||||
{fileName: 'Audio', filePath: 'Audio.mp3'},
|
||||
{fileName: 'File', filePath: 'File.txt'},
|
||||
{fileName: 'Image', filePath: 'Umbraco.png'},
|
||||
{fileName: 'Vector Graphics (SVG)', filePath: 'VectorGraphics.svg'},
|
||||
{fileName: 'Video', filePath: 'Video.mp4'}
|
||||
{fileName: 'Article', filePath: 'Article.pdf', thumbnail: 'icon-article'},
|
||||
{fileName: 'Audio', filePath: 'Audio.mp3', thumbnail: 'icon-audio-lines'},
|
||||
{fileName: 'File', filePath: 'File.txt', thumbnail: 'icon-document'},
|
||||
{fileName: 'Image', filePath: 'Umbraco.png', thumbnail: 'image'},
|
||||
{fileName: 'Vector Graphics (SVG)', filePath: 'VectorGraphics.svg', thumbnail: 'image'},
|
||||
{fileName: 'Video', filePath: 'Video.mp4', thumbnail: 'icon-video'}
|
||||
];
|
||||
|
||||
for (const mediaFileType of mediaFileTypes) {
|
||||
@@ -72,6 +72,8 @@ for (const mediaFileType of mediaFileTypes) {
|
||||
|
||||
// Assert
|
||||
await umbracoUi.media.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created);
|
||||
const mediaData = await umbracoApi.media.getByName(mediaFileType.fileName);
|
||||
await umbracoUi.media.doesMediaHaveThumbnail(mediaData.id, mediaFileType.thumbnail, mediaData.urls[0].url);
|
||||
await umbracoUi.media.reloadMediaTree();
|
||||
await umbracoUi.media.isMediaTreeItemVisible(mediaFileType.fileName);
|
||||
expect(await umbracoApi.media.doesNameExist(mediaFileType.fileName)).toBeTruthy();
|
||||
|
||||
Reference in New Issue
Block a user