Skip to content
Merged
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ConstantHelper, NotificationConstantHelper, test} from '@umbraco/playwright-testhelpers';

Check notice on line 1 in tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithListViewContent.spec.ts

View check run for this annotation

CodeScene Delta Analysis / CodeScene Code Health Review (main)

✅ Getting better: Code Duplication

reduced similar code in: 'can change from list view to grid view in list'. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
import {expect} from "@playwright/test";

const contentName = 'TestContent';
Expand All @@ -22,8 +22,7 @@
await umbracoApi.documentType.ensureNameNotExists(childDocumentTypeName);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can create content with the list view data type', async ({umbracoApi, umbracoUi}) => {
test('can create content with the list view data type', async ({umbracoApi, umbracoUi}) => {
// Arrange
const expectedState = 'Draft';
const defaultListViewDataTypeName = 'List View - Content';
Expand All @@ -47,8 +46,7 @@
expect(await umbracoApi.document.getChildrenAmount(contentData.id)).toEqual(0);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can publish content with the list view data type', async ({umbracoApi, umbracoUi}) => {
test('can publish content with the list view data type', async ({umbracoApi, umbracoUi}) => {
// Arrange
const expectedState = 'Published';
const childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName);
Expand All @@ -70,8 +68,7 @@
expect(await umbracoApi.document.getChildrenAmount(documentId)).toEqual(0);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can create content with a child in the list', async ({umbracoApi, umbracoUi}) => {
test('can create content with a child in the list', async ({umbracoApi, umbracoUi}) => {
// Arrange
const childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName);
await umbracoApi.dataType.createListViewContentDataType(dataTypeName);
Expand All @@ -83,17 +80,16 @@

// Act
await umbracoUi.content.clickCreateContentWithName(childDocumentTypeName);
await umbracoUi.content.enterNameInContainer(childContentName);
await umbracoUi.content.clickSaveModalButton();
await umbracoUi.content.enterContentName(childContentName);
await umbracoUi.content.clickSaveButton();

// Assert
await umbracoUi.content.waitForContentToBeCreated();
expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy();
expect(await umbracoApi.document.getChildrenAmount(documentId)).toEqual(1);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can publish content with a child in the list', async ({umbracoApi, umbracoUi}) => {
test('can publish content with a child in the list', async ({umbracoApi, umbracoUi}) => {
// Arrange
const expectedState = 'Published';
const childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName);
Expand All @@ -111,7 +107,7 @@
await umbracoUi.content.clickSaveAndPublishButton();
await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton();
await umbracoUi.content.goToContentInListViewWithName(childContentName);
await umbracoUi.content.clickContainerSaveAndPublishButton();
await umbracoUi.content.clickSaveAndPublishButton();

// Assert
expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy();
Expand All @@ -123,8 +119,7 @@
expect(childContentData.variants[0].state).toBe(expectedState);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can not publish child in a list when parent is not published', async ({umbracoApi, umbracoUi}) => {
test('can not publish child in a list when parent is not published', async ({umbracoApi, umbracoUi}) => {
// Arrange
const expectedState = 'Draft';
const childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName);
Expand All @@ -138,7 +133,7 @@

// Act
await umbracoUi.content.goToContentInListViewWithName(childContentName);
await umbracoUi.content.clickContainerSaveAndPublishButton();
await umbracoUi.content.clickSaveAndPublishButton();

// Assert
// Content created, but not published
Expand All @@ -151,8 +146,7 @@
expect(childContentData.variants[0].state).toBe(expectedState);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('child is removed from list after child content is deleted', async ({umbracoApi, umbracoUi}) => {
test('child is removed from list after child content is deleted', async ({umbracoApi, umbracoUi}) => {
// Arrange
const childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName);
await umbracoApi.dataType.createListViewContentDataType(dataTypeName);
Expand All @@ -176,8 +170,7 @@
expect(await umbracoApi.document.doesNameExist(childContentName)).toBeFalsy();
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can sort list by name', async ({umbracoApi, umbracoUi}) => {
test('can sort list by name', async ({umbracoApi, umbracoUi}) => {
// Arrange
const childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName);
const secondChildContentName = 'ASecondChildContent';
Expand All @@ -200,8 +193,7 @@
await umbracoUi.content.doesFirstItemInListViewHaveName(secondChildContentName);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can publish child content from list', async ({umbracoApi, umbracoUi}) => {
test('can publish child content from list', async ({umbracoApi, umbracoUi}) => {
// Arrange
const expectedState = 'Published';
const childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName);
Expand All @@ -217,6 +209,7 @@
// Act
await umbracoUi.content.selectContentWithNameInListView(childContentName);
await umbracoUi.content.clickPublishSelectedListItems();
await umbracoUi.content.clickConfirmToPublishButton();

// Assert
await umbracoUi.content.waitForContentToBeCreated();
Expand All @@ -241,15 +234,15 @@
// Act
await umbracoUi.content.selectContentWithNameInListView(childContentName);
await umbracoUi.content.clickPublishSelectedListItems();
await umbracoUi.content.clickConfirmToPublishButton();

// Assert
await umbracoUi.content.isErrorNotificationVisible();
const childContentData = await umbracoApi.document.getByName(childContentName);
expect(childContentData.variants[0].state).toBe(expectedState);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can unpublish child content from list', async ({umbracoApi, umbracoUi}) => {
test('can unpublish child content from list', async ({umbracoApi, umbracoUi}) => {
// Arrange
const expectedState = 'Draft';
const childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName);
Expand All @@ -276,8 +269,7 @@
expect(childContentData.variants[0].state).toBe(expectedState);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can duplicate child content in list', async ({umbracoApi, umbracoUi}) => {
test('can duplicate child content in list', async ({umbracoApi, umbracoUi}) => {
// Arrange
const secondDocumentName = 'SecondDocument';
await umbracoApi.document.ensureNameNotExists(secondDocumentName);
Expand All @@ -294,7 +286,9 @@
// Act
await umbracoUi.content.selectContentWithNameInListView(childContentName);
await umbracoUi.content.clickDuplicateToSelectedListItems();
await umbracoUi.content.selectDocumentWithNameAtRoot(secondDocumentName);
await umbracoUi.content.openCaretButtonForName('Content');
await umbracoUi.content.clickModalMenuItemWithName(secondDocumentName);
await umbracoUi.content.clickChooseModalButton();

// Assert
await umbracoUi.content.isSuccessNotificationVisible();
Expand All @@ -308,8 +302,7 @@
expect(await umbracoApi.document.getChildrenAmount(secondDocumentId)).toEqual(1);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can move child content in list', async ({umbracoApi, umbracoUi}) => {
test('can move child content in list', async ({umbracoApi, umbracoUi}) => {
// Arrange
const secondDocumentName = 'SecondDocument';
await umbracoApi.document.ensureNameNotExists(secondDocumentName);
Expand All @@ -326,7 +319,9 @@
// Act
await umbracoUi.content.selectContentWithNameInListView(childContentName);
await umbracoUi.content.clickMoveToSelectedListItems();
await umbracoUi.content.selectDocumentWithNameAtRoot(secondDocumentName);
await umbracoUi.content.openCaretButtonForName('Content');
await umbracoUi.content.clickModalMenuItemWithName(secondDocumentName);
await umbracoUi.content.clickChooseModalButton();

// Assert
await umbracoUi.content.isSuccessNotificationVisible();
Expand All @@ -340,8 +335,7 @@
expect(await umbracoApi.document.getChildrenAmount(secondDocumentId)).toEqual(1);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can trash child content in list', async ({umbracoApi, umbracoUi}) => {
test('can trash child content in list', async ({umbracoApi, umbracoUi}) => {
// Arrange
const childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName);
await umbracoApi.dataType.createListViewContentDataTypeWithAllPermissions(dataTypeName);
Expand All @@ -364,8 +358,7 @@
await umbracoUi.content.isItemVisibleInRecycleBin(childContentName);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can search for child content in list', async ({umbracoApi, umbracoUi}) => {
test('can search for child content in list', async ({umbracoApi, umbracoUi}) => {
// Arrange
const secondChildName = 'SecondChildDocument';
await umbracoApi.document.ensureNameNotExists(secondChildName);
Expand All @@ -388,8 +381,7 @@
await umbracoUi.content.doesFirstItemInListViewHaveName(childContentName);
});

// Remove .skip when the issue is fixed: https://github.com/umbraco/Umbraco-CMS/issues/18615
test.skip('can change from list view to grid view in list', async ({umbracoApi, umbracoUi}) => {
test('can change from list view to grid view in list', async ({umbracoApi, umbracoUi}) => {
// Arrange
const childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName);
await umbracoApi.dataType.createListViewContentDataTypeWithAllPermissions(dataTypeName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ test('can add a culture', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
expect(domainsData.defaultIsoCode).toEqual(isoCode);
});

// Really flaky tests, only occurs on pipeline
test.skip('can add a domain', async ({umbracoApi, umbracoUi}) => {
test('can add a domain', async ({umbracoApi, umbracoUi}) => {
// Act
await umbracoUi.content.clickActionsMenuForContent(contentName);
await umbracoUi.content.clickCultureAndHostnamesActionMenuOption();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ test.skip('can add a custom view to a block', async ({umbracoApi, umbracoUi}) =>
await umbracoUi.dataType.goToDataType(blockGridEditorName);
await umbracoUi.dataType.goToBlockWithName(elementTypeName);
await umbracoUi.dataType.goToBlockAdvancedTab();
// TODO: Implement it later
});

// TODO: Remove skip and update test when the front-end is ready. Currently it is not possible to add a custom view to a block
Expand All @@ -40,6 +41,7 @@ test.skip('can remove a custom view from a block', async ({umbracoApi, umbracoUi
await umbracoUi.dataType.goToDataType(blockGridEditorName);
await umbracoUi.dataType.goToBlockWithName(elementTypeName);
await umbracoUi.dataType.goToBlockAdvancedTab();
// TODO: Implement it later
});

// TODO: Remove skip and update test when the front-end is ready. Currently it is not possible to add a custom stylesheet to a block
Expand All @@ -58,6 +60,7 @@ test.skip('can remove a custom stylesheet from a block', async ({umbracoApi, umb
await umbracoUi.dataType.goToDataType(blockGridEditorName);
await umbracoUi.dataType.goToBlockWithName(elementTypeName);
await umbracoUi.dataType.goToBlockAdvancedTab();
// TODO: Implement it later
});

test('can update overlay size in a block', async ({umbracoApi, umbracoUi}) => {
Expand Down Expand Up @@ -240,9 +243,7 @@ test('can remove a icon color from a block', async ({umbracoApi, umbracoUi}) =>
expect(await umbracoApi.dataType.doesBlockEditorBlockContainIconColor(blockGridEditorName, contentElementTypeId, '')).toBeTruthy();
});

// Remove skip when the front-end is ready. Currently it is not possible to add a thumbnail to a block
// Issue link: https://github.com/umbraco/Umbraco-CMS/issues/20264
test.skip('can add a thumbnail to a block', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
test('can add a thumbnail to a block', {tag: '@release'}, async ({umbracoApi, umbracoUi}) => {
// Arrange
const mediaName = 'TestMedia';
await umbracoApi.media.ensureNameNotExists(mediaName);
Expand All @@ -265,8 +266,7 @@ test.skip('can add a thumbnail to a block', {tag: '@smoke'}, async ({umbracoApi,
await umbracoUi.dataType.doesBlockHaveThumbnailImage(mediaUrl);
});

// TODO: Remove skip when the code is updated. Currently it is missing the assertion steps
test.skip('can remove a thumbnail from a block', async ({umbracoApi, umbracoUi}) => {
test.fixme('can remove a thumbnail from a block', async ({umbracoApi, umbracoUi}) => {
// Arrange
const textStringData = await umbracoApi.dataType.getByName(dataTypeName);
const contentElementTypeId = await umbracoApi.documentType.createDefaultElementType(elementTypeName, groupName, dataTypeName, textStringData.id);
Expand All @@ -276,4 +276,5 @@ test.skip('can remove a thumbnail from a block', async ({umbracoApi, umbracoUi})
await umbracoUi.dataType.goToDataType(blockGridEditorName);
await umbracoUi.dataType.goToBlockWithName(elementTypeName);
await umbracoUi.dataType.goToBlockAdvancedTab();
// TODO: Implement it later
});
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ test.skip('can resize an area for a block', async ({umbracoApi, umbracoUi}) => {
await umbracoUi.dataType.goToDataType(blockGridEditorName);
await umbracoUi.dataType.goToBlockWithName(elementTypeName);
await umbracoUi.dataType.goToBlockAreasTab();
// TODO: Implement it later
});

test('can update alias an area for a block', async ({umbracoApi, umbracoUi}) => {
Expand Down Expand Up @@ -235,8 +236,7 @@ test('can remove min allowed for an area in a block', async ({umbracoApi, umbrac
expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaWithMinAllowed(blockGridEditorName, contentElementTypeId, areaAlias, minAllowed)).toBeFalsy();
});

//TODO: Frontend issue. when value is inserted to the min or max, it is set as a string instead of number
test.skip('can add add max allowed for an area in a block', async ({umbracoApi, umbracoUi}) => {
test('can add add max allowed for an area in a block', async ({umbracoApi, umbracoUi}) => {
// Arrange
const textStringData = await umbracoApi.dataType.getByName(dataTypeName);
const areaAlias = 'TestArea';
Expand Down Expand Up @@ -329,26 +329,22 @@ test('can add specified allowance for an area in a block', async ({umbracoApi, u
await umbracoUi.dataType.isSuccessStateVisibleForSaveButton();
});

// TODO: It is currently not possible to add a specified allowance
test.skip('can update specified allowance for an area in a block', async ({umbracoApi, umbracoUi}) => {

test.fixme('can update specified allowance for an area in a block', async ({umbracoApi, umbracoUi}) => {
// TODO: Implement it later
});

// TODO: It is currently not possible to add a specified allowance
test.skip('can remove specified allowance for an area in a block', async ({umbracoApi, umbracoUi}) => {

test.fixme('can remove specified allowance for an area in a block', async ({umbracoApi, umbracoUi}) => {
// TODO: Implement it later
});

// TODO: It is currently not possible to add a specified allowance
test.skip('can add multiple specified allowances for an area in a block', async ({umbracoApi, umbracoUi}) => {

test.fixme('can add multiple specified allowances for an area in a block', async ({umbracoApi, umbracoUi}) => {
// TODO: Implement it later
});

// TODO: It is currently not possible to add a specified allowance
test.skip('can add specified allowance with min and max for an area in a block', async ({umbracoApi, umbracoUi}) => {
test.fixme('can add specified allowance with min and max for an area in a block', async ({umbracoApi, umbracoUi}) => {
// TODO: Implement it later
});

// TODO: It is currently not possible to add a specified allowance
test.skip('can remove min and max from specified allowance for an area in a block', async ({umbracoApi, umbracoUi}) => {

test.fixme('can remove min and max from specified allowance for an area in a block', async ({umbracoApi, umbracoUi}) => {
// TODO: Implement it later
});
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ test.fixme('can move a block from a group to another group in a block grid edito
expect(await umbracoApi.dataType.doesBlockGridGroupContainCorrectBlocks(blockGridEditorName, groupName, [elementTypeId])).toBeFalsy();
});

// TODO: When deleting a group should there not be a confirmation button? and should the block be moved another group when the group it was in is deleted?
test.skip('can delete a group in a block grid editor', async ({umbracoApi, umbracoUi}) => {
test.fixme('can delete a group in a block grid editor', async ({umbracoApi, umbracoUi}) => {
// Arrange
const textStringData = await umbracoApi.dataType.getByName(dataTypeName);
const elementTypeId = await umbracoApi.documentType.createDefaultElementType(elementTypeName, groupName, dataTypeName, textStringData.id);
Expand All @@ -240,6 +239,7 @@ test.skip('can delete a group in a block grid editor', async ({umbracoApi, umbra

// Act
await umbracoUi.dataType.goToDataType(blockGridEditorName);
// TODO: Implement it later
});

test('can add a min and max amount to a block grid editor', {tag: '@release'}, async ({umbracoApi, umbracoUi}) => {
Expand Down Expand Up @@ -390,6 +390,7 @@ test('can update grid columns in a block grid editor', async ({umbracoApi, umbra

// TODO: wait until fixed by frontend, currently you are able to insert multiple stylesheets
test.skip('can add a stylesheet a block grid editor', async ({umbracoApi, umbracoUi}) => {
// TODO: Implement it later
});

test('can remove a stylesheet in a block grid editor', async ({umbracoApi, umbracoUi}) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ test('can add a thumbnail to a block', {tag: '@release'}, async ({umbracoApi, um
await umbracoUi.dataType.doesBlockHaveThumbnailImage(mediaUrl);
});

// TODO: Thumbnails are not showing in the UI
test.skip('can remove a thumbnail to a block ', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {

test.fixme('can remove a thumbnail to a block ', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
// TODO: Implement it later
});
Loading
Loading