diff --git a/tests/Umbraco.Tests.AcceptanceTest/package-lock.json b/tests/Umbraco.Tests.AcceptanceTest/package-lock.json index d337791026..8fe7eaf9f3 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/package-lock.json +++ b/tests/Umbraco.Tests.AcceptanceTest/package-lock.json @@ -8,7 +8,7 @@ "hasInstallScript": true, "dependencies": { "@umbraco/json-models-builders": "^2.0.37", - "@umbraco/playwright-testhelpers": "^16.0.32", + "@umbraco/playwright-testhelpers": "^16.0.33", "camelize": "^1.0.0", "dotenv": "^16.3.1", "node-fetch": "^2.6.7" @@ -67,9 +67,9 @@ } }, "node_modules/@umbraco/playwright-testhelpers": { - "version": "16.0.32", - "resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-16.0.32.tgz", - "integrity": "sha512-HB/xHnu36XOyQjNnpSe1j9DoZ61tY7OvnkNQT73MhGcrhfnNdn/Hf+6nFN7gutUTcxn+L6COeXzexQclSjYr+g==", + "version": "16.0.33", + "resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-16.0.33.tgz", + "integrity": "sha512-sqUWuGmKwfhvQ+mmDCQwIWRu07tGVILuQaVs4dF1R7Z3KGPsQY0PKIulzDSgOyTHZLUnlxQudtr4i0alm3XHgQ==", "dependencies": { "@umbraco/json-models-builders": "2.0.37", "node-fetch": "^2.6.7" diff --git a/tests/Umbraco.Tests.AcceptanceTest/package.json b/tests/Umbraco.Tests.AcceptanceTest/package.json index 08612164f6..ee3715fda3 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/package.json +++ b/tests/Umbraco.Tests.AcceptanceTest/package.json @@ -22,7 +22,7 @@ }, "dependencies": { "@umbraco/json-models-builders": "^2.0.37", - "@umbraco/playwright-testhelpers": "^16.0.32", + "@umbraco/playwright-testhelpers": "^16.0.33", "camelize": "^1.0.0", "dotenv": "^16.3.1", "node-fetch": "^2.6.7" diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/ContentWithBlockGrid.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/ContentWithBlockGrid.spec.ts index 0bf8876761..f64de77c09 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/ContentWithBlockGrid.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/ContentWithBlockGrid.spec.ts @@ -96,6 +96,7 @@ test('can add a block element in the content', async ({umbracoApi, umbracoUi}) = }); test('can edit block element in the content', async ({umbracoApi, umbracoUi}) => { + // Arrange const updatedText = 'This updated block test'; await umbracoApi.document.createDefaultDocumentWithABlockGridEditor(contentName, elementTypeId, documentTypeName, customDataTypeName); await umbracoUi.goToBackOffice(); @@ -115,6 +116,7 @@ test('can edit block element in the content', async ({umbracoApi, umbracoUi}) => }); test('can delete block element in the content', async ({umbracoApi, umbracoUi}) => { + // Arrange await umbracoApi.document.createDefaultDocumentWithABlockGridEditor(contentName, elementTypeId, documentTypeName, customDataTypeName); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); @@ -147,7 +149,7 @@ test('cannot add block element if allow in root is disabled', async ({umbracoApi await umbracoUi.content.isAddBlockElementButtonVisible(false); }); -test('cannot add number of block element greater than the maximum amount', async ({umbracoApi, umbracoUi}) => { +test('cannot add number of block element greater than the maximum amount', {tag: '@release'}, async ({umbracoApi, umbracoUi}) => { // Arrange const customDataTypeId = await umbracoApi.dataType.createBlockGridWithABlockAndMinAndMaxAmount(customDataTypeName, elementTypeId, 0, 0); const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, customDataTypeName, customDataTypeId); @@ -163,8 +165,7 @@ test('cannot add number of block element greater than the maximum amount', async await umbracoUi.content.clickCreateModalButton(); // Assert - await umbracoUi.content.doesFormValidationMessageContainText('Maximum'); - await umbracoUi.content.doesFormValidationMessageContainText('too many'); + await umbracoUi.content.doesFormValidationMessageContainText('Maximum 0 entries, you have entered 1 too many.'); }); test('can set the label of create button in root', async ({umbracoApi, umbracoUi}) => { diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/ContentWithBlockList.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/ContentWithBlockList.spec.ts index 49ba06fed3..af21b576a5 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/ContentWithBlockList.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/ContentWithBlockList.spec.ts @@ -153,8 +153,7 @@ test('cannot add number of block element greater than the maximum amount', async await umbracoUi.content.clickCreateModalButton(); // Assert - await umbracoUi.content.doesFormValidationMessageContainText('Maximum'); - await umbracoUi.content.doesFormValidationMessageContainText('too many'); + await umbracoUi.content.doesFormValidationMessageContainText('Maximum 1 entries, you have entered 1 too many.'); }); test('can set the label of block element in the content', async ({umbracoApi, umbracoUi}) => { diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/IssueWithScheduledPublishing.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/IssueWithScheduledPublishing.spec.ts index b29250dd89..aad6f33a12 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/IssueWithScheduledPublishing.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/IssueWithScheduledPublishing.spec.ts @@ -38,4 +38,5 @@ test('can schedule publish after unselecting all languages', async ({umbracoUi}) // Assert await umbracoUi.content.doesSchedulePublishModalButtonContainDisabledTag(false); + await umbracoUi.content.clickSchedulePublishModalButton(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/RenderingContent/IPublishedContent.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/RenderingContent/IPublishedContent.spec.ts new file mode 100644 index 0000000000..504a25441e --- /dev/null +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/RenderingContent/IPublishedContent.spec.ts @@ -0,0 +1,38 @@ +import {test} from '@umbraco/playwright-testhelpers'; + +// Content +const contentName = 'Test Content'; +const secondContentName = 'SecondContent'; + +// Document Type +const documentTypeName = 'DocumentTypeForContent'; +const secondDocumentTypeName = 'TestSecondType'; + +// Template +const templateName = 'TestTemplateForContent'; + +test.afterEach(async ({umbracoApi}) => { + await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(secondContentName); + await umbracoApi.documentType.ensureNameNotExists(documentTypeName); + await umbracoApi.documentType.ensureNameNotExists(secondDocumentTypeName); + await umbracoApi.template.ensureNameNotExists(templateName); +}); + +test('can get a sibling of a content item of a different content type using SiblingsOfType method', {tag: '@release'}, async ({umbracoApi, umbracoUi}) => { + // Arrange + const secondDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentTypeWithAllowAsRoot(secondDocumentTypeName); + const secondContentId = await umbracoApi.document.createDefaultDocument(secondContentName, secondDocumentTypeId); + await umbracoApi.document.publish(secondContentId); + const templateId = await umbracoApi.template.createTemplateUsingSiblingOfTypeMethod(templateName, secondDocumentTypeName); + const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedTemplate(documentTypeName, templateId, true); + const contentId = await umbracoApi.document.createDocumentWithTemplate(contentName, documentTypeId, templateId); + await umbracoApi.document.publish(contentId); + const contentURL = await umbracoApi.document.getDocumentUrl(contentId); + + // Act + await umbracoUi.contentRender.navigateToRenderedContentPage(contentURL); + + // Assert + await umbracoUi.contentRender.doesContentRenderValueContainText(secondContentName, true); +}); \ No newline at end of file