From 3f57da5579dc7a432cb59d62e0cb9e68b93d15f2 Mon Sep 17 00:00:00 2001 From: Andreas Zerbst <73799582+andr317c@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:13:16 +0200 Subject: [PATCH] V16 QA updated notification acceptance tests (#19469) * Updated block grid tests * Updated notifications in tests * Updated tests * Added testIdAttribute * Bumped version of testHelpers * Added waits after creation * Updated more tests related to notifications * Bumped version * Cleaned up * updated tests * Bumped version * Updated tests * bumped version --- .../package-lock.json | 9 +-- .../Umbraco.Tests.AcceptanceTest/package.json | 2 +- .../Content/BlockGrid/BlockGridArea.spec.ts | 14 ++--- .../BlockGridWithPropertyEditor.spec.ts | 14 ++--- .../BlockGrid/ComplexBlockGridTest.spec.ts | 11 +--- .../BlockGrid/ContentWithBlockGrid.spec.ts | 30 +++------ .../SecondLevelBlockProperties.spec.ts | 9 +-- .../BlockGrid/VariantBlockGrid.spec.ts | 28 +++++---- .../BlockListWithPropertyEditor.spec.ts | 27 ++++---- .../BlockList/ContentWithBlockList.spec.ts | 32 ++++------ .../SecondLevelBlockProperties.spec.ts | 9 +-- .../BlockList/VariantBlockList.spec.ts | 28 +++++---- .../Content/ChildrenContent.spec.ts | 7 +-- .../ClipboardBlockGridBlocks.spec.ts | 24 +++---- .../ClipboardBlockListBlocks.spec.ts | 24 +++---- .../DefaultConfig/Content/Content.spec.ts | 16 ++--- .../Content/ContentInfoTab.spec.ts | 8 +-- .../Content/ContentWithApprovedColor.spec.ts | 11 ++-- .../Content/ContentWithCheckboxList.spec.ts | 13 ++-- .../Content/ContentWithContentPicker.spec.ts | 9 +-- .../Content/ContentWithCustomDataType.spec.ts | 43 +++++-------- .../ContentWithAllowVaryByCulture.spec.ts | 10 ++- .../ContentWithAllowedChildNodes.spec.ts | 6 +- .../ContentWithAllowedTemplates.spec.ts | 14 ++--- .../ContentWithCollections.spec.ts | 5 +- .../Content/ContentWithDropdown.spec.ts | 7 +-- .../Content/ContentWithImageCropper.spec.ts | 9 +-- .../ContentWithImageMediaPicker.spec.ts | 23 +++---- .../ContentWithListViewContent.spec.ts | 22 +++---- .../Content/ContentWithMediaPicker.spec.ts | 12 ++-- .../Content/ContentWithMemberPicker.spec.ts | 9 +-- .../Content/ContentWithMultiURLPicker.spec.ts | 28 +++------ ...ontentWithMultipleImageMediaPicker.spec.ts | 12 ++-- .../ContentWithMultipleMediaPicker.spec.ts | 14 ++--- .../Content/ContentWithNumeric.spec.ts | 8 +-- .../ContentWithPropertyEditors.spec.ts | 17 +++-- .../Content/ContentWithRadiobox.spec.ts | 12 ++-- .../Content/ContentWithTags.spec.ts | 14 ++--- .../Content/ContentWithTextarea.spec.ts | 15 ++--- .../Content/ContentWithTextstring.spec.ts | 16 ++--- .../Content/ContentWithTrueFalse.spec.ts | 20 +++--- .../Content/ContentWithUploadArticle.spec.ts | 20 +++--- .../Content/ContentWithUploadAudio.spec.ts | 20 +++--- .../Content/ContentWithUploadFile.spec.ts | 20 +++--- .../ContentWithUploadVectorGraphics.spec.ts | 12 ++-- .../Content/ContentWithUploadVideo.spec.ts | 12 ++-- .../Content/CultureAndHostnames.spec.ts | 18 +++--- .../Content/PublishWithDescendants.spec.ts | 2 +- .../RichTextEditor/ContentWithTiptap.spec.ts | 28 +++------ .../SecondLevelBlockProperties.spec.ts | 14 ++--- .../RichTextEditor/TiptapStyleSelect.spec.ts | 14 ++--- .../RichTextEditor/TiptapToolbar.spec.ts | 17 ++--- .../VariantTipTapBlocks.spec.ts | 34 +++++----- .../TrashContent/BulkTrashContent.spec.ts | 8 +-- .../DataType/ApprovedColor.spec.ts | 11 ++-- .../Block/BlockGridBlockAdvanced.spec.ts | 32 ++++------ .../Block/BlockGridBlockAreas.spec.ts | 39 ++++-------- .../Block/BlockGridBlockSettings.spec.ts | 37 ++++------- .../BlockGrid/BlockGridEditor.spec.ts | 59 +++++++---------- .../BlockListEditor/BlockListBlocks.spec.ts | 49 +++++---------- .../BlockListEditor/BlockListEditor.spec.ts | 53 ++++++---------- .../DataType/CheckboxList.spec.ts | 8 +-- .../DataType/ContentPicker.spec.ts | 9 +-- .../DefaultConfig/DataType/DataType.spec.ts | 20 +++--- .../DataTypeCollectionWorkspace.spec.ts | 14 ++--- .../DataType/DataTypeFolder.spec.ts | 18 ++---- .../DefaultConfig/DataType/DatePicker.spec.ts | 5 +- .../DefaultConfig/DataType/Dropdown.spec.ts | 11 ++-- .../DataType/ImageCropper.spec.ts | 11 ++-- .../DefaultConfig/DataType/Label.spec.ts | 3 +- .../DefaultConfig/DataType/ListView.spec.ts | 30 +++------ .../DataType/MediaPicker.spec.ts | 29 +++------ .../DataType/MultiUrlPicker.spec.ts | 18 +++--- .../DefaultConfig/DataType/Numeric.spec.ts | 13 ++-- .../DefaultConfig/DataType/Radiobox.spec.ts | 8 +-- .../tests/DefaultConfig/DataType/Tags.spec.ts | 6 +- .../DefaultConfig/DataType/Textarea.spec.ts | 6 +- .../DefaultConfig/DataType/Textstring.spec.ts | 3 +- .../DefaultConfig/DataType/Tiptap.spec.ts | 43 +++++-------- .../DefaultConfig/DataType/TrueFalse.spec.ts | 20 +++--- .../DataType/UploadField.spec.ts | 6 +- .../Dictionary/Dictionary.spec.ts | 14 ++--- .../DefaultConfig/Media/ListViewMedia.spec.ts | 6 +- .../tests/DefaultConfig/Media/Media.spec.ts | 30 ++++----- .../Members/MemberGroups.spec.ts | 12 ++-- .../DefaultConfig/Members/Members.spec.ts | 33 +++++----- .../DocumentBlueprint.spec.ts | 12 ++-- .../DocumentType/DocumentType.spec.ts | 24 +++---- .../DocumentTypeCollectionWorkspace.spec.ts | 37 +++++------ .../DocumentTypeDesignTab.spec.ts | 61 ++++++------------ .../DocumentType/DocumentTypeFolder.spec.ts | 16 ++--- .../DocumentTypeSettingsTab.spec.ts | 12 ++-- .../DocumentTypeStructureTab.spec.ts | 12 ++-- .../DocumentTypeTemplatesTab.spec.ts | 9 +-- .../Settings/Language/Language.spec.ts | 19 +++--- .../Settings/MediaType/MediaType.spec.ts | 19 +++--- .../MediaTypeCollectionWorkspace.spec.ts | 13 ++-- .../MediaType/MediaTypeDesignTab.spec.ts | 60 +++++++----------- .../MediaType/MediaTypeFolder.spec.ts | 21 +++---- .../MediaType/MediaTypeStructureTab.spec.ts | 15 ++--- .../Settings/PartialView/PartialView.spec.ts | 29 +++------ .../PartialView/PartialViewFolder.spec.ts | 18 ++---- .../Settings/Script/Script.spec.ts | 17 ++--- .../Settings/Script/ScriptFolder.spec.ts | 18 ++---- .../Settings/Stylesheet/Stylesheet.spec.ts | 17 ++--- .../Stylesheet/StylesheetFolder.spec.ts | 18 ++---- .../Settings/Template/Templates.spec.ts | 46 +++++--------- .../ContentWithTinyMCERichTextEditor.spec.ts | 3 +- .../DefaultPermissionsInContent.spec.ts | 36 ++++++----- .../Permissions/UserGroup/Languages.spec.ts | 3 +- .../UserGroup/MemberSection.spec.ts | 6 +- .../tests/DefaultConfig/Users/User.spec.ts | 46 +++++--------- .../DefaultConfig/Users/UserGroups.spec.ts | 63 +++++++------------ 113 files changed, 813 insertions(+), 1353 deletions(-) diff --git a/tests/Umbraco.Tests.AcceptanceTest/package-lock.json b/tests/Umbraco.Tests.AcceptanceTest/package-lock.json index b022c52841..bc9cbdfc34 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.35", - "@umbraco/playwright-testhelpers": "^16.0.20", + "@umbraco/playwright-testhelpers": "^16.0.23", "camelize": "^1.0.0", "dotenv": "^16.3.1", "node-fetch": "^2.6.7" @@ -66,9 +66,10 @@ } }, "node_modules/@umbraco/playwright-testhelpers": { - "version": "16.0.20", - "resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-16.0.20.tgz", - "integrity": "sha512-Oqhj7g4qYB63wy29MWlN/cbAw5gFPVgKL+7CuvJd0EQjisCB3tYTRr/PTrrUoI8SW6TJpnUkBL/XYQR2ufrjBQ==", + "version": "16.0.23", + "resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-16.0.23.tgz", + "integrity": "sha512-9By0jqdscFh5pRFCpBEvoOCOpEOUG9eoSGvyLPnWjiJtfTCSm2OHARX8QcP5vCU65TO59w7JwUcXBTExaRIFXg==", + "license": "MIT", "dependencies": { "@umbraco/json-models-builders": "2.0.35", "node-fetch": "^2.6.7" diff --git a/tests/Umbraco.Tests.AcceptanceTest/package.json b/tests/Umbraco.Tests.AcceptanceTest/package.json index 8bd214ce9b..5998bf61af 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/package.json +++ b/tests/Umbraco.Tests.AcceptanceTest/package.json @@ -21,7 +21,7 @@ }, "dependencies": { "@umbraco/json-models-builders": "^2.0.35", - "@umbraco/playwright-testhelpers": "^16.0.20", + "@umbraco/playwright-testhelpers": "^16.0.23", "camelize": "^1.0.0", "dotenv": "^16.3.1", "node-fetch": "^2.6.7" diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/BlockGridArea.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/BlockGridArea.spec.ts index a669c4f527..d92169baf2 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/BlockGridArea.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/BlockGridArea.spec.ts @@ -54,7 +54,7 @@ test('can create content with a block grid with an empty block in a area', {tag: await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); await umbracoUi.reloadPage(); await umbracoUi.content.doesBlockContainBlockInAreaWithName(firstElementTypeName, firstAreaName, firstElementTypeName); await umbracoUi.content.doesBlockContainBlockCountInArea(firstElementTypeName, firstAreaName, 1); @@ -80,7 +80,7 @@ test('can create content with a block grid with two empty blocks in a area', asy await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); await umbracoUi.reloadPage(); await umbracoUi.content.doesBlockContainCountOfBlockInArea(firstElementTypeName, firstAreaName, firstElementTypeName, 2); @@ -109,7 +109,7 @@ test('can create content with block grid area with a create label', async ({umbr await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); await umbracoUi.content.doesBlockGridBlockWithAreaContainCreateLabel(firstElementTypeName, createLabel); }); @@ -130,7 +130,7 @@ test('can create content with block grid area with column span', async ({umbraco await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); await umbracoUi.content.doesBlockAreaContainColumnSpan(firstElementTypeName, firstAreaName, columnSpan, 0); }); @@ -151,7 +151,7 @@ test('can create content with block grid area with row span', async ({umbracoApi await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); await umbracoUi.content.doesBlockAreaContainRowSpan(firstElementTypeName, firstAreaName, rowSpan, 0); }); @@ -181,7 +181,7 @@ test.fixme('can create content with block grid area with min allowed', async ({u await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); // Clean await umbracoApi.documentType.ensureNameNotExists(secondElementTypeName); @@ -213,7 +213,7 @@ test.fixme('can create content with block grid area with max allowed', async ({u await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); // Clean await umbracoApi.documentType.ensureNameNotExists(secondElementTypeName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/BlockGridWithPropertyEditor.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/BlockGridWithPropertyEditor.spec.ts index ee6be8ea9d..d6b7558eb9 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/BlockGridWithPropertyEditor.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/BlockGridWithPropertyEditor.spec.ts @@ -54,9 +54,7 @@ test('can not publish a block grid with a mandatory radiobox without a value', a await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); }); test('can not publish a block grid with a mandatory checkbox list without a value', async ({umbracoApi, umbracoUi}) => { @@ -84,9 +82,7 @@ test('can not publish a block grid with a mandatory checkbox list without a valu await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); }); test('can not publish a block grid with a mandatory dropdown without a value', async ({umbracoApi, umbracoUi}) => { @@ -114,7 +110,5 @@ test('can not publish a block grid with a mandatory dropdown without a value', a await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); -}); \ No newline at end of file + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/ComplexBlockGridTest.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/ComplexBlockGridTest.spec.ts index 652065835e..fba0b3acf2 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/ComplexBlockGridTest.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/ComplexBlockGridTest.spec.ts @@ -64,8 +64,7 @@ test.afterEach(async ({umbracoApi}) => { await umbracoApi.dataType.ensureNameNotExists(richTextDataTypeName); }); -// Needs to be updated as we are not asserting on save or publish notifications as we did in 15 -test.fixme('can update property value nested in a block grid area with an RTE with a block list editor', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { +test('can update property value nested in a block grid area with an RTE with a block list editor', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { test.slow(); // Arrange // ElementType with Textstring And REGEX only accept letters and numbers @@ -106,10 +105,9 @@ test.fixme('can update property value nested in a block grid area with an RTE wi await umbracoUi.content.clickCreateButtonForModalWithElementTypeNameAndGroupName(richTextEditorElementTypeName, richTextEditorElementGroupName); await umbracoUi.content.clickSaveAndPublishButton(); // Checks that the error notification is shown since the textstring block has the wrong value - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved, true, true); + await umbracoUi.content.isFailedStateButtonVisible(); await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished, true, true); // Updates the textstring block with the correct value - await umbracoUi.waitForTimeout(1000); await umbracoUi.content.clickBlockElementWithName(blockListElementTypeName); await umbracoUi.content.clickEditBlockListEntryWithName(textStringElementTypeName); await umbracoUi.content.enterPropertyValue(textStringElementDataTypeName, correctPropertyValue); @@ -118,10 +116,7 @@ test.fixme('can update property value nested in a block grid area with an RTE wi await umbracoUi.content.clickSaveAndPublishButton(); // Assert - // await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved, true, true); - // await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published, true, true); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.waitForTimeout(1000); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); // Checks if published const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe('Published'); 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 6643c93cd9..23742c85e5 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 @@ -39,8 +39,7 @@ test('can create content with an empty block grid', async ({umbracoApi, umbracoU await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -63,8 +62,7 @@ test('can publish content with an empty block grid', async ({umbracoApi, umbraco await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -89,8 +87,7 @@ test('can add a block element in the content', async ({umbracoApi, umbracoUi}) = await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.contentData[0].values[0].value).toEqual(inputText); @@ -112,8 +109,7 @@ test('can edit block element in the content', async ({umbracoApi, umbracoUi}) => await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.contentData[0].values[0].value).toEqual(updatedText); }); @@ -130,8 +126,7 @@ test('can delete block element in the content', async ({umbracoApi, umbracoUi}) await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); const blockGridValue = contentData.values.find(item => item.value); expect(blockGridValue).toBeFalsy(); @@ -205,8 +200,7 @@ test('can set the label of block element in the content', async ({umbracoApi, um await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); await umbracoUi.content.doesBlockElementHaveName(blockLabel); }); @@ -227,8 +221,7 @@ test('can set the number of columns for the layout in the content', async ({umbr await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); const layoutValue = contentData.values[0]?.value.layout["Umbraco.BlockGrid"]; expect(layoutValue[0].columnSpan).toBe(gridColumns); @@ -260,7 +253,7 @@ test.skip('can add settings model for the block in the content', async ({umbraco await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); await umbracoUi.content.isErrorNotificationVisible(false); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.contentData[0].values[0].value).toEqual(contentBlockInputText); @@ -289,7 +282,6 @@ test('can create content with a block grid with the inline editing mode enabled' await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); await umbracoUi.content.isErrorNotificationVisible(false); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); }); @@ -312,13 +304,11 @@ test('can add a block element with inline editing mode enabled', async ({umbraco await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.contentData[0].values[0].value).toEqual(inputText); const blockListValue = contentData.values.find(item => item.editorAlias === "Umbraco.BlockGrid")?.value; expect(blockListValue).toBeTruthy(); await umbracoUi.content.doesPropertyContainValue(propertyInBlock, inputText); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/SecondLevelBlockProperties.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/SecondLevelBlockProperties.spec.ts index 292d7c96d3..86cd3387f4 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/SecondLevelBlockProperties.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/SecondLevelBlockProperties.spec.ts @@ -58,8 +58,7 @@ test('can publish a block grid editor with a rich text editor', async ({umbracoA await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton() // Asserts that the value in the RTE is as expected const documentData = await umbracoApi.document.getByName(contentName); const documentValues = documentData.values.find(value => value.alias === AliasHelper.toAlias(blockGridDataTypeName)); @@ -102,8 +101,7 @@ test('can publish a block grid editor with a block list editor', async ({umbraco await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton() // Asserts that the value in the BlockList is as expected const documentData = await umbracoApi.document.getByName(contentName); const documentValues = documentData.values.find(value => value.alias === AliasHelper.toAlias(blockGridDataTypeName)); @@ -147,8 +145,7 @@ test('can publish a block grid editor with a block grid editor', async ({umbraco await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton() // Asserts that the value in the BlockGrid is as expected const documentData = await umbracoApi.document.getByName(contentName); const documentValues = documentData.values.find(value => value.alias === AliasHelper.toAlias(blockGridDataTypeName)); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/VariantBlockGrid.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/VariantBlockGrid.spec.ts index e5219336dd..d1eb3ce3d7 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/VariantBlockGrid.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockGrid/VariantBlockGrid.spec.ts @@ -1,4 +1,5 @@ import {ConstantHelper, NotificationConstantHelper, test} from "@umbraco/playwright-testhelpers"; +import {expect} from "@playwright/test"; // Document Type const documentTypeName = 'DocumentTypeName'; @@ -22,6 +23,7 @@ const textStringText = 'ThisIsATextString'; // Content Name const contentName = 'ContentName'; +let contentId = null; test.beforeEach(async ({umbracoApi}) => { await umbracoApi.language.ensureIsoCodeNotExists('da'); @@ -43,7 +45,7 @@ test('invariant document type with invariant block grid with invariant block wit elementTypeId = await umbracoApi.documentType.createDefaultElementType(blockName, elementGroupName, textStringName, textStringDataTypeId); blockGridId = await umbracoApi.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridName, elementTypeId, true); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockGridName, blockGridId, documentTypeGroupName); - await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); await umbracoUi.content.goToContentWithName(contentName); @@ -56,8 +58,8 @@ test('invariant document type with invariant block grid with invariant block wit await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); await umbracoUi.reloadPage(); await umbracoUi.content.goToBlockGridBlockWithName(documentTypeGroupName, blockGridName, blockName); await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText); @@ -68,7 +70,7 @@ test('can not create unsupported invariant document type with invariant block gr elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, false); blockGridId = await umbracoApi.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridName, elementTypeId, true); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockGridName, blockGridId, documentTypeGroupName); - await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); // Act @@ -77,8 +79,10 @@ test('can not create unsupported invariant document type with invariant block gr await umbracoUi.content.clickSaveAndPublishButton(); // Assert + await umbracoUi.content.isFailedStateButtonVisible(); await umbracoUi.content.isErrorNotificationVisible(); await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished); + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeFalsy(); }); test('can not create unsupported invariant document type with invariant block grid with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => { @@ -86,7 +90,7 @@ test('can not create unsupported invariant document type with invariant block gr elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, true); blockGridId = await umbracoApi.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridName, elementTypeId, true); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockGridName, blockGridId, documentTypeGroupName); - await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); @@ -96,8 +100,10 @@ test('can not create unsupported invariant document type with invariant block gr await umbracoUi.content.clickSaveAndPublishButton(); // Assert + await umbracoUi.content.isFailedStateButtonVisible(); await umbracoUi.content.isErrorNotificationVisible(); await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished); + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeFalsy(); }); test('variant document type with variant block grid with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => { @@ -105,7 +111,7 @@ test('variant document type with variant block grid with variant block with an v elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, true); blockGridId = await umbracoApi.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridName, elementTypeId, true); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockGridName, blockGridId, documentTypeGroupName, true); - await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); await umbracoUi.content.goToContentWithName(contentName); @@ -120,7 +126,7 @@ test('variant document type with variant block grid with variant block with an v // Assert await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); await umbracoUi.reloadPage(); await umbracoUi.content.goToBlockGridBlockWithName(documentTypeGroupName, blockGridName, blockName); await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText); @@ -131,7 +137,7 @@ test('variant document type with invariant block grid with variant block with an elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, false); blockGridId = await umbracoApi.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridName, elementTypeId, true); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockGridName, blockGridId, documentTypeGroupName, true, false); - await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); await umbracoUi.content.goToContentWithName(contentName); @@ -146,7 +152,7 @@ test('variant document type with invariant block grid with variant block with an // Assert await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); await umbracoUi.reloadPage(); await umbracoUi.content.goToBlockGridBlockWithName(documentTypeGroupName, blockGridName, blockName); await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText); @@ -157,7 +163,7 @@ test('variant document type with invariant block grid with variant block with an elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, true); blockGridId = await umbracoApi.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridName, elementTypeId, true); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockGridName, blockGridId, documentTypeGroupName, true, false); - await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); await umbracoUi.content.goToContentWithName(contentName); @@ -172,7 +178,7 @@ test('variant document type with invariant block grid with variant block with an // Assert await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); await umbracoUi.reloadPage(); await umbracoUi.content.goToBlockGridBlockWithName(documentTypeGroupName, blockGridName, blockName); await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/BlockListWithPropertyEditor.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/BlockListWithPropertyEditor.spec.ts index b1aaf7016f..600f1f8f6e 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/BlockListWithPropertyEditor.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/BlockListWithPropertyEditor.spec.ts @@ -1,7 +1,9 @@ -import {ConstantHelper, NotificationConstantHelper, test} from '@umbraco/playwright-testhelpers'; +import {ConstantHelper, test} from '@umbraco/playwright-testhelpers'; +import {expect} from "@playwright/test"; // Content Name const contentName = 'ContentName'; +let contentId = null; // Document Type const documentTypeName = 'DocumentTypeName'; @@ -35,7 +37,7 @@ test('can not publish a block list with a mandatory radiobox without a value', a elementTypeId = await umbracoApi.documentType.createDefaultElementType(blockName, elementGroupName, propertyEditorName, propertyEditorId, true); blockListId = await umbracoApi.dataType.createBlockListDataTypeWithABlock(blockListName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListName, blockListId, documentTypeGroupName); - await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); @@ -54,9 +56,8 @@ test('can not publish a block list with a mandatory radiobox without a value', a await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); }); test('can not publish a block list with a mandatory checkbox list without a value', async ({umbracoApi, umbracoUi}) => { @@ -65,7 +66,7 @@ test('can not publish a block list with a mandatory checkbox list without a valu elementTypeId = await umbracoApi.documentType.createDefaultElementType(blockName, elementGroupName, propertyEditorName, propertyEditorId, true); blockListId = await umbracoApi.dataType.createBlockListDataTypeWithABlock(blockListName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListName, blockListId, documentTypeGroupName); - await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); @@ -84,9 +85,8 @@ test('can not publish a block list with a mandatory checkbox list without a valu await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); }); test('can not publish a block list with a mandatory dropdown without a value', async ({umbracoApi, umbracoUi}) => { @@ -95,7 +95,7 @@ test('can not publish a block list with a mandatory dropdown without a value', a elementTypeId = await umbracoApi.documentType.createDefaultElementType(blockName, elementGroupName, propertyEditorName, propertyEditorId, true); blockListId = await umbracoApi.dataType.createBlockListDataTypeWithABlock(blockListName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListName, blockListId, documentTypeGroupName); - await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); @@ -114,7 +114,6 @@ test('can not publish a block list with a mandatory dropdown without a value', a await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); -}); \ No newline at end of file + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); +}); 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 f7df86fb98..8626684d54 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 @@ -39,8 +39,7 @@ test('can create content with an empty block list', async ({umbracoApi, umbracoU await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -63,8 +62,7 @@ test('can publish content with an empty block list', async ({umbracoApi, umbraco await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -89,8 +87,7 @@ test('can add a block element in the content', async ({umbracoApi, umbracoUi}) = await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.contentData[0].values[0].value).toEqual(inputText); @@ -112,8 +109,7 @@ test('can edit block element in the content', async ({umbracoApi, umbracoUi}) => await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.contentData[0].values[0].value).toEqual(updatedText); }); @@ -130,8 +126,7 @@ test('can delete block element in the content', async ({umbracoApi, umbracoUi}) await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); const blockGridValue = contentData.values.find(item => item.value); expect(blockGridValue).toBeFalsy(); @@ -179,8 +174,7 @@ test('can set the label of block element in the content', async ({umbracoApi, um await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); await umbracoUi.content.doesBlockElementHaveName(blockLabel); }); @@ -209,8 +203,7 @@ test.skip('can add settings model for the block in the content', async ({umbraco await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.contentData[0].values[0].value).toEqual(contentBlockInputText); expect(contentData.values[0].value.settingsData[0].values[0].value).toEqual(settingBlockInputText); @@ -225,7 +218,7 @@ test.skip('can move blocks in the content', async ({umbracoApi, umbracoUi}) => { test('can create content with a block list with the inline editing mode enabled', async ({umbracoApi, umbracoUi}) => { // Arrange - const customDataTypeId = await umbracoApi.dataType.createBlockListDataTypeWithInlineEditingMode(customDataTypeName, elementTypeId); + const customDataTypeId = await umbracoApi.dataType.createBlockListDataTypeWithInlineEditingMode(customDataTypeName, true); await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, customDataTypeName, customDataTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); @@ -238,8 +231,7 @@ test('can create content with a block list with the inline editing mode enabled' await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); }); @@ -261,12 +253,10 @@ test('can add a block element with inline editing mode enabled', async ({umbraco await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.contentData[0].values[0].value).toEqual(inputText); const blockListValue = contentData.values.find(item => item.editorAlias === "Umbraco.BlockList")?.value; expect(blockListValue).toBeTruthy(); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/SecondLevelBlockProperties.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/SecondLevelBlockProperties.spec.ts index ac3dd0aefd..6d0abbfb82 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/SecondLevelBlockProperties.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/SecondLevelBlockProperties.spec.ts @@ -58,8 +58,7 @@ test('can publish a block list editor with a rich text editor', async ({umbracoA await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); // Asserts that the value in the RTE is as expected const documentData = await umbracoApi.document.getByName(contentName); const documentRichTextValues = documentData.values[0].value.contentData[0].values.find(value => value.alias === AliasHelper.toAlias(richTextDataTypeName)); @@ -102,8 +101,7 @@ test('can publish a block list editor with a block grid editor', async ({umbraco await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); // Asserts that the value in the BlockGrid is as expected const documentData = await umbracoApi.document.getByName(contentName); const documentValues = documentData.values.find(value => value.alias === AliasHelper.toAlias(blockListDataTypeName)); @@ -147,8 +145,7 @@ test('can publish a block list editor with a block list editor', async ({umbraco await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); // Asserts that the value in the BlockList is as expected const documentData = await umbracoApi.document.getByName(contentName); const documentValues = documentData.values.find(value => value.alias === AliasHelper.toAlias(blockListDataTypeName)); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/VariantBlockList.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/VariantBlockList.spec.ts index afbb894c37..a6f7c78730 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/VariantBlockList.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/VariantBlockList.spec.ts @@ -1,4 +1,5 @@ import {ConstantHelper, NotificationConstantHelper, test} from "@umbraco/playwright-testhelpers"; +import {expect} from "@playwright/test"; // Document Type const documentTypeName = 'DocumentTypeName'; @@ -22,6 +23,7 @@ const textStringText = 'ThisIsATextString'; // Content Name const contentName = 'ContentName'; +let contentId = null; test.beforeEach(async ({umbracoApi}) => { await umbracoApi.language.ensureIsoCodeNotExists('da'); @@ -43,7 +45,7 @@ test('invariant document type with invariant block list with invariant block wit elementTypeId = await umbracoApi.documentType.createDefaultElementType(blockName, elementGroupName, textStringName, textStringDataTypeId); blockListId = await umbracoApi.dataType.createBlockListDataTypeWithABlock(blockListName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListName, blockListId, documentTypeGroupName); - await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); await umbracoUi.content.goToContentWithName(contentName); @@ -56,8 +58,8 @@ test('invariant document type with invariant block list with invariant block wit await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); await umbracoUi.reloadPage(); await umbracoUi.content.goToBlockListBlockWithName(documentTypeGroupName, blockListName, blockName); await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText); @@ -68,7 +70,7 @@ test('can not create unsupported invariant document type with invariant block li elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, false); blockListId = await umbracoApi.dataType.createBlockListDataTypeWithABlock(blockListName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListName, blockListId, documentTypeGroupName); - await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); // Act @@ -77,8 +79,10 @@ test('can not create unsupported invariant document type with invariant block li await umbracoUi.content.clickSaveAndPublishButton(); // Assert + await umbracoUi.content.isFailedStateButtonVisible(); await umbracoUi.content.isErrorNotificationVisible(); await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished); + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeFalsy(); }); test('can not create unsupported invariant document type with invariant block list with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => { @@ -86,7 +90,7 @@ test('can not create unsupported invariant document type with invariant block li elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, true); blockListId = await umbracoApi.dataType.createBlockListDataTypeWithABlock(blockListName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListName, blockListId, documentTypeGroupName); - await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); // Act @@ -95,8 +99,10 @@ test('can not create unsupported invariant document type with invariant block li await umbracoUi.content.clickSaveAndPublishButton(); // Assert + await umbracoUi.content.isFailedStateButtonVisible(); await umbracoUi.content.isErrorNotificationVisible(); await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished); + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeFalsy(); }); test('variant document type with variant block list with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => { @@ -104,7 +110,7 @@ test('variant document type with variant block list with variant block with an v elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, true); blockListId = await umbracoApi.dataType.createBlockListDataTypeWithABlock(blockListName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListName, blockListId, documentTypeGroupName, true); - await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); await umbracoUi.content.goToContentWithName(contentName); @@ -119,7 +125,7 @@ test('variant document type with variant block list with variant block with an v // Assert await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); await umbracoUi.reloadPage(); await umbracoUi.content.goToBlockListBlockWithName(documentTypeGroupName, blockListName, blockName); await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText); @@ -130,7 +136,7 @@ test('variant document type with invariant block list with variant block with an elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, false); blockListId = await umbracoApi.dataType.createBlockListDataTypeWithABlock(blockListName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListName, blockListId, documentTypeGroupName, true, false); - await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); await umbracoUi.content.goToContentWithName(contentName); @@ -145,7 +151,7 @@ test('variant document type with invariant block list with variant block with an // Assert await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); await umbracoUi.reloadPage(); await umbracoUi.content.goToBlockListBlockWithName(documentTypeGroupName, blockListName, blockName); await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText); @@ -156,7 +162,7 @@ test('variant document type with invariant block list with variant block with an elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, true); blockListId = await umbracoApi.dataType.createBlockListDataTypeWithABlock(blockListName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListName, blockListId, documentTypeGroupName, true, false); - await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); await umbracoUi.content.goToContentWithName(contentName); @@ -171,7 +177,7 @@ test('variant document type with invariant block list with variant block with an // Assert await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); await umbracoUi.reloadPage(); await umbracoUi.content.goToBlockListBlockWithName(documentTypeGroupName, blockListName, blockName); await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ChildrenContent.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ChildrenContent.spec.ts index 7cca397f75..40e475199d 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ChildrenContent.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ChildrenContent.spec.ts @@ -37,8 +37,7 @@ test('can create child node', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) = await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(childContentName)).toBeTruthy(); const childData = await umbracoApi.document.getChildren(contentId); expect(childData[0].variants[0].name).toBe(childContentName); @@ -77,8 +76,7 @@ test('can create child node in child node', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); const childOfChildData = await umbracoApi.document.getChildren(childContentId); expect(childOfChildData[0].variants[0].name).toBe(childOfChildContentName); // verify that the child content displays in the tree @@ -127,7 +125,6 @@ test('can publish content with child node', {tag: '@smoke'}, async ({umbracoApi, // Assert await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - await umbracoUi.content.isErrorNotificationVisible(false); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe('Published'); const childContentData = await umbracoApi.document.getByName(childContentName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Clipboard/ClipboardBlockGridBlocks.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Clipboard/ClipboardBlockGridBlocks.spec.ts index 866cbe9959..0cfdccd38b 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Clipboard/ClipboardBlockGridBlocks.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Clipboard/ClipboardBlockGridBlocks.spec.ts @@ -71,8 +71,7 @@ test('can copy and paste a single block into the same document and group', async await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Original block await umbracoUi.content.goToBlockGridBlockWithName(groupName, blockGridDataTypeName, elementTypeName, 0); await umbracoUi.content.doesBlockEditorBlockWithNameContainValue(elementGroupName, elementPropertyName, ConstantHelper.inputTypes.tipTap, blockPropertyValue); @@ -97,8 +96,7 @@ test('can copy and paste a single block into the same document but different gro await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Original block await umbracoUi.content.goToBlockGridBlockWithName(groupName, blockGridDataTypeName, elementTypeName, 0); await umbracoUi.content.doesBlockEditorBlockWithNameContainValue(elementGroupName, elementPropertyName, ConstantHelper.inputTypes.tipTap, blockPropertyValue); @@ -127,8 +125,7 @@ test('can copy and paste a single block into another document', async ({umbracoA await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Copied block await umbracoUi.content.goToBlockGridBlockWithName(groupName, blockGridDataTypeName, elementTypeName, 0); await umbracoUi.content.doesBlockEditorBlockWithNameContainValue(elementGroupName, elementPropertyName, ConstantHelper.inputTypes.tipTap, blockPropertyValue); @@ -153,8 +150,7 @@ test('can copy and paste multiple blocks into the same document and group', {tag await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Original blocks await umbracoUi.content.goToBlockGridBlockWithName(groupName, blockGridDataTypeName, elementTypeName, 0); await umbracoUi.content.doesBlockEditorBlockWithNameContainValue(elementGroupName, elementPropertyName, ConstantHelper.inputTypes.tipTap, blockPropertyValue); @@ -186,8 +182,7 @@ test('can copy and paste multiple blocks into the same document but different gr await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Original blocks await umbracoUi.content.goToBlockGridBlockWithName(groupName, blockGridDataTypeName, elementTypeName, 0); await umbracoUi.content.doesBlockEditorBlockWithNameContainValue(elementGroupName, elementPropertyName, ConstantHelper.inputTypes.tipTap, blockPropertyValue); @@ -223,8 +218,7 @@ test('can copy and paste multiple blocks into another document', async ({umbrac await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Copied blocks await umbracoUi.content.goToBlockGridBlockWithName(groupName, blockGridDataTypeName, elementTypeName, 0); await umbracoUi.content.doesBlockEditorBlockWithNameContainValue(elementGroupName, elementPropertyName, ConstantHelper.inputTypes.tipTap, blockPropertyValue); @@ -271,8 +265,7 @@ test('can replace multiple blocks', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); await umbracoUi.content.doesBlockGridPropertyHaveBlockAmount(groupName, blockGridDataTypeName, 1); }); @@ -294,8 +287,7 @@ test('can copy block from a block grid to a block list', async ({umbracoApi, umb await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Original blocks // Block Grid await umbracoUi.content.goToBlockGridBlockWithName(groupName, blockGridDataTypeName, elementTypeName, 0); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Clipboard/ClipboardBlockListBlocks.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Clipboard/ClipboardBlockListBlocks.spec.ts index d56e2e0ac7..615112ef45 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Clipboard/ClipboardBlockListBlocks.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Clipboard/ClipboardBlockListBlocks.spec.ts @@ -71,8 +71,7 @@ test('can copy and paste a single block into the same document and group', async await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Original block await umbracoUi.content.goToBlockListBlockWithName(groupName, blockListDataTypeName, elementTypeName, 0); await umbracoUi.content.doesBlockEditorBlockWithNameContainValue(elementGroupName, elementPropertyName, ConstantHelper.inputTypes.tipTap, blockPropertyValue); @@ -97,8 +96,7 @@ test('can copy and paste a single block into the same document but different gro await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Original block await umbracoUi.content.goToBlockListBlockWithName(groupName, blockListDataTypeName, elementTypeName, 0); await umbracoUi.content.doesBlockEditorBlockWithNameContainValue(elementGroupName, elementPropertyName, ConstantHelper.inputTypes.tipTap, blockPropertyValue); @@ -127,8 +125,7 @@ test('can copy and paste a single block into another document', async ({umbracoA await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Copied block await umbracoUi.content.goToBlockListBlockWithName(groupName, blockListDataTypeName, elementTypeName, 0); await umbracoUi.content.doesBlockEditorBlockWithNameContainValue(elementGroupName, elementPropertyName, ConstantHelper.inputTypes.tipTap, blockPropertyValue); @@ -153,8 +150,7 @@ test('can copy and paste multiple blocks into the same document and group', {tag await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Original blocks await umbracoUi.content.goToBlockListBlockWithName(groupName, blockListDataTypeName, elementTypeName, 0); await umbracoUi.content.doesBlockEditorBlockWithNameContainValue(elementGroupName, elementPropertyName, ConstantHelper.inputTypes.tipTap, blockPropertyValue); @@ -186,8 +182,7 @@ test('can copy and paste multiple blocks into the same document but different gr await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Original blocks await umbracoUi.content.goToBlockListBlockWithName(groupName, blockListDataTypeName, elementTypeName, 0); await umbracoUi.content.doesBlockEditorBlockWithNameContainValue(elementGroupName, elementPropertyName, ConstantHelper.inputTypes.tipTap, blockPropertyValue); @@ -223,8 +218,7 @@ test('can copy and paste multiple blocks into another document', async ({umbraco await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Copied blocks await umbracoUi.content.goToBlockListBlockWithName(groupName, blockListDataTypeName, elementTypeName, 0); await umbracoUi.content.doesBlockEditorBlockWithNameContainValue(elementGroupName, elementPropertyName, ConstantHelper.inputTypes.tipTap, blockPropertyValue); @@ -271,8 +265,7 @@ test('can replace multiple blocks', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); await umbracoUi.content.doesBlockListPropertyHaveBlockAmount(groupName, blockListDataTypeName, 1); }); @@ -294,8 +287,7 @@ test('can copy block from a block list to a block grid', async ({umbracoApi, um await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Original blocks // Block List await umbracoUi.content.goToBlockListBlockWithName(groupName, blockListDataTypeName, elementTypeName, 0); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Content.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Content.spec.ts index 6c98206c2e..8dad3e4659 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Content.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Content.spec.ts @@ -32,8 +32,7 @@ test('can create empty content', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -54,9 +53,7 @@ test('can save and publish empty content', {tag: '@smoke'}, async ({umbracoApi, await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -78,8 +75,7 @@ test('can create content', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value).toBe(contentText); @@ -100,8 +96,7 @@ test('can rename content', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeRenamed(); const updatedContentData = await umbracoApi.document.get(contentId); expect(updatedContentData.variants[0].name).toEqual(contentName); }); @@ -121,8 +116,7 @@ test('can update content', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const updatedContentData = await umbracoApi.document.get(contentId); expect(updatedContentData.variants[0].name).toEqual(contentName); expect(updatedContentData.values[0].value).toBe(contentText); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentInfoTab.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentInfoTab.spec.ts index 636967fdc8..54c07aa39f 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentInfoTab.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentInfoTab.spec.ts @@ -33,10 +33,7 @@ test('can see correct information when published', async ({umbracoApi, umbracoUi await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); - // TODO: Since we are not asserting on a success notification yet, we need to wait for a second to make sure the content is published - await umbracoUi.waitForTimeout(1000); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); const contentData = await umbracoApi.document.getByName(contentName); await umbracoUi.content.doesIdHaveText(contentData.id); const expectedCreatedDate = new Date(contentData.variants[0].createDate).toLocaleString("en-US", { @@ -111,8 +108,7 @@ test('can change template', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.template.id).toBe(secondTemplateId); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithApprovedColor.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithApprovedColor.spec.ts index 71be717fd3..c40aee03dd 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithApprovedColor.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithApprovedColor.spec.ts @@ -12,7 +12,7 @@ test.beforeEach(async ({umbracoApi, umbracoUi}) => { }); test.afterEach(async ({umbracoApi}) => { - await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.documentType.ensureNameNotExists(documentTypeName); }); @@ -31,8 +31,7 @@ test('can create content with the approved color data type', async ({umbracoApi, await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -52,8 +51,7 @@ test('can publish content with the approved color data type', async ({umbracoApi await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -76,8 +74,7 @@ test('can create content with the custom approved color data type', async ({umbr await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithCheckboxList.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithCheckboxList.spec.ts index 6d40370d27..3e26e6f2d7 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithCheckboxList.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithCheckboxList.spec.ts @@ -34,8 +34,7 @@ test('can create content with the checkbox list data type', async ({umbracoApi, await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -55,9 +54,7 @@ test('can publish content with the checkbox list data type', async ({umbracoApi, await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); expect(contentData.values).toEqual([]); @@ -77,9 +74,7 @@ test('can create content with the custom checkbox list data type', async ({umbra await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); expect(contentData.values[0].value).toEqual([optionValues[0]]); @@ -106,7 +101,7 @@ test('can not publish a mandatory checkbox list with an empty value', async ({um await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); expect(contentData.values[0].value).toEqual([optionValues[0]]); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithContentPicker.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithContentPicker.spec.ts index d34d387baa..3eae342652 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithContentPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithContentPicker.spec.ts @@ -39,8 +39,7 @@ test('can create content with the content picker datatype', {tag: '@smoke'}, asy await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -63,8 +62,7 @@ test('can publish content with the content picker data type', async ({umbracoApi await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -171,8 +169,7 @@ test('can remove content picker in the content', async ({umbracoApi, umbracoUi}) await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithCustomDataType.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithCustomDataType.spec.ts index 4d377775ef..896f3eff04 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithCustomDataType.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithCustomDataType.spec.ts @@ -11,7 +11,7 @@ test.beforeEach(async ({umbracoApi}) => { }); test.afterEach(async ({umbracoApi}) => { - await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.documentType.ensureNameNotExists(documentTypeName); await umbracoApi.dataType.ensureNameNotExists(customDataTypeName); }); @@ -32,8 +32,7 @@ test('can create content with the custom data type with email address property e await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); @@ -55,8 +54,7 @@ test('can add text to the email address in the content section', async ({umbraco await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); @@ -79,8 +77,7 @@ test('can create content with the custom data type with decimal property editor' await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); @@ -103,8 +100,7 @@ test('can add decimal number to the decimal in the content section', async ({umb await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); @@ -128,8 +124,7 @@ test.skip('can create content with the custom data type with code editor propert await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); @@ -151,8 +146,7 @@ test('can add javascript code to the code editor in the content section', async await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); @@ -175,8 +169,7 @@ test('can create content with the custom data type with markdown editor property await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); @@ -198,8 +191,7 @@ test('can add code to the markdown editor in the content section', async ({umbra await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); @@ -222,8 +214,7 @@ test('can create content with the custom data type with multiple text string pro await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); @@ -245,8 +236,7 @@ test('can add string to the multiple text string in the content section', async await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); @@ -270,8 +260,7 @@ test('can create content with the custom data type with slider property editor', await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); @@ -297,8 +286,7 @@ test('can change slider value in the content section', async ({umbracoApi, umbra await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); @@ -326,6 +314,5 @@ test('can save content after changing the property editor of the custom data typ await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); -}); \ No newline at end of file + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowVaryByCulture.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowVaryByCulture.spec.ts index 48fd420b46..1a5b30383d 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowVaryByCulture.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowVaryByCulture.spec.ts @@ -33,8 +33,7 @@ test('can create content with allow vary by culture enabled', async ({umbracoApi await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); }); @@ -55,7 +54,7 @@ test('can create content with names that vary by culture', async ({umbracoApi, u await umbracoUi.content.clickSaveButton(); // Assert - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(danishContentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(danishContentName); expect(contentData.variants.length).toBe(2); @@ -83,7 +82,7 @@ test('can create content with names that vary by culture and content that is inv await umbracoUi.content.clickSaveButton(); // Assert - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(danishContentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(danishContentName); expect(contentData.variants.length).toBe(2); @@ -115,8 +114,7 @@ test('can create content with names and content that vary by culture', async ({u await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(danishContentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(danishContentName); expect(contentData.variants.length).toBe(2); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedChildNodes.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedChildNodes.spec.ts index 6e43246c17..86124bbebd 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedChildNodes.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedChildNodes.spec.ts @@ -31,8 +31,7 @@ test('can create content with allowed child node enabled', async ({umbracoApi, u await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); // Clean @@ -76,8 +75,7 @@ test('can create multiple child nodes with different document types', async ({um await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(secondChildContentName)).toBeTruthy(); const childData = await umbracoApi.document.getChildren(contentId); expect(childData.length).toBe(2); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedTemplates.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedTemplates.spec.ts index df544f016f..2f720322f5 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedTemplates.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedTemplates.spec.ts @@ -14,7 +14,7 @@ test.beforeEach(async ({umbracoApi}) => { }); test.afterEach(async ({umbracoApi}) => { - await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.documentType.ensureNameNotExists(documentTypeName); await umbracoApi.template.ensureNameNotExists(templateName); }); @@ -31,10 +31,9 @@ test('can create content with an allowed template', async ({umbracoApi, umbracoU await umbracoUi.content.chooseDocumentType(documentTypeName); await umbracoUi.content.enterContentName(contentName); await umbracoUi.content.clickSaveButton(); - + // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.template.id).toBe(templateId); @@ -55,14 +54,13 @@ test('can create content with multiple allowed templates', async ({umbracoApi, u await umbracoUi.content.chooseDocumentType(documentTypeName); await umbracoUi.content.enterContentName(contentName); await umbracoUi.content.clickSaveButton(); - + // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.template.id).toBe(defaultTemplateId); // Clean await umbracoApi.template.ensureNameNotExists(defaultTemplateName); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithCollections.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithCollections.spec.ts index 425a2e6451..45464022b3 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithCollections.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithCollections.spec.ts @@ -34,8 +34,7 @@ test('can create content configured as a collection', async ({umbracoApi, umbrac await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); await umbracoUi.content.isTabNameVisible('Collection'); await umbracoUi.content.doesContentListHaveNoItemsInList(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); @@ -58,6 +57,7 @@ test('can create child content in a collection', async ({umbracoApi, umbracoUi}) await umbracoUi.content.clickSaveButton(); // Assert + await umbracoUi.content.waitForContentToBeCreated(); const childData = await umbracoApi.document.getChildren(contentId); expect(childData.length).toBe(expectedNames.length); expect(childData[0].variants[0].name).toBe(firstChildContentName); @@ -90,6 +90,7 @@ test('can create multiple child nodes in a collection', async ({umbracoApi, umbr await umbracoUi.content.clickSaveButton(); // Assert + await umbracoUi.content.waitForContentToBeCreated(); const childData = await umbracoApi.document.getChildren(contentId); expect(childData.length).toBe(expectedNames.length); expect(childData[0].variants[0].name).toBe(firstChildContentName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDropdown.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDropdown.spec.ts index db1f1b4d88..4e65901bf4 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDropdown.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDropdown.spec.ts @@ -54,8 +54,7 @@ for (const dataTypeName of dataTypeNames) { await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); expect(contentData.values).toEqual([]); @@ -77,7 +76,7 @@ for (const dataTypeName of dataTypeNames) { await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); expect(contentData.values[0].value).toEqual(selectedOptions); @@ -105,7 +104,7 @@ test('can not publish a mandatory dropdown with an empty value', async ({umbraco await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); expect(contentData.values[0].value).toEqual([optionValues[0]]); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithImageCropper.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithImageCropper.spec.ts index 26e0099cd5..3a869b08a3 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithImageCropper.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithImageCropper.spec.ts @@ -38,8 +38,7 @@ test('can create content with the image cropper data type', {tag: '@smoke'}, asy await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -63,8 +62,7 @@ test('can publish content with the image cropper data type', {tag: '@smoke'}, as await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -91,8 +89,7 @@ test('can create content with the custom image cropper data type', {tag: '@smoke await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithImageMediaPicker.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithImageMediaPicker.spec.ts index a45b146cc6..e55fb00f3e 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithImageMediaPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithImageMediaPicker.spec.ts @@ -34,8 +34,7 @@ test('can save content with a image media picker', async ({umbracoApi, umbracoUi await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -55,8 +54,7 @@ test('can publish content with a image media picker', async ({umbracoApi, umbrac await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -79,8 +77,7 @@ test('can add an image to the image media picker', async ({umbracoApi, umbracoUi await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesImageMediaPickerContainImage(contentName, AliasHelper.toAlias(dataTypeName), imageId)).toBeTruthy(); // Clean @@ -104,8 +101,7 @@ test('can remove an image from the image media picker', async ({umbracoApi, umbr await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesImageMediaPickerContainImage(contentName, AliasHelper.toAlias(dataTypeName), imageId)).toBeFalsy(); // Clean @@ -127,6 +123,7 @@ test.skip('image count can not be less than min amount set in image media picker await umbracoUi.content.clickSaveButton(); // Assert + await umbracoUi.content.isSuccessStateVisibleForSaveButton(false); await umbracoUi.content.isErrorNotificationVisible(); // Clean @@ -150,6 +147,7 @@ test.skip('image count can not be more than max amount set in image media picker await umbracoUi.content.clickSaveButton(); // Assert + await umbracoUi.content.isSuccessStateVisibleForSaveButton(false); await umbracoUi.content.isErrorNotificationVisible(); // Clean @@ -176,8 +174,7 @@ test('can add an image from the image media picker with a start node', async ({u await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesImageMediaPickerContainImage(contentName, AliasHelper.toAlias(customDataTypeName), imageId)).toBeTruthy(); // Clean @@ -207,8 +204,7 @@ test('can add an image from the image media picker with focal point enabled', as await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesImageMediaPickerContainImageWithFocalPoint(contentName, AliasHelper.toAlias(customDataTypeName), imageId, {left: 0.4, top: 0.2})).toBeTruthy(); // Clean @@ -235,8 +231,7 @@ test('can reset focal point in a image from the image media picker', async ({umb await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesImageMediaPickerContainImageWithFocalPoint(contentName, AliasHelper.toAlias(customDataTypeName), imageId, {left: 0, top: 0})).toBeTruthy(); // Clean diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithListViewContent.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithListViewContent.spec.ts index 0a0b09e163..8d0af1b43b 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithListViewContent.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithListViewContent.spec.ts @@ -1,4 +1,4 @@ -import {ConstantHelper, test} from '@umbraco/playwright-testhelpers'; +import {ConstantHelper, NotificationConstantHelper, test} from '@umbraco/playwright-testhelpers'; import {expect} from "@playwright/test"; const contentName = 'TestContent'; @@ -40,8 +40,7 @@ test.skip('can create content with the list view data type', async ({umbracoApi, await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -64,8 +63,7 @@ test.skip('can publish content with the list view data type', async ({umbracoApi await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -89,7 +87,7 @@ test.skip('can create content with a child in the list', async ({umbracoApi, umb await umbracoUi.content.clickSaveModalButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); expect(await umbracoApi.document.getChildrenAmount(documentId)).toEqual(1); }); @@ -111,6 +109,7 @@ test.skip('can publish content with a child in the list', async ({umbracoApi, um // Currently necessary await umbracoUi.waitForTimeout(500); await umbracoUi.content.clickSaveAndPublishButton(); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); await umbracoUi.content.goToContentInListViewWithName(childContentName); await umbracoUi.content.clickContainerSaveAndPublishButton(); @@ -220,8 +219,7 @@ test.skip('can publish child content from list', async ({umbracoApi, umbracoUi}) await umbracoUi.content.clickPublishSelectedListItems(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.getChildrenAmount(documentId)).toEqual(1); const childContentData = await umbracoApi.document.getByName(childContentName); expect(childContentData.variants[0].state).toBe(expectedState); @@ -273,8 +271,7 @@ test.skip('can unpublish child content from list', async ({umbracoApi, umbracoUi await umbracoUi.content.clickConfirmToUnpublishButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.unpublished); const childContentData = await umbracoApi.document.getByName(childContentName); expect(childContentData.variants[0].state).toBe(expectedState); }); @@ -300,7 +297,7 @@ test.skip('can duplicate child content in list', async ({umbracoApi, umbracoUi}) await umbracoUi.content.selectDocumentWithNameAtRoot(secondDocumentName); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); + await umbracoUi.content.isSuccessNotificationVisible(); await umbracoUi.content.isErrorNotificationVisible(false); await umbracoUi.content.doesFirstItemInListViewHaveName(childContentName); await umbracoUi.content.goToContentWithName(secondDocumentName); @@ -332,7 +329,7 @@ test.skip('can move child content in list', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.selectDocumentWithNameAtRoot(secondDocumentName); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); + await umbracoUi.content.isSuccessNotificationVisible(); await umbracoUi.content.isErrorNotificationVisible(false); await umbracoUi.content.doesListViewContainCount(0); await umbracoUi.content.goToContentWithName(secondDocumentName); @@ -361,7 +358,6 @@ test.skip('can trash child content in list', async ({umbracoApi, umbracoUi}) => await umbracoUi.content.clickConfirmTrashButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); await umbracoUi.content.isErrorNotificationVisible(false); await umbracoUi.content.doesListViewContainCount(0); expect(await umbracoApi.document.getChildrenAmount(documentId)).toEqual(0); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMediaPicker.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMediaPicker.spec.ts index 9b71b6650e..0e0b9e9510 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMediaPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMediaPicker.spec.ts @@ -39,8 +39,7 @@ test('can create content with the media picker data type', {tag: '@smoke'}, asyn await umbracoUi.content.clickSaveButton(); // Assert - // await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -69,9 +68,7 @@ test('can publish content with the media picker data type', async ({umbracoApi, await umbracoUi.content.clickSaveAndPublishButton(); // Assert - // await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -96,8 +93,7 @@ test('can remove a media picker in the content', async ({umbracoApi, umbracoUi}) await umbracoUi.content.clickSaveButton(); // Assert - // await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); @@ -154,7 +150,7 @@ test.fixme('can not publish a mandatory media picker with an empty value', async await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); expect(contentData.values[0].value[0].mediaKey).toEqual(mediaFileId); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMemberPicker.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMemberPicker.spec.ts index 38bd38fde4..7c23fb6672 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMemberPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMemberPicker.spec.ts @@ -44,8 +44,7 @@ test('can create content with the member picker data type', {tag: '@smoke'}, asy await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -69,8 +68,7 @@ test('can publish content with the member picker data type', async ({umbracoApi, await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -91,8 +89,7 @@ test('can remove a member picker in the content', async ({umbracoApi, umbracoUi} await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultiURLPicker.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultiURLPicker.spec.ts index c5d9d76685..7f18baf83c 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultiURLPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultiURLPicker.spec.ts @@ -45,8 +45,7 @@ test.fixme('can create content with the document link', {tag: '@smoke'}, async ( await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -88,8 +87,7 @@ test('can publish content with the document link', async ({umbracoApi, umbracoUi await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -124,8 +122,7 @@ test('can create content with the external link', async ({umbracoApi, umbracoUi} await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -158,8 +155,7 @@ test('can create content with the media link', async ({umbracoApi, umbracoUi}) = await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -202,8 +198,7 @@ test('can add multiple links in the content', async ({umbracoApi, umbracoUi}) => await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -237,8 +232,7 @@ test('can remove the URL picker in the content', async ({umbracoApi, umbracoUi}) await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); @@ -261,8 +255,7 @@ test('can edit the URL picker in the content', async ({umbracoApi, umbracoUi}) = await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -314,9 +307,7 @@ test('cannot update the URL picker with an empty link', async ({umbracoApi, umbr await umbracoUi.content.isTextWithMessageVisible(ConstantHelper.validationMessages.emptyLinkPicker); }); -// TODO: Remove skip when the front-end ready. Currently it still accept the empty link with an anchor or querystring -// Issue link: https://github.com/umbraco/Umbraco-CMS/issues/17411 -test.skip('cannot submit an empty URL with an anchor or query', async ({umbracoApi, umbracoUi}) => { +test('cannot submit an empty URL with an anchor or query', async ({umbracoApi, umbracoUi}) => { // Arrange const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName); const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, dataTypeName, dataTypeData.id); @@ -387,8 +378,7 @@ test.skip('can create content with the link to an unpublished document', async ( await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultipleImageMediaPicker.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultipleImageMediaPicker.spec.ts index 8a225b6e8d..9150cec753 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultipleImageMediaPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultipleImageMediaPicker.spec.ts @@ -42,8 +42,7 @@ test('can create content with multiple image media picker data type', async ({um await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -63,8 +62,7 @@ test('can publish content with multiple image media picker data type', async ({u await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -87,8 +85,7 @@ test('can add multiple images to the multiple image media picker', async ({umbra await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -112,8 +109,7 @@ test('can remove a media picker in the content', async ({umbracoApi, umbracoUi}) await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultipleMediaPicker.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultipleMediaPicker.spec.ts index 41041ff70c..5e1033818f 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultipleMediaPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultipleMediaPicker.spec.ts @@ -43,8 +43,7 @@ test('can create content with multiple media picker data type', async ({umbracoA await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -64,8 +63,7 @@ test('can publish content with multiple media picker data type', async ({umbraco await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -88,8 +86,7 @@ test('can add multiple media files to the multiple media picker', async ({umbrac await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -113,8 +110,7 @@ test('can remove a media picker in the content', async ({umbracoApi, umbracoUi}) await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -122,5 +118,3 @@ test('can remove a media picker in the content', async ({umbracoApi, umbracoUi}) expect(contentData.values[0].value[0].mediaKey).toEqual(secondMediaFileId); expect(contentData.values[0].value[0].mediaTypeAlias).toEqual(secondMediaTypeName); }); - - diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithNumeric.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithNumeric.spec.ts index a22a03affd..ceca61af35 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithNumeric.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithNumeric.spec.ts @@ -13,7 +13,7 @@ test.beforeEach(async ({umbracoApi, umbracoUi}) => { }); test.afterEach(async ({umbracoApi}) => { - await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.documentType.ensureNameNotExists(documentTypeName); }); @@ -33,8 +33,7 @@ test('can create content with the numeric data type', async ({umbracoApi, umbrac await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -56,8 +55,7 @@ test('can publish content with the numeric data type', async ({umbracoApi, umbra await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithPropertyEditors.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithPropertyEditors.spec.ts index e91e525c6f..46181dd242 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithPropertyEditors.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithPropertyEditors.spec.ts @@ -6,12 +6,12 @@ const documentTypeName = 'TestDocumentTypeForContent'; test.beforeEach(async ({umbracoApi}) => { await umbracoApi.documentType.ensureNameNotExists(documentTypeName); - await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(contentName); }); test.afterEach(async ({umbracoApi}) => { - await umbracoApi.document.ensureNameNotExists(contentName); - await umbracoApi.documentType.ensureNameNotExists(documentTypeName); + await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.documentType.ensureNameNotExists(documentTypeName); }); // TODO: Skip this test as TinyMCE is replaced by Tiptap. This test should be updated. @@ -33,8 +33,7 @@ test.skip('can create content with the Rich Text Editor datatype', {tag: '@smoke await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.markup).toEqual('

' + contentText + '

'); @@ -59,8 +58,7 @@ test.skip('can create content with the upload file datatype', async ({umbracoApi await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.src).toContainEqual(uploadFilePath); @@ -76,7 +74,7 @@ test.skip('can create content with the list view - content datatype', async ({um const contentPickerId = await umbracoApi.document.createDefaultDocument(contentListViewName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); - + // Act await umbracoUi.content.clickActionsMenuAtRoot(); await umbracoUi.content.clickCreateActionMenuOption(); @@ -86,8 +84,7 @@ test.skip('can create content with the list view - content datatype', async ({um await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); // Clean diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithRadiobox.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithRadiobox.spec.ts index 94a2545c30..903449164e 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithRadiobox.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithRadiobox.spec.ts @@ -35,8 +35,7 @@ test('can create content with the radiobox data type', async ({umbracoApi, umbra await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -57,9 +56,7 @@ test('can publish content with the radiobox data type', async ({umbracoApi, umbr await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -80,8 +77,7 @@ test('can create content with the custom radiobox data type', async ({umbracoApi await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); @@ -108,7 +104,7 @@ test('can not publish mandatory radiobox with an empty value', async ({umbracoAp await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); expect(contentData.values[0].value).toEqual(optionValues[0]); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTags.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTags.spec.ts index ff316715ed..089dc0d454 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTags.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTags.spec.ts @@ -13,13 +13,13 @@ test.beforeEach(async ({umbracoApi, umbracoUi}) => { }); test.afterEach(async ({umbracoApi}) => { - await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.documentType.ensureNameNotExists(documentTypeName); }); test('can create content with one tag', async ({umbracoApi, umbracoUi}) => { // Arrange - const expectedState = 'Draft'; + const expectedState = 'Draft'; const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName); await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, dataTypeName, dataTypeData.id); await umbracoUi.content.goToSection(ConstantHelper.sections.content); @@ -34,8 +34,7 @@ test('can create content with one tag', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -58,8 +57,7 @@ test('can publish content with multiple tags', async ({umbracoApi, umbracoUi}) = await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -79,9 +77,9 @@ test('can remove a tag in the content', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); await umbracoUi.content.isErrorNotificationVisible(false); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTextarea.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTextarea.spec.ts index c9112c583e..f7c0a79c79 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTextarea.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTextarea.spec.ts @@ -33,8 +33,7 @@ test('can create content with the textarea data type', async ({umbracoApi, umbra await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -54,8 +53,7 @@ test('can publish content with the textarea data type', async ({umbracoApi, umbr await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -75,8 +73,7 @@ test('can input text into the textarea', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -96,12 +93,12 @@ test('cannot input the text that exceeds the allowed amount of characters', asyn // Act await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.enterTextArea(textExceedMaxChars); - await umbracoUi.content.clickSaveButton(); + await umbracoUi.content.clickSaveAndPublishButton(); // Assert + await umbracoUi.content.isFailedStateButtonVisible(); + await umbracoUi.content.isErrorNotificationVisible(); await umbracoUi.content.isTextWithMessageVisible(warningMessage); - // await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); // Clean await umbracoApi.dataType.ensureNameNotExists(customDataTypeName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTextstring.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTextstring.spec.ts index 64fdf72ee6..cdff514b28 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTextstring.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTextstring.spec.ts @@ -33,8 +33,7 @@ test('can create content with the textstring data type', async ({umbracoApi, umb await umbracoUi.content.clickSaveButton(); // Assert - // await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -54,8 +53,7 @@ test('can publish content with the textstring data type', async ({umbracoApi, um await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -75,8 +73,7 @@ test('can input text into the textstring', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -89,7 +86,6 @@ test('cannot input the text that exceeds the allowed amount of characters', asyn const textExceedMaxChars = 'Lorem ipsum dolor sit'; const warningMessage = 'The string length exceeds the maximum length of'; const dataTypeId = await umbracoApi.dataType.createTextstringDataType(customDataTypeName, maxChars); - console.log(dataTypeId); const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, customDataTypeName, dataTypeId); await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.content.goToSection(ConstantHelper.sections.content); @@ -97,12 +93,12 @@ test('cannot input the text that exceeds the allowed amount of characters', asyn // Act await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.enterTextstring(textExceedMaxChars); - await umbracoUi.content.clickSaveButton(); + await umbracoUi.content.clickSaveAndPublishButton(); // Assert + await umbracoUi.content.isFailedStateButtonVisible(); + await umbracoUi.content.isErrorNotificationVisible(); await umbracoUi.content.isTextWithMessageVisible(warningMessage); - // await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); // Clean await umbracoApi.dataType.ensureNameNotExists(customDataTypeName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTrueFalse.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTrueFalse.spec.ts index 1789af90fc..4910b1bd69 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTrueFalse.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithTrueFalse.spec.ts @@ -1,4 +1,4 @@ -import {ConstantHelper, test, AliasHelper} from '@umbraco/playwright-testhelpers'; +import {ConstantHelper, test, AliasHelper} from '@umbraco/playwright-testhelpers'; import {expect} from "@playwright/test"; const contentName = 'TestContent'; @@ -12,13 +12,13 @@ test.beforeEach(async ({umbracoApi}) => { }); test.afterEach(async ({umbracoApi}) => { - await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.documentType.ensureNameNotExists(documentTypeName); }); test('can create content with the true/false data type', async ({umbracoApi, umbracoUi}) => { // Arrange - const expectedState = 'Draft'; + const expectedState = 'Draft'; const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName); await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, dataTypeName, dataTypeData.id); await umbracoUi.goToBackOffice(); @@ -32,8 +32,7 @@ test('can create content with the true/false data type', async ({umbracoApi, umb await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -55,8 +54,7 @@ test('can publish content with the true/false data type', async ({umbracoApi, um await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -77,8 +75,7 @@ test('can toggle the true/false value in the content ', async ({umbracoApi, umbr await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual('truefalse'); @@ -101,8 +98,7 @@ test('can toggle the true/false value with the initial state enabled', async ({u await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(customDataTypeName)); @@ -149,4 +145,4 @@ test('can show the label off for the true/false in the content ', async ({umbrac // Clean await umbracoApi.dataType.ensureNameNotExists(customDataTypeName); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadArticle.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadArticle.spec.ts index 2d255fdc03..45ccef76cd 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadArticle.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadArticle.spec.ts @@ -1,4 +1,4 @@ -import {ConstantHelper, test, AliasHelper} from '@umbraco/playwright-testhelpers'; +import {ConstantHelper, test, AliasHelper} from '@umbraco/playwright-testhelpers'; import {expect} from "@playwright/test"; const contentName = 'TestContent'; @@ -12,13 +12,13 @@ test.beforeEach(async ({umbracoApi}) => { }); test.afterEach(async ({umbracoApi}) => { - await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.documentType.ensureNameNotExists(documentTypeName); }); test('can create content with the upload article data type', async ({umbracoApi, umbracoUi}) => { // Arrange - const expectedState = 'Draft'; + const expectedState = 'Draft'; const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName); await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, dataTypeName, dataTypeData.id); await umbracoUi.goToBackOffice(); @@ -32,8 +32,7 @@ test('can create content with the upload article data type', async ({umbracoApi, await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -54,8 +53,7 @@ test('can publish content with the upload article data type', async ({umbracoApi await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -82,8 +80,7 @@ for (const uploadFile of uploadFiles) { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -108,9 +105,8 @@ test.skip('can remove an article file in the content', async ({umbracoApi, umbra await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadAudio.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadAudio.spec.ts index f3e7064557..22774235e1 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadAudio.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadAudio.spec.ts @@ -1,4 +1,4 @@ -import {ConstantHelper, test, AliasHelper} from '@umbraco/playwright-testhelpers'; +import {ConstantHelper, test, AliasHelper} from '@umbraco/playwright-testhelpers'; import {expect} from "@playwright/test"; const contentName = 'TestContent'; @@ -12,13 +12,13 @@ test.beforeEach(async ({umbracoApi}) => { }); test.afterEach(async ({umbracoApi}) => { - await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.documentType.ensureNameNotExists(documentTypeName); }); test('can create content with the upload audio data type', async ({umbracoApi, umbracoUi}) => { // Arrange - const expectedState = 'Draft'; + const expectedState = 'Draft'; const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName); await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, dataTypeName, dataTypeData.id); await umbracoUi.goToBackOffice(); @@ -32,8 +32,7 @@ test('can create content with the upload audio data type', async ({umbracoApi, u await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -54,8 +53,7 @@ test('can publish content with the upload audio data type', async ({umbracoApi, await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -83,8 +81,7 @@ for (const uploadFile of uploadFiles) { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -109,9 +106,8 @@ test.skip('can remove an audio file in the content', async ({umbracoApi, umbraco await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadFile.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadFile.spec.ts index a6f45b6ad4..fc619145e2 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadFile.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadFile.spec.ts @@ -1,4 +1,4 @@ -import {ConstantHelper, test, AliasHelper} from '@umbraco/playwright-testhelpers'; +import {ConstantHelper, test, AliasHelper} from '@umbraco/playwright-testhelpers'; import {expect} from "@playwright/test"; const contentName = 'TestContent'; @@ -12,13 +12,13 @@ test.beforeEach(async ({umbracoApi}) => { }); test.afterEach(async ({umbracoApi}) => { - await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.documentType.ensureNameNotExists(documentTypeName); }); test('can create content with the upload file data type', async ({umbracoApi, umbracoUi}) => { // Arrange - const expectedState = 'Draft'; + const expectedState = 'Draft'; const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName); await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, dataTypeName, dataTypeData.id); await umbracoUi.goToBackOffice(); @@ -32,8 +32,7 @@ test('can create content with the upload file data type', async ({umbracoApi, um await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -54,8 +53,7 @@ test('can publish content with the upload file data type', async ({umbracoApi, u await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -81,8 +79,7 @@ for (const uploadFile of uploadFiles) { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -107,9 +104,8 @@ test.skip('can remove a text file in the content', async ({umbracoApi, umbracoUi await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadVectorGraphics.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadVectorGraphics.spec.ts index da8557d514..846317527a 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadVectorGraphics.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadVectorGraphics.spec.ts @@ -32,8 +32,7 @@ test('can create content with the upload vector graphics data type', async ({umb await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -54,8 +53,7 @@ test('can publish content with the upload vector graphics data type', async ({um await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -77,8 +75,7 @@ test(`can upload a file with the svg extension in the content`, async ({umbracoA await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -102,8 +99,7 @@ test('can remove an svg file in the content', async ({umbracoApi, umbracoUi}) => await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadVideo.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadVideo.spec.ts index da8ea468e7..5caafc4356 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadVideo.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithUploadVideo.spec.ts @@ -32,8 +32,7 @@ test('can create content with the upload video data type', async ({umbracoApi, u await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -54,8 +53,7 @@ test('can publish content with the upload video data type', async ({umbracoApi, await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -82,8 +80,7 @@ for (const uploadVideo of uploadVideos) { await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName)); @@ -108,8 +105,7 @@ test.skip('can remove a mp4 file in the content', async ({umbracoApi, umbracoUi} await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values).toEqual([]); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/CultureAndHostnames.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/CultureAndHostnames.spec.ts index 28370e69ea..80b302f3e2 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/CultureAndHostnames.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/CultureAndHostnames.spec.ts @@ -40,8 +40,7 @@ test('can add a culture', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveModalButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); const domainsData = await umbracoApi.document.getDomains(contentId); expect(domainsData.defaultIsoCode).toEqual(isoCode); }); @@ -61,8 +60,7 @@ test('can add a domain', async ({umbracoApi, umbracoUi}) => { await umbracoUi.waitForTimeout(500); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForDomainToBeCreated(); const domainsData = await umbracoApi.document.getDomains(contentId); expect(domainsData.domains.length).toBe(1); expect(domainsData.domains[0].domainName).toEqual(domainName); @@ -83,8 +81,7 @@ test('can update culture and hostname', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveModalButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForDomainToBeUpdated(); domainsData = await umbracoApi.document.getDomains(contentId); expect(domainsData.domains[0].domainName).toEqual(updatedDomainName); expect(domainsData.domains[0].isoCode).toEqual(isoCode); @@ -103,8 +100,7 @@ test('can delete culture and hostname', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveModalButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForDomainToBeDeleted(); domainsData = await umbracoApi.document.getDomains(contentId); expect(domainsData.domains.length).toBe(0); }); @@ -129,12 +125,14 @@ test('can add culture and hostname for multiple languages', async ({umbracoApi, await umbracoUi.content.clickSaveModalButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForDomainToBeCreated(); const domainsData = await umbracoApi.document.getDomains(contentId); expect(domainsData.domains.length).toBe(2); expect(domainsData.domains[0].domainName).toEqual(domainName); expect(domainsData.domains[0].isoCode).toEqual(isoCode); expect(domainsData.domains[1].domainName).toEqual(secondDomainName); expect(domainsData.domains[1].isoCode).toEqual(secondIsoCode); + + // Clean + await umbracoApi.language.ensureNameNotExists(secondLanguageName); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/PublishWithDescendants.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/PublishWithDescendants.spec.ts index da73d10269..a8a00802ff 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/PublishWithDescendants.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/PublishWithDescendants.spec.ts @@ -200,4 +200,4 @@ test('can cancel to publish variant content with descendants', async ({umbracoAp expect(contentData.values[0].value).toBe(contentText); const childContentData = await umbracoApi.document.getByName(childContentName); expect(childContentData.variants[0].state).toBe('Draft'); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/ContentWithTiptap.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/ContentWithTiptap.spec.ts index 3d3b09d7ef..5feb94ba38 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/ContentWithTiptap.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/ContentWithTiptap.spec.ts @@ -33,8 +33,7 @@ test('can create content with empty RTE Tiptap property editor', async ({umbraco await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -58,8 +57,7 @@ test('can create content with non-empty RTE Tiptap property editor', async ({umb await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); @@ -81,15 +79,14 @@ test('can publish content with RTE Tiptap property editor', async ({umbracoApi, await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationsHaveCount(2); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe(expectedState); expect(contentData.values[0].value.markup).toEqual('

' + inputText + '

'); }); -test.fixme('can add a media in RTE Tiptap property editor', async ({umbracoApi, umbracoUi}) => { +test('can add a media in RTE Tiptap property editor', async ({umbracoApi, umbracoUi}) => { // Arrange const iconTitle = 'Media Picker'; const imageName = 'Test Image For Content'; @@ -110,8 +107,7 @@ test.fixme('can add a media in RTE Tiptap property editor', async ({umbracoApi, await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.markup).toContain(' { +test('cannot submit an empty URL with an anchor or querystring in RTE Tiptap property editor', async ({umbracoApi, umbracoUi}) => { // Arrange const iconTitle = 'Link'; const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, customDataTypeName, customDataTypeId); @@ -191,9 +184,7 @@ test.skip('cannot submit an empty URL with an anchor or querystring in RTE Tipta await umbracoUi.content.isTextWithMessageVisible(ConstantHelper.validationMessages.emptyLinkPicker); }); -// TODO: Remove skip when the front-end ready. Currently it is impossible to link to unpublished document -// Issue link: https://github.com/umbraco/Umbraco-CMS/issues/17974 -test.skip('can insert a link to an unpublished document in RTE Tiptap property editor', async ({umbracoApi, umbracoUi}) => { +test('can insert a link to an unpublished document in RTE Tiptap property editor', async ({umbracoApi, umbracoUi}) => { // Arrange const iconTitle = 'Link'; const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, customDataTypeName, customDataTypeId); @@ -216,8 +207,7 @@ test.skip('can insert a link to an unpublished document in RTE Tiptap property e await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.isSuccessNotificationVisible(); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); // Clean await umbracoApi.documentType.ensureNameNotExists(documentTypeForLinkedDocumentName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/SecondLevelBlockProperties.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/SecondLevelBlockProperties.spec.ts index 63179d576a..281fca102a 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/SecondLevelBlockProperties.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/SecondLevelBlockProperties.spec.ts @@ -41,7 +41,7 @@ test('can publish a rich text editor with a rich text editor', async ({umbracoAp const richTextElementTypeName = 'RichTextElementName'; const richTextElementGroupName = 'RichTextElementGroupName'; await umbracoApi.dataType.ensureNameNotExists(secondRichTextDataTypeName); - await umbracoApi.documentType.ensureNameNotExists(richTextElementGroupName); + await umbracoApi.documentType.ensureNameNotExists(richTextElementTypeName); const secondRichTextEditorDataTypeId = await umbracoApi.dataType.createDefaultTiptapDataType(secondRichTextDataTypeName); const richTextElementTypeId = await umbracoApi.documentType.createDefaultElementType(richTextElementTypeName, richTextElementGroupName, secondRichTextDataTypeName, secondRichTextEditorDataTypeId); @@ -61,8 +61,7 @@ test('can publish a rich text editor with a rich text editor', async ({umbracoAp await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); // Asserts that the value in the RTE is as expected const documentData = await umbracoApi.document.getByName(contentName); const documentValues = documentData.values.find(value => value.alias === AliasHelper.toAlias(richTextDataTypeName)); @@ -73,7 +72,8 @@ test('can publish a rich text editor with a rich text editor', async ({umbracoAp expect(secondRTEInBlock.value.markup).toContain(secondExpectedRichTextEditorOutputValue); // Clean - await umbracoApi.documentType.ensureNameNotExists(richTextElementGroupName); + await umbracoApi.dataType.ensureNameNotExists(secondRichTextDataTypeName); + await umbracoApi.documentType.ensureNameNotExists(richTextElementTypeName); }); test('can publish a rich text editor with a block grid editor', async ({umbracoApi, umbracoUi}) => { @@ -108,8 +108,7 @@ test('can publish a rich text editor with a block grid editor', async ({umbracoA await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); // Asserts that the value in the BlockGrid is as expected const documentData = await umbracoApi.document.getByName(contentName); expect(documentData.values[0].value.blocks.contentData[0].values[0].value.contentData[0].values[0].value).toContain(textStringValue); @@ -152,8 +151,7 @@ test('can publish a rich text editor with a block list editor', async ({umbracoA await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); // Asserts that the value in the BlockGrid is as expected const documentData = await umbracoApi.document.getByName(contentName); expect(documentData.values[0].value.blocks.contentData[0].values[0].value.contentData[0].values[0].value).toContain(textStringValue); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/TiptapStyleSelect.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/TiptapStyleSelect.spec.ts index faab11fe5f..19eee3b8cc 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/TiptapStyleSelect.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/TiptapStyleSelect.spec.ts @@ -33,7 +33,7 @@ test('can apply page header format', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.markup).toEqual('

' + inputText + '

'); }); @@ -48,7 +48,7 @@ test('can apply section header format', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.markup).toEqual('

' + inputText + '

'); }); @@ -63,7 +63,7 @@ test('can apply paragraph header format', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.markup).toEqual('

' + inputText + '

'); }); @@ -78,7 +78,7 @@ test('can apply paragraph blocks format', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.markup).toEqual('

' + inputText + '

'); }); @@ -93,7 +93,7 @@ test('can apply block quote format', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.markup).toEqual('

' + inputText + '

'); }); @@ -108,7 +108,7 @@ test('can apply code block format', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickSaveButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.markup).toEqual('
' + inputText + '

'); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/TiptapToolbar.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/TiptapToolbar.spec.ts index 3f4cf6d572..dc4a77ffe9 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/TiptapToolbar.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/TiptapToolbar.spec.ts @@ -37,8 +37,7 @@ test('can add a media in RTE Tiptap property editor', async ({umbracoApi, umbrac await umbracoUi.content.clickSaveAndPublishButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.values[0].value.markup).toContain(' { +test('cannot submit an empty URL with an anchor or querystring in RTE Tiptap property editor', async ({umbracoApi, umbracoUi}) => { // Arrange const iconTitle = 'Link'; const customDataTypeId = await umbracoApi.dataType.createDefaultTiptapDataType(customDataTypeName); @@ -120,9 +117,7 @@ test.skip('cannot submit an empty URL with an anchor or querystring in RTE Tipta await umbracoUi.content.isTextWithMessageVisible(ConstantHelper.validationMessages.emptyLinkPicker); }); -// TODO: Remove skip when the front-end ready. Currently it is impossible to link to unpublished document -// Issue link: https://github.com/umbraco/Umbraco-CMS/issues/17974 -test.skip('can insert a link to an unpublished document in RTE Tiptap property editor', async ({umbracoApi, umbracoUi}) => { +test('can insert a link to an unpublished document in RTE Tiptap property editor', async ({umbracoApi, umbracoUi}) => { // Arrange const iconTitle = 'Link'; const customDataTypeId = await umbracoApi.dataType.createDefaultTiptapDataType(customDataTypeName); @@ -146,7 +141,7 @@ test.skip('can insert a link to an unpublished document in RTE Tiptap property e await umbracoUi.content.clickSaveButton(); // Assert - await umbracoUi.content.isSuccessNotificationVisible(); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); // Clean await umbracoApi.documentType.ensureNameNotExists(documentTypeForLinkedDocumentName); @@ -187,4 +182,4 @@ test('can view element path', async ({umbracoApi, umbracoUi}) => { // Assert await umbracoUi.content.doesElementPathHaveText(expectedElementPath); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/VariantTipTapBlocks.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/VariantTipTapBlocks.spec.ts index 40f2e64ad9..e52c3f502b 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/VariantTipTapBlocks.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/VariantTipTapBlocks.spec.ts @@ -1,4 +1,5 @@ import {ConstantHelper, NotificationConstantHelper, test} from "@umbraco/playwright-testhelpers"; +import {expect} from "@playwright/test"; // Document Type const documentTypeName = 'DocumentTypeName'; @@ -22,6 +23,7 @@ const textStringText = 'ThisIsATextString'; // Content Name const contentName = 'ContentName'; +let contentId = null; test.beforeEach(async ({umbracoApi}) => { await umbracoApi.language.ensureIsoCodeNotExists('da'); @@ -43,7 +45,7 @@ test('invariant document type with invariant tiptap RTE with invariant block wit elementTypeId = await umbracoApi.documentType.createDefaultElementType(blockName, elementGroupName, textStringName, textStringDataTypeId); tipTapId = await umbracoApi.dataType.createTipTapDataTypeWithABlock(tipTapName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, tipTapName, tipTapId, documentTypeGroupName); - await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); await umbracoUi.content.goToContentWithName(contentName); @@ -56,12 +58,9 @@ test('invariant document type with invariant tiptap RTE with invariant block wit await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - + await umbracoUi.content.isSuccessStateVisibleForSaveAndPublishButton(); + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); await umbracoUi.reloadPage(); - await umbracoUi.content.clickBlockElementWithName(blockName); await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText); }); @@ -71,7 +70,7 @@ test('can not create unsupported invariant document type with invariant tiptap R elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, false); tipTapId = await umbracoApi.dataType.createTipTapDataTypeWithABlock(tipTapName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, tipTapName, tipTapId, documentTypeGroupName); - await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); // Act @@ -80,9 +79,10 @@ test('can not create unsupported invariant document type with invariant tiptap R await umbracoUi.content.clickSaveAndPublishButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isFailedStateButtonVisible(); + await umbracoUi.content.isErrorNotificationVisible(); await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished); + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeFalsy(); }); test('can not create unsupported invariant document type with invariant tiptap RTE with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => { @@ -90,7 +90,7 @@ test('can not create unsupported invariant document type with invariant tiptap R elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, true); tipTapId = await umbracoApi.dataType.createTipTapDataTypeWithABlock(tipTapName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, tipTapName, tipTapId, documentTypeGroupName); - await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToContentWithName(contentName); @@ -100,8 +100,10 @@ test('can not create unsupported invariant document type with invariant tiptap R await umbracoUi.content.clickSaveAndPublishButton(); // Assert + await umbracoUi.content.isFailedStateButtonVisible(); await umbracoUi.content.isErrorNotificationVisible(); await umbracoUi.content.doesErrorNotificationHaveText(NotificationConstantHelper.error.documentCouldNotBePublished); + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeFalsy(); }); test('variant document type with variant tiptap RTE with variant block with an variant textString', async ({umbracoApi, umbracoUi}) => { @@ -109,7 +111,7 @@ test('variant document type with variant tiptap RTE with variant block with an v elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, true); tipTapId = await umbracoApi.dataType.createTipTapDataTypeWithABlock(tipTapName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, tipTapName, tipTapId, documentTypeGroupName, true); - await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); await umbracoUi.content.goToContentWithName(contentName); @@ -124,7 +126,7 @@ test('variant document type with variant tiptap RTE with variant block with an v // Assert await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); await umbracoUi.reloadPage(); await umbracoUi.content.clickBlockElementWithName(blockName); await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText); @@ -135,7 +137,7 @@ test('variant document type with invariant tiptap RTE with variant block with an elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, false); tipTapId = await umbracoApi.dataType.createTipTapDataTypeWithABlock(tipTapName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, tipTapName, tipTapId, documentTypeGroupName, true, false); - await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); await umbracoUi.content.goToContentWithName(contentName); @@ -150,7 +152,7 @@ test('variant document type with invariant tiptap RTE with variant block with an // Assert await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); await umbracoUi.reloadPage(); await umbracoUi.content.clickBlockElementWithName(blockName); await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText); @@ -161,7 +163,7 @@ test('variant document type with invariant tiptap RTE with variant block with an elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(blockName, elementGroupName, textStringName, textStringDataTypeId, true, true); tipTapId = await umbracoApi.dataType.createTipTapDataTypeWithABlock(tipTapName, elementTypeId); documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, tipTapName, tipTapId, documentTypeGroupName, true, false); - await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); + contentId = await umbracoApi.document.createDefaultDocumentWithEnglishCulture(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); await umbracoUi.content.goToContentWithName(contentName); @@ -176,7 +178,7 @@ test('variant document type with invariant tiptap RTE with variant block with an // Assert await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.published); - + expect(await umbracoApi.document.isDocumentPublished(contentId)).toBeTruthy(); await umbracoUi.reloadPage(); await umbracoUi.content.clickBlockElementWithName(blockName); await umbracoUi.content.doesPropertyContainValue(textStringName, textStringText); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/TrashContent/BulkTrashContent.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/TrashContent/BulkTrashContent.spec.ts index 957c330e65..1f41a78ad0 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/TrashContent/BulkTrashContent.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/TrashContent/BulkTrashContent.spec.ts @@ -45,7 +45,7 @@ test('can bulk trash content nodes without a relation', async ({umbracoApi, umbr await umbracoUi.content.clickConfirmTrashButton(); // // Assert - await umbracoUi.content.isSuccessNotificationVisible(); + await umbracoUi.content.waitForContentToBeTrashed(); expect(await umbracoApi.document.doesNameExist(firstChildContentName)).toBeFalsy(); expect(await umbracoApi.document.doesNameExist(secondChildContentName)).toBeFalsy(); await umbracoUi.content.isItemVisibleInRecycleBin(firstChildContentName); @@ -79,8 +79,8 @@ test('can bulk trash content nodes with a relation', async ({umbracoApi, umbraco await umbracoUi.content.isReferenceItemNameVisible(firstChildContentName); await umbracoUi.content.clickConfirmTrashButton(); - // // Assert - await umbracoUi.content.isSuccessNotificationVisible(); + // Assert + await umbracoUi.content.waitForContentToBeTrashed(); expect(await umbracoApi.document.doesNameExist(firstChildContentName)).toBeFalsy(); expect(await umbracoApi.document.doesNameExist(secondChildContentName)).toBeFalsy(); await umbracoUi.content.isItemVisibleInRecycleBin(firstChildContentName); @@ -90,4 +90,4 @@ test('can bulk trash content nodes with a relation', async ({umbracoApi, umbraco // Clean await umbracoApi.documentType.ensureNameNotExists(documentPickerName[1]); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ApprovedColor.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ApprovedColor.spec.ts index 2e7903ad8d..2c2ccd730d 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ApprovedColor.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ApprovedColor.spec.ts @@ -28,8 +28,7 @@ test('can include label', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'useLabel', true)).toBeTruthy(); }); @@ -43,8 +42,7 @@ test('can add color', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesApprovedColorHaveColor(customDataTypeName, colorValue)).toBeTruthy(); }); @@ -58,8 +56,7 @@ test('can remove color', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesApprovedColorHaveColor(customDataTypeName, colorValue)).toBeFalsy();; }); @@ -78,4 +75,4 @@ test('the default configuration is correct', async ({umbracoApi, umbracoUi}) => expect(dataTypeDefaultData.values).toEqual([]); expect(await umbracoApi.dataType.doesDataTypeHaveValue(dataTypeName, 'useLabel')).toBeFalsy(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(dataTypeName, 'items')).toBeFalsy(); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/Block/BlockGridBlockAdvanced.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/Block/BlockGridBlockAdvanced.spec.ts index 7f8d631370..a678fe9d99 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/Block/BlockGridBlockAdvanced.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/Block/BlockGridBlockAdvanced.spec.ts @@ -76,8 +76,7 @@ test('can update overlay size in a block', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainOverlaySize(blockGridEditorName, contentElementTypeId, overlaySize)).toBeTruthy(); }); @@ -96,8 +95,7 @@ test('can enable inline editing mode in a block', async ({umbracoApi, umbracoUi} await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainInlineEditing(blockGridEditorName, contentElementTypeId, true)).toBeTruthy(); }); @@ -117,8 +115,7 @@ test('can disable inline editing mode in a block', async ({umbracoApi, umbracoUi await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainInlineEditing(blockGridEditorName, contentElementTypeId, false)).toBeTruthy(); }); @@ -137,8 +134,7 @@ test('can enable hide content editor in a block', async ({umbracoApi, umbracoUi} await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainHideContentEditor(blockGridEditorName, contentElementTypeId, true)).toBeTruthy(); }); @@ -158,8 +154,7 @@ test('can disable hide content editor in a block', async ({umbracoApi, umbracoUi await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainHideContentEditor(blockGridEditorName, contentElementTypeId, false)).toBeTruthy(); }); @@ -179,8 +174,7 @@ test('can add a background color to a block', {tag: '@smoke'}, async ({umbracoAp await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainBackgroundColor(blockGridEditorName, contentElementTypeId, backGroundColor)).toBeTruthy(); }); @@ -201,8 +195,7 @@ test('can remove a background color to a block', async ({umbracoApi, umbracoUi}) await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainBackgroundColor(blockGridEditorName, contentElementTypeId, '')).toBeTruthy(); }); @@ -222,8 +215,7 @@ test('can add a icon color to a block', {tag: '@smoke'}, async ({umbracoApi, umb await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainIconColor(blockGridEditorName, contentElementTypeId, iconColor)).toBeTruthy(); }); @@ -244,11 +236,10 @@ test('can remove a icon color from a block', async ({umbracoApi, umbracoUi}) => await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainIconColor(blockGridEditorName, contentElementTypeId, '')).toBeTruthy(); }); - + // TODO: Remove skip when the code is updated due to UI changes test.skip('can add a thumbnail to a block', async ({umbracoApi, umbracoUi}) => { // Arrange @@ -269,8 +260,7 @@ test.skip('can add a thumbnail to a block', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); }); // TODO: Remove skip when the code is updated. Currently it is missing the assertion steps diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/Block/BlockGridBlockAreas.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/Block/BlockGridBlockAreas.spec.ts index 70b79b8eed..eafa3bd19d 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/Block/BlockGridBlockAreas.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/Block/BlockGridBlockAreas.spec.ts @@ -34,8 +34,7 @@ test('can update grid columns for areas for a block', async ({umbracoApi, umbrac await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaGridColumns(blockGridEditorName, contentElementTypeId, gridColumns)).toBeTruthy(); }); @@ -55,8 +54,7 @@ test('can add an area for a block', {tag: '@smoke'}, async ({umbracoApi, umbraco await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaWithAlias(blockGridEditorName, contentElementTypeId)).toBeTruthy(); }); @@ -93,8 +91,7 @@ test('can update alias an area for a block', async ({umbracoApi, umbracoUi}) => await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaWithAlias(blockGridEditorName, contentElementTypeId, newAlias)).toBeTruthy(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaCount(blockGridEditorName, contentElementTypeId, 1)).toBeTruthy(); }); @@ -116,8 +113,7 @@ test('can remove an area for a block', {tag: '@smoke'}, async ({umbracoApi, umbr await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaWithAlias(blockGridEditorName, contentElementTypeId, areaAlias)).toBeFalsy(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaCount(blockGridEditorName, contentElementTypeId, 0)).toBeTruthy(); }); @@ -140,8 +136,7 @@ test('can add multiple areas for a block', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaWithAlias(blockGridEditorName, contentElementTypeId)).toBeTruthy(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaWithAlias(blockGridEditorName, contentElementTypeId, areaAlias)).toBeTruthy(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaCount(blockGridEditorName, contentElementTypeId, 2)).toBeTruthy(); @@ -166,8 +161,7 @@ test('can add create button label for an area in a block', async ({umbracoApi, u await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaWithCreateButtonLabel(blockGridEditorName, contentElementTypeId, areaAlias, createButtonLabel)).toBeTruthy(); }); @@ -190,8 +184,7 @@ test('can remove create button label for an area in a block', async ({umbracoApi await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaWithCreateButtonLabel(blockGridEditorName, contentElementTypeId, areaAlias, '')).toBeTruthy(); }); @@ -214,8 +207,7 @@ test('can add min allowed for an area in a block', async ({umbracoApi, umbracoUi await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaWithMinAllowed(blockGridEditorName, contentElementTypeId, areaAlias, minAllowed)).toBeTruthy(); }); @@ -239,8 +231,7 @@ test('can remove min allowed for an area in a block', async ({umbracoApi, umbrac await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaWithMinAllowed(blockGridEditorName, contentElementTypeId, areaAlias, minAllowed)).toBeFalsy(); }); @@ -264,8 +255,7 @@ test.skip('can add add max allowed for an area in a block', async ({umbracoApi, await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaWithMaxAllowed(blockGridEditorName, contentElementTypeId, areaAlias, maxAllowed)).toBeTruthy(); }); @@ -289,8 +279,7 @@ test('can remove max allowed for an area in a block', async ({umbracoApi, umbrac await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainAreaWithMaxAllowed(blockGridEditorName, contentElementTypeId, areaAlias, maxAllowed)).toBeFalsy(); }); @@ -316,8 +305,7 @@ test.skip('min can not be more than max an area in a block', async ({umbracoApi, await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); }); test('can add specified allowance for an area in a block', async ({umbracoApi, umbracoUi}) => { @@ -338,8 +326,7 @@ test('can add specified allowance for an area in a block', async ({umbracoApi, u await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); }); // TODO: It is currently not possible to add a specified allowance diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/Block/BlockGridBlockSettings.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/Block/BlockGridBlockSettings.spec.ts index 5688688530..5b8a3f7a81 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/Block/BlockGridBlockSettings.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/Block/BlockGridBlockSettings.spec.ts @@ -31,8 +31,7 @@ test('can add a label to a block', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainLabel(blockGridEditorName, elementTypeId, labelText)).toBeTruthy(); }); @@ -52,8 +51,7 @@ test('can remove a label from a block', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainLabel(blockGridEditorName, elementTypeId, labelText)).toBeFalsy(); }); @@ -88,8 +86,7 @@ test('can add a settings model to a block', {tag: '@smoke'}, async ({umbracoApi, await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorContainBlocksWithSettingsTypeIds(blockGridEditorName, [settingsElementTypeId])).toBeTruthy(); }); @@ -111,8 +108,7 @@ test('can remove a settings model from a block', async ({umbracoApi, umbracoUi}) await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorContainBlocksWithSettingsTypeIds(blockGridEditorName, [settingsElementTypeId])).toBeFalsy(); }); @@ -120,7 +116,7 @@ test('can enable allow in root 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); - await umbracoApi.dataType.createBlockGridWithABlock(blockGridEditorName, contentElementTypeId); + await umbracoApi.dataType.createBlockGridWithPermissions(blockGridEditorName, contentElementTypeId); // Act await umbracoUi.dataType.goToDataType(blockGridEditorName); @@ -130,8 +126,7 @@ test('can enable allow in root from a block', async ({umbracoApi, umbracoUi}) => await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockHaveAllowInRootEnabled(blockGridEditorName, contentElementTypeId)).toBeTruthy(); }); @@ -139,7 +134,7 @@ test('can enable allow in areas 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); - await umbracoApi.dataType.createBlockGridWithABlock(blockGridEditorName, contentElementTypeId); + await umbracoApi.dataType.createBlockGridWithPermissions(blockGridEditorName, contentElementTypeId); // Act await umbracoUi.dataType.goToDataType(blockGridEditorName); @@ -149,8 +144,7 @@ test('can enable allow in areas from a block', async ({umbracoApi, umbracoUi}) = await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockHaveAllowInAreasEnabled(blockGridEditorName, contentElementTypeId)).toBeTruthy(); }); @@ -170,8 +164,7 @@ test('can add a column span to a block', {tag: '@smoke'}, async ({umbracoApi, um await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainColumnSpanOptions(blockGridEditorName, contentElementTypeId, columnSpan)).toBeTruthy(); }); @@ -191,8 +184,7 @@ test('can add multiple column spans to a block', async ({umbracoApi, umbracoUi}) await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainColumnSpanOptions(blockGridEditorName, contentElementTypeId, columnSpan)).toBeTruthy(); }); @@ -212,8 +204,7 @@ test('can remove a column span from a block', async ({umbracoApi, umbracoUi}) => await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainColumnSpanOptions(blockGridEditorName, contentElementTypeId, [])).toBeTruthy(); }); @@ -235,8 +226,7 @@ test('can add min and max row span to a block', async ({umbracoApi, umbracoUi}) await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainRowSpanOptions(blockGridEditorName, contentElementTypeId, rowSpanMin, rowSpanMax)).toBeTruthy(); }); @@ -258,7 +248,6 @@ test('can remove min and max row spans from a block', async ({umbracoApi, umbrac await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainRowSpanOptions(blockGridEditorName, contentElementTypeId, rowSpanMin, rowSpanMax)).toBeTruthy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/BlockGridEditor.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/BlockGridEditor.spec.ts index 7b55e7f3ba..e1c0b28fb3 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/BlockGridEditor.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockGrid/BlockGridEditor.spec.ts @@ -32,8 +32,7 @@ test('can create a block grid editor', {tag: '@smoke'}, async ({umbracoApi, umbr await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeCreated(); expect(await umbracoApi.dataType.doesNameExist(blockGridEditorName)).toBeTruthy(); const dataTypeData = await umbracoApi.dataType.getByName(blockGridEditorName); expect(dataTypeData.editorAlias).toBe(blockGridEditorAlias); @@ -51,8 +50,8 @@ test('can rename a block grid editor', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); + await umbracoUi.dataType.isDataTypeTreeItemVisible(blockGridEditorName); expect(await umbracoApi.dataType.doesNameExist(blockGridEditorName)).toBeTruthy(); expect(await umbracoApi.dataType.doesNameExist(wrongName)).toBeFalsy(); }); @@ -67,10 +66,9 @@ test('can delete a block grid editor', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickDeleteAndConfirmButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeDeleted(); expect(await umbracoApi.dataType.doesExist(blockGridId)).toBeFalsy(); - await umbracoUi.dataType.isTreeItemVisible(blockGridEditorName, false); + await umbracoUi.dataType.isDataTypeTreeItemVisible(blockGridEditorName, false); }); test('can add a block to a block grid editor', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { @@ -88,8 +86,7 @@ test('can add a block to a block grid editor', {tag: '@smoke'}, async ({umbracoA await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorContainBlocksWithContentTypeIds(blockGridEditorName, [elementTypeId])).toBeTruthy(); // Clean @@ -113,8 +110,7 @@ test('can add multiple blocks to a block grid editor', async ({umbracoApi, umbra await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorContainBlocksWithContentTypeIds(blockGridEditorName, [elementTypeId, secondElementTypeId])).toBeTruthy(); // Clean @@ -135,8 +131,7 @@ test('can remove a block from a block grid editor', {tag: '@smoke'}, async ({umb await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorContainBlocksWithContentTypeIds(blockGridEditorName, [elementTypeId])).toBeFalsy(); // Clean @@ -160,8 +155,7 @@ test('can add a block to a group in a block grid editor', async ({umbracoApi, um await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockGridGroupContainCorrectBlocks(blockGridEditorName, groupName, [elementTypeId])).toBeTruthy(); // Clean @@ -185,8 +179,7 @@ test('can add multiple blocks to a group in a block grid editor', async ({umbrac await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockGridGroupContainCorrectBlocks(blockGridEditorName, groupName, [elementTypeId, secondElementTypeId])).toBeTruthy(); // Clean @@ -208,8 +201,7 @@ test('can remove a block in a group from a block grid editor', {tag: '@smoke'}, await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorContainBlocksWithContentTypeIds(blockGridEditorName, [elementTypeId])).toBeFalsy(); }); @@ -233,8 +225,7 @@ test.fixme('can move a block from a group to another group in a block grid edito await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockGridGroupContainCorrectBlocks(blockGridEditorName, secondGroupName, [elementTypeId])).toBeTruthy(); expect(await umbracoApi.dataType.doesBlockGridGroupContainCorrectBlocks(blockGridEditorName, groupName, [elementTypeId])).toBeFalsy(); }); @@ -264,8 +255,7 @@ test('can add a min and max amount to a block grid editor', async ({umbracoApi, await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const dataTypeData = await umbracoApi.dataType.getByName(blockGridEditorName); expect(dataTypeData.values[0].value.min).toBe(minAmount); expect(dataTypeData.values[0].value.max).toBe(maxAmount); @@ -284,7 +274,7 @@ test('max can not be less than min in a block grid editor', async ({umbracoApi, await umbracoUi.dataType.clickSaveButton(); // Assert - await umbracoUi.dataType.isSuccessNotificationVisible(false); + await umbracoUi.dataType.isFailedStateButtonVisible(); await umbracoUi.dataType.doesAmountContainErrorMessageWithText('The low value must not be exceed the high value'); const dataTypeData = await umbracoApi.dataType.getByName(blockGridEditorName); expect(dataTypeData.values[0].value.min).toBe(minAmount); @@ -302,8 +292,7 @@ test('can enable live editing mode in a block grid editor', async ({umbracoApi, await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.isLiveEditingModeEnabledForBlockEditor(blockGridEditorName, true)).toBeTruthy(); }); @@ -317,8 +306,7 @@ test('can disable live editing mode in a block grid editor', async ({umbracoApi, await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.isLiveEditingModeEnabledForBlockEditor(blockGridEditorName, false)).toBeTruthy(); }); @@ -333,8 +321,7 @@ test('can add editor width in a block grid editor', async ({umbracoApi, umbracoU await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesMaxPropertyContainWidthForBlockEditor(blockGridEditorName, propertyEditorWidth)).toBeTruthy(); }); @@ -349,8 +336,7 @@ test('can remove editor width in a block grid editor', async ({umbracoApi, umbra await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesMaxPropertyContainWidthForBlockEditor(blockGridEditorName, propertyEditorWidth)).toBeFalsy(); expect(await umbracoApi.dataType.doesMaxPropertyContainWidthForBlockEditor(blockGridEditorName, '')).toBeTruthy(); }); @@ -366,8 +352,7 @@ test('can add a create button label in a block grid editor', async ({umbracoApi, await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockGridContainCreateButtonLabel(blockGridEditorName, createButtonLabel)).toBeTruthy(); }); @@ -383,8 +368,7 @@ test('can remove a create button label in a block grid editor', async ({umbracoA await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockGridContainCreateButtonLabel(blockGridEditorName, createButtonLabel)).toBeFalsy(); expect(await umbracoApi.dataType.doesBlockGridContainCreateButtonLabel(blockGridEditorName, '')).toBeTruthy(); }); @@ -400,8 +384,7 @@ test('can update grid columns in a block grid editor', async ({umbracoApi, umbra await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockGridContainGridColumns(blockGridEditorName, gridColumns)).toBeTruthy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockListEditor/BlockListBlocks.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockListEditor/BlockListBlocks.spec.ts index a08ac165fe..01c75a1e14 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockListEditor/BlockListBlocks.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockListEditor/BlockListBlocks.spec.ts @@ -31,8 +31,7 @@ test('can add a label to a block', {tag: '@smoke'}, async ({umbracoApi, umbracoU await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainLabel(blockListEditorName, elementTypeId, labelText)).toBeTruthy(); }); @@ -53,8 +52,7 @@ test('can update a label for a block', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainLabel(blockListEditorName, elementTypeId, newLabelText)).toBeTruthy(); }); @@ -74,6 +72,7 @@ test('can remove a label from a block', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorBlockContainLabel(blockListEditorName, elementTypeId, "")).toBeTruthy(); }); @@ -92,8 +91,7 @@ test('can update overlay size for a block', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const blockData = await umbracoApi.dataType.getByName(blockListEditorName); expect(blockData.values[0].value[0].editorSize).toEqual(overlaySize); }); @@ -129,8 +127,7 @@ test.skip('can remove a content model from a block', async ({umbracoApi, umbraco await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); }); test('can add a settings model to a block', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { @@ -149,8 +146,7 @@ test('can add a settings model to a block', {tag: '@smoke'}, async ({umbracoApi, await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorContainBlocksWithSettingsTypeIds(blockListEditorName, [settingsElementTypeId])).toBeTruthy(); // Clean @@ -175,8 +171,7 @@ test('can remove a settings model from a block', async ({umbracoApi, umbracoUi}) await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorContainBlocksWithSettingsTypeIds(blockListEditorName, [settingsElementTypeId])).toBeFalsy(); // Clean @@ -198,8 +193,7 @@ test('can add a background color to a block', async ({umbracoApi, umbracoUi}) => await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const blockData = await umbracoApi.dataType.getByName(blockListEditorName); expect(blockData.values[0].value[0].backgroundColor).toEqual(backgroundColor); }); @@ -222,8 +216,7 @@ test('can update a background color for a block', {tag: '@smoke'}, async ({umbra await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); blockData = await umbracoApi.dataType.getByName(blockListEditorName); expect(blockData.values[0].value[0].backgroundColor).toEqual(newBackgroundColor); }); @@ -245,8 +238,7 @@ test('can delete a background color from a block', async ({umbracoApi, umbracoUi await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); blockData = await umbracoApi.dataType.getByName(blockListEditorName); expect(blockData.values[0].value[0].backgroundColor).toEqual(''); }); @@ -266,8 +258,7 @@ test('can add a icon color to a block', {tag: '@smoke'}, async ({umbracoApi, umb await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const blockData = await umbracoApi.dataType.getByName(blockListEditorName); expect(blockData.values[0].value[0].iconColor).toEqual(iconColor); }); @@ -290,8 +281,7 @@ test('can update a icon color for a block', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); blockData = await umbracoApi.dataType.getByName(blockListEditorName); expect(blockData.values[0].value[0].iconColor).toEqual(newIconColor); }); @@ -313,8 +303,7 @@ test('can delete a icon color from a block', async ({umbracoApi, umbracoUi}) => await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); blockData = await umbracoApi.dataType.getByName(blockListEditorName); expect(blockData.values[0].value[0].iconColor).toEqual(''); }); @@ -346,8 +335,7 @@ test.skip('can update a custom stylesheet for a block', async ({umbracoApi, umbr await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); blockData = await umbracoApi.dataType.getByName(blockListEditorName); expect(blockData.values[0].value[0].stylesheet[0]).toEqual(encodedSecondStylesheetPath); @@ -378,8 +366,7 @@ test.skip('can delete a custom stylesheet from a block', async ({umbracoApi, umb await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); blockData = await umbracoApi.dataType.getByName(blockListEditorName); expect(blockData.values[0].value[0].stylesheet[0]).toBeUndefined(); @@ -401,8 +388,7 @@ test('can enable hide content editor in a block', async ({umbracoApi, umbracoUi} await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const blockData = await umbracoApi.dataType.getByName(blockListEditorName); expect(blockData.values[0].value[0].forceHideContentEditorInOverlay).toEqual(true); }); @@ -423,8 +409,7 @@ test('can disable hide content editor in a block', async ({umbracoApi, umbracoUi await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); blockData = await umbracoApi.dataType.getByName(blockListEditorName); expect(blockData.values[0].value[0].forceHideContentEditorInOverlay).toEqual(false); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockListEditor/BlockListEditor.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockListEditor/BlockListEditor.spec.ts index 874974ab9e..1239425d20 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockListEditor/BlockListEditor.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/BlockListEditor/BlockListEditor.spec.ts @@ -32,8 +32,8 @@ test('can create a block list editor', {tag: '@smoke'}, async ({umbracoApi, umbr await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeCreated(); + await umbracoUi.dataType.isDataTypeTreeItemVisible(blockListEditorName); expect(await umbracoApi.dataType.doesNameExist(blockListEditorName)).toBeTruthy(); const dataTypeData = await umbracoApi.dataType.getByName(blockListEditorName); expect(dataTypeData.editorAlias).toBe(blockListEditorAlias); @@ -51,8 +51,7 @@ test('can rename a block list editor', {tag: '@smoke'}, async ({umbracoApi, umbr await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesNameExist(blockListEditorName)).toBeTruthy(); expect(await umbracoApi.dataType.doesNameExist(wrongName)).toBeFalsy(); }); @@ -68,10 +67,9 @@ test('can delete a block list editor', {tag: '@smoke'}, async ({umbracoApi, umbr await umbracoUi.dataType.clickConfirmToDeleteButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeDeleted(); expect(await umbracoApi.dataType.doesExist(blockListId)).toBeFalsy(); - await umbracoUi.dataType.isTreeItemVisible(blockListEditorName, false); + await umbracoUi.dataType.isDataTypeTreeItemVisible(blockListEditorName, false); }); test('can add a block to a block list editor', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { @@ -89,8 +87,7 @@ test('can add a block to a block list editor', {tag: '@smoke'}, async ({umbracoA await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorContainBlocksWithContentTypeIds(blockListEditorName, [elementTypeId])).toBeTruthy(); // Clean @@ -114,8 +111,7 @@ test('can add multiple blocks to a block list editor', async ({umbracoApi, umbra await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorContainBlocksWithContentTypeIds(blockListEditorName, [elementTypeId, secondElementTypeId])).toBeTruthy(); // Clean @@ -136,8 +132,7 @@ test('can remove a block from a block list editor', {tag: '@smoke'}, async ({umb await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesBlockEditorContainBlocksWithContentTypeIds(blockListEditorName, [elementTypeId])).toBeFalsy(); // Clean @@ -157,8 +152,7 @@ test('can add a min and max amount to a block list editor', {tag: '@smoke'}, asy await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const dataTypeData = await umbracoApi.dataType.getByName(blockListEditorName); expect(dataTypeData.values[0].value.min).toBe(minAmount); expect(dataTypeData.values[0].value.max).toBe(maxAmount); @@ -177,7 +171,7 @@ test('max can not be less than min', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - await umbracoUi.dataType.isSuccessNotificationVisible(false); + await umbracoUi.dataType.isFailedStateButtonVisible(); const dataTypeData = await umbracoApi.dataType.getByName(blockListEditorName); await umbracoUi.dataType.doesAmountContainErrorMessageWithText('The low value must not be exceed the high value'); expect(dataTypeData.values[0].value.min).toBe(minAmount); @@ -195,8 +189,7 @@ test('can enable single block mode', {tag: '@smoke'}, async ({umbracoApi, umbrac await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.isSingleBlockModeEnabledForBlockList(blockListEditorName, true)).toBeTruthy(); }); @@ -210,8 +203,7 @@ test('can disable single block mode', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.isSingleBlockModeEnabledForBlockList(blockListEditorName, false)).toBeTruthy(); }); @@ -225,8 +217,7 @@ test('can enable live editing mode', {tag: '@smoke'}, async ({umbracoApi, umbrac await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.isLiveEditingModeEnabledForBlockEditor(blockListEditorName, true)).toBeTruthy(); }); @@ -240,8 +231,7 @@ test('can disable live editing mode', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.isLiveEditingModeEnabledForBlockEditor(blockListEditorName, false)).toBeTruthy(); }); @@ -255,8 +245,7 @@ test('can enable inline editing mode', {tag: '@smoke'}, async ({umbracoApi, umbr await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.isInlineEditingModeEnabledForBlockList(blockListEditorName, true)).toBeTruthy(); }); @@ -270,8 +259,7 @@ test('can disable inline editing mode', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.isInlineEditingModeEnabledForBlockList(blockListEditorName, false)).toBeTruthy(); }); @@ -286,8 +274,7 @@ test('can add a property editor width', {tag: '@smoke'}, async ({umbracoApi, umb await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesMaxPropertyContainWidthForBlockEditor(blockListEditorName, propertyWidth)).toBeTruthy(); }); @@ -304,8 +291,7 @@ test('can update a property editor width', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesMaxPropertyContainWidthForBlockEditor(blockListEditorName, newPropertyWidth)).toBeTruthy(); }); @@ -321,7 +307,6 @@ test('can remove a property editor width', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.isSuccessNotificationVisible(); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesMaxPropertyContainWidthForBlockEditor(blockListEditorName, '')).toBeTruthy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/CheckboxList.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/CheckboxList.spec.ts index 9ca433bba4..2a137796bf 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/CheckboxList.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/CheckboxList.spec.ts @@ -28,8 +28,7 @@ test('can add option', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'items', [optionName])).toBeTruthy(); }); @@ -60,8 +59,7 @@ test('can update option', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'items', [updatedOptionName])).toBeTruthy(); }); @@ -79,4 +77,4 @@ test('the default configuration is correct', async ({umbracoApi, umbracoUi}) => expect(dataTypeDefaultData.editorUiAlias).toBe(editorUiAlias); expect(dataTypeDefaultData.values).toEqual([]); expect(await umbracoApi.dataType.doesDataTypeHaveValue(dataTypeName, 'items')).toBeFalsy(); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ContentPicker.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ContentPicker.spec.ts index 948cc9e196..41bd278570 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ContentPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ContentPicker.spec.ts @@ -26,8 +26,7 @@ test('can ignore user start nodes', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'ignoreUserStartNodes', true)).toBeTruthy(); }); @@ -49,8 +48,7 @@ test('can add start node', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'startNodeId', contentId)).toBeTruthy(); // Clean @@ -75,8 +73,7 @@ test('can remove start node', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const customDataTypeData = await umbracoApi.dataType.getByName(customDataTypeName); expect(customDataTypeData.values).toEqual([]); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataType.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataType.spec.ts index 5cc6841c5b..cb26ee1e3c 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataType.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataType.spec.ts @@ -24,8 +24,8 @@ test('can create a data type', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeCreated(); + await umbracoUi.dataType.isDataTypeTreeItemVisible(dataTypeName); expect(await umbracoApi.dataType.doesNameExist(dataTypeName)).toBeTruthy(); }); @@ -42,8 +42,8 @@ test('can rename a data type', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); + await umbracoUi.dataType.isDataTypeTreeItemVisible(dataTypeName); expect(await umbracoApi.dataType.doesNameExist(dataTypeName)).toBeTruthy(); expect(await umbracoApi.dataType.doesNameExist(wrongDataTypeName)).toBeFalsy(); }); @@ -58,8 +58,8 @@ test('can delete a data type', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) await umbracoUi.dataType.deleteDataType(dataTypeName); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeDeleted(); + await umbracoUi.dataType.isDataTypeTreeItemVisible(dataTypeName, false); expect(await umbracoApi.dataType.doesNameExist(dataTypeName)).toBeFalsy(); }); @@ -80,8 +80,7 @@ test('can change property editor in a data type', {tag: '@smoke'}, async ({umbra await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesNameExist(dataTypeName)).toBeTruthy(); const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName); expect(dataTypeData.editorAlias).toBe(updatedEditorAlias); @@ -116,7 +115,6 @@ test('can change settings', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(dataTypeName, 'maxChars', maxCharsValue)).toBeTruthy(); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataTypeCollectionWorkspace.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataTypeCollectionWorkspace.spec.ts index 68f919dc61..ad61dd3f3a 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataTypeCollectionWorkspace.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataTypeCollectionWorkspace.spec.ts @@ -28,8 +28,7 @@ test('can create a data type using create options', async ({umbracoApi, umbracoU await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeCreated(); expect(await umbracoApi.dataType.doesNameExist(dataTypeName)).toBeTruthy(); // Check if the created data type is displayed in the collection view and has correct icon await umbracoUi.dataType.clickDataTypesMenu(); @@ -47,8 +46,7 @@ test('can create a data type folder using create options', async ({umbracoApi, u await umbracoUi.dataType.clickConfirmCreateFolderButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeCreated(); expect(await umbracoApi.dataType.doesNameExist(dataTypeFolderName)).toBeTruthy(); // Check if the created data type is displayed in the collection view and has correct icon await umbracoUi.dataType.clickDataTypesMenu(); @@ -69,8 +67,7 @@ test('can create a data type in a folder using create options', async ({umbracoA await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeCreated(); expect(await umbracoApi.dataType.doesNameExist(dataTypeName)).toBeTruthy(); // Check if the created data type is displayed in the collection view and has correct icon await umbracoUi.dataType.goToDataType(dataTypeFolderName); @@ -91,10 +88,9 @@ test('can create a data type folder in a folder using create options', async ({u await umbracoUi.dataType.clickConfirmCreateFolderButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeCreated(); expect(await umbracoApi.dataType.doesNameExist(childFolderName)).toBeTruthy(); // Check if the created data type is displayed in the collection view and has correct icon await umbracoUi.dataType.doesCollectionTreeItemTableRowHaveName(childFolderName); await umbracoUi.dataType.doesCollectionTreeItemTableRowHaveIcon(childFolderName, 'icon-folder'); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataTypeFolder.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataTypeFolder.spec.ts index 95a8c5fc87..2c6e7c86e9 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataTypeFolder.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataTypeFolder.spec.ts @@ -23,8 +23,7 @@ test('can create a data type folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.createDataTypeFolder(dataTypeFolderName); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeCreated(); expect(await umbracoApi.dataType.doesNameExist(dataTypeFolderName)).toBeTruthy(); }); @@ -43,8 +42,7 @@ test('can rename a data type folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickConfirmRenameButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeRenamed(); expect(await umbracoApi.dataType.doesNameExist(dataTypeFolderName)).toBeTruthy(); expect(await umbracoApi.dataType.doesNameExist(wrongDataTypeFolderName)).toBeFalsy(); }); @@ -59,8 +57,7 @@ test('can delete a data type folder', {tag: '@smoke'}, async ({umbracoApi, umbra await umbracoUi.dataType.deleteDataTypeFolder(dataTypeFolderName); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeDeleted(); expect(await umbracoApi.dataType.doesFolderExist(dataTypeFolderName)).toBeFalsy(); }); @@ -81,8 +78,7 @@ test('can create a data type in a folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeCreated(); expect(await umbracoApi.dataType.doesNameExist(dataTypeName)).toBeTruthy(); const dataTypeChildren = await umbracoApi.dataType.getChildren(dataTypeFolderId); expect(dataTypeChildren[0].name).toBe(dataTypeName); @@ -102,8 +98,7 @@ test('can create a folder in a folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.createDataTypeFolder(childFolderName); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeCreated(); expect(await umbracoApi.dataType.doesNameExist(childFolderName)).toBeTruthy(); const dataTypeChildren = await umbracoApi.dataType.getChildren(dataTypeFolderId); expect(dataTypeChildren[0].name).toBe(childFolderName); @@ -124,8 +119,7 @@ test('can create a folder in a folder in a folder', async ({umbracoApi, umbracoU await umbracoUi.dataType.createDataTypeFolder(childOfChildFolderName); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeCreated(); expect(await umbracoApi.dataType.doesNameExist(childOfChildFolderName)).toBeTruthy(); const childrenFolderData = await umbracoApi.dataType.getChildren(childFolderId); expect(childrenFolderData[0].name).toBe(childOfChildFolderName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DatePicker.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DatePicker.spec.ts index 95beb3ca58..bf30e15ed0 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DatePicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DatePicker.spec.ts @@ -30,8 +30,7 @@ test('can update date format', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'format', dateFormatValue)).toBeTruthy(); }); @@ -47,4 +46,4 @@ for (const datePickerType of datePickerTypes) { await umbracoUi.dataType.doesPropertyEditorHaveUiAlias(editorUiAlias); expect(await umbracoApi.dataType.doesDataTypeHaveValue(datePickerType.type, 'format', datePickerType.format)).toBeTruthy(); }); -} \ No newline at end of file +} diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Dropdown.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Dropdown.spec.ts index ec482cccb5..4c924d37ad 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Dropdown.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Dropdown.spec.ts @@ -29,8 +29,7 @@ test('can enable multiple choice', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'multiple', true)).toBeTruthy(); }); @@ -46,8 +45,7 @@ test('can add option', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'items', [optionName])).toBeTruthy(); }); @@ -62,8 +60,7 @@ test('can remove option', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'items', [removedOptionName])).toBeFalsy(); }); @@ -83,4 +80,4 @@ for (const dropdown of dropdowns) { expect(await umbracoApi.dataType.doesDataTypeHaveValue(dropdown.type, 'multiple', dropdown.multipleChoice)).toBeTruthy(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(dropdown.type, 'items')).toBeFalsy(); }); -} \ No newline at end of file +} diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ImageCropper.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ImageCropper.spec.ts index 93b4f48ee2..a801abc0df 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ImageCropper.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ImageCropper.spec.ts @@ -33,8 +33,7 @@ test('can add crop', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveCrops(customDataTypeName, cropData[0], cropData[1], cropData[2], cropData[3])).toBeTruthy(); }); @@ -52,8 +51,7 @@ test('can edit crop', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveCrops(customDataTypeName, updatedCropData[0], updatedCropData[1], updatedCropData[2], updatedCropData[3])).toBeTruthy(); expect(await umbracoApi.dataType.doesDataTypeHaveCrops(customDataTypeName, cropData[0], cropData[1], cropData[2], cropData[3])).toBeFalsy(); }); @@ -69,8 +67,7 @@ test('can delete crop', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveCrops(customDataTypeName, cropData[0], cropData[1], cropData[2], cropData[3])).toBeFalsy(); }); @@ -88,4 +85,4 @@ test('the default configuration is correct', async ({umbracoApi, umbracoUi}) => expect(dataTypeDefaultData.editorUiAlias).toBe(editorUiAlias); expect(dataTypeDefaultData.values).toEqual([]); expect(await umbracoApi.dataType.doesDataTypeHaveValue(dataTypeName, 'crops')).toBeFalsy(); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Label.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Label.spec.ts index e7c22c7913..87bafe1377 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Label.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Label.spec.ts @@ -33,8 +33,7 @@ test('can change value type', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'umbracoDataValueType', 'TEXT')).toBeTruthy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ListView.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ListView.spec.ts index 2e5a463c80..7edfa8681e 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ListView.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/ListView.spec.ts @@ -30,8 +30,7 @@ test('can update page size', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'pageSize', pageSizeValue)).toBeTruthy(); }); @@ -46,8 +45,7 @@ test('can update order direction', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'orderDirection', orderDirectionValue)).toBeTruthy(); }); @@ -63,8 +61,7 @@ test('can add column displayed', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesListViewHaveProperty(customDataTypeName, columnData[3], columnData[2], 1)).toBeTruthy(); }); @@ -79,8 +76,7 @@ test('can remove column displayed', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesListViewHaveProperty(customDataTypeName, 'Last edited', 'updateDate')).toBeFalsy(); }); @@ -96,8 +92,7 @@ test('can add layouts', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesListViewHaveLayout(customDataTypeName, layoutName, 'icon-list', layoutCollectionView)).toBeTruthy(); }); @@ -114,8 +109,7 @@ test('can remove layouts', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesListViewHaveLayout(customDataTypeName, layoutName, 'icon-list', layoutCollectionView)).toBeFalsy(); }); @@ -130,8 +124,7 @@ test('can update order by', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'orderBy', 'updateDate')).toBeTruthy(); }); @@ -147,8 +140,7 @@ test('can update workspace view icon', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'icon', iconValue)).toBeTruthy(); }); @@ -163,8 +155,7 @@ test('can update workspace view name', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'tabName', workspaceViewName)).toBeTruthy(); }); @@ -178,8 +169,7 @@ test('can enable show content workspace view first', async ({umbracoApi, umbraco await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'showContentFirst', true)).toBeTruthy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/MediaPicker.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/MediaPicker.spec.ts index 79569ba784..747751d49d 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/MediaPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/MediaPicker.spec.ts @@ -31,8 +31,7 @@ test('can update pick multiple items', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'multiple', true)).toBeTruthy(); }); @@ -48,8 +47,7 @@ test('can update amount', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesMediaPickerHaveMinAndMaxAmount(customDataTypeName, minValue, maxValue)).toBeTruthy(); }); @@ -63,8 +61,7 @@ test('can update enable focal point', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'enableLocalFocalPoint', true)).toBeTruthy(); }); @@ -85,8 +82,7 @@ test('can add image crop', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveCrops(customDataTypeName, cropData[0], cropData[1], cropData[2], cropData[3])).toBeTruthy(); }); @@ -100,8 +96,7 @@ test('can update ignore user start nodes', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'ignoreUserStartNodes', true)).toBeTruthy(); }); @@ -117,8 +112,7 @@ test('can add accepted types', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'filter', mediaTypeData.id)).toBeTruthy(); }); @@ -134,10 +128,7 @@ test('can remove accepted types', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'filter', mediaTypeData.id)).toBeFalsy(); }); @@ -156,8 +147,7 @@ test('can add start node', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'startNodeId', mediaId)).toBeTruthy(); // Clean @@ -179,8 +169,7 @@ test('can remove start node', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'startNodeId', mediaId)).toBeFalsy(); // Clean diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/MultiUrlPicker.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/MultiUrlPicker.spec.ts index f518067bb6..599c94b185 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/MultiUrlPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/MultiUrlPicker.spec.ts @@ -27,8 +27,7 @@ test('can update minimum number of items value', async ({umbracoApi, umbracoUi}) await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'minNumber', minimumValue)).toBeTruthy(); }); @@ -43,8 +42,7 @@ test('can update maximum number of items value', async ({umbracoApi, umbracoUi}) await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'maxNumber', maximumValue)).toBeTruthy(); }); @@ -58,8 +56,7 @@ test('can enable ignore user start nodes', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'ignoreUserStartNodes', true)).toBeTruthy(); }); @@ -74,8 +71,7 @@ test('can update overlay size', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'overlaySize', overlaySizeValue)).toBeTruthy(); }); @@ -89,8 +85,7 @@ test('can update hide anchor/query string input', async ({umbracoApi, umbracoUi} await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'hideAnchor', true)).toBeTruthy(); }); @@ -108,6 +103,7 @@ test.skip('cannot update the minimum number of items greater than the maximum', await umbracoUi.dataType.clickSaveButton(); // Assert + await umbracoUi.dataType.isFailedStateButtonVisible(); await umbracoUi.dataType.isErrorNotificationVisible(); }); @@ -129,4 +125,4 @@ test('the default configuration is correct', async ({umbracoApi, umbracoUi}) => expect(await umbracoApi.dataType.doesDataTypeHaveValue(dataTypeName, 'ignoreUserStartNodes')).toBeFalsy(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(dataTypeName, 'overlaySize')).toBeFalsy(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(dataTypeName, 'hideAnchor')).toBeFalsy(); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Numeric.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Numeric.spec.ts index 0a02cb6141..5ca6b71eb8 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Numeric.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Numeric.spec.ts @@ -27,8 +27,7 @@ test('can update minimum value', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'min', minimumValue)).toBeTruthy(); }); @@ -43,8 +42,7 @@ test('can update Maximum value', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'max', maximumValue)).toBeTruthy(); }); @@ -59,8 +57,7 @@ test('can update step size value', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'step', stepSizeValue)).toBeTruthy(); }); @@ -75,8 +72,7 @@ test.skip('can allow decimals', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'allowDecimals', true)).toBeTruthy(); }); @@ -94,6 +90,7 @@ test.skip('cannot update the minimum greater than the maximum', async ({umbracoA await umbracoUi.dataType.clickSaveButton(); // Assert + await umbracoUi.dataType.isFailedStateButtonVisible(); await umbracoUi.dataType.isErrorNotificationVisible(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Radiobox.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Radiobox.spec.ts index f745b87ed7..de6c786e1b 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Radiobox.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Radiobox.spec.ts @@ -28,8 +28,7 @@ test('can add option', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'items', [optionName])).toBeTruthy(); }); @@ -45,8 +44,7 @@ test('can remove option', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataType, 'items', [removedOptionName])).toBeFalsy(); // Clean @@ -67,4 +65,4 @@ test('the default configuration is correct', async ({umbracoApi, umbracoUi}) => expect(dataTypeDefaultData.editorUiAlias).toBe(editorUiAlias); expect(dataTypeDefaultData.values).toEqual([]); expect(await umbracoApi.dataType.doesDataTypeHaveValue(dataTypeName, 'items')).toBeFalsy(); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Tags.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Tags.spec.ts index b440771781..b1d619d595 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Tags.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Tags.spec.ts @@ -27,8 +27,7 @@ test('can update define a tag group', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'group', tagGroup)).toBeTruthy(); }); @@ -43,8 +42,7 @@ test('can select storage type', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'storageType', storageType)).toBeTruthy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Textarea.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Textarea.spec.ts index a3cb9db7a4..d9ac836d2c 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Textarea.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Textarea.spec.ts @@ -27,8 +27,7 @@ test('can update maximum allowed characters value', async ({umbracoApi, umbracoU await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'maxChars', maxCharsValue)).toBeTruthy(); }); @@ -43,8 +42,7 @@ test('can update number of rows value', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'rows', numberOfRowsValue)).toBeTruthy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Textstring.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Textstring.spec.ts index 3506915582..02821b3d50 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Textstring.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Textstring.spec.ts @@ -27,8 +27,7 @@ test('can update maximum allowed characters value', async ({umbracoApi, umbracoU await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'maxChars', maxCharsValue)).toBeTruthy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Tiptap.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Tiptap.spec.ts index e61aa1b40e..e4b1a57200 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Tiptap.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Tiptap.spec.ts @@ -29,8 +29,7 @@ test('can create a rich text editor with tiptap', {tag: '@smoke'}, async ({umbra await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.waitForDataTypeToBeCreated(); expect(await umbracoApi.dataType.doesNameExist(tipTapName)).toBeTruthy(); const dataTypeData = await umbracoApi.dataType.getByName(tipTapName); expect(dataTypeData.editorAlias).toBe(tipTapAlias); @@ -48,8 +47,7 @@ test('can rename a rich text editor with tiptap', async ({umbracoApi, umbracoUi} await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesNameExist(tipTapName)).toBeTruthy(); expect(await umbracoApi.dataType.doesNameExist(wrongName)).toBeFalsy(); }); @@ -64,10 +62,10 @@ test('can delete a rich text editor with tiptap', async ({umbracoApi, umbracoUi} await umbracoUi.dataType.clickDeleteAndConfirmButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); + await umbracoUi.dataType.waitForDataTypeToBeDeleted(); await umbracoUi.dataType.isErrorNotificationVisible(false); expect(await umbracoApi.dataType.doesNameExist(tipTapName)).toBeFalsy(); - await umbracoUi.dataType.isTreeItemVisible(tipTapName, false); + await umbracoUi.dataType.isDataTypeTreeItemVisible(tipTapName, false); }); test('can add dimensions', async ({umbracoApi, umbracoUi}) => { @@ -82,8 +80,7 @@ test('can add dimensions', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesRTEHaveDimensions(tipTapName, width, height)).toBeTruthy(); }); @@ -98,8 +95,7 @@ test('can update maximum size for inserted images', async ({umbracoApi, umbracoU await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(tipTapName, 'maxImageSize', maximumSize)).toBeTruthy(); }); @@ -114,8 +110,7 @@ test('can select overlay size', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(tipTapName, 'overlaySize', overlaySizeValue)).toBeTruthy(); }); @@ -132,8 +127,7 @@ test('can add an available block', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesRTEContainBlocks(tipTapName, [elementTypeId])).toBeTruthy(); // Verify that "Block" extension is enable await umbracoUi.dataType.isExtensionItemChecked('Block'); @@ -154,8 +148,7 @@ test('can add image upload folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(tipTapName, 'mediaParentId', mediaFolderId)).toBeTruthy(); // Clean @@ -172,8 +165,7 @@ test('can enable ignore user start nodes', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(tipTapName, 'ignoreUserStartNodes', true)).toBeTruthy(); }); @@ -191,8 +183,7 @@ test('can delete toolbar group', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const tipTapData = await umbracoApi.dataType.getByName(tipTapName); const toolbarValue = tipTapData.values.find(value => value.alias === 'toolbar'); expect(toolbarValue.value[rowIndex].length).toBe(groupCount - 1); @@ -211,8 +202,7 @@ test('can delete toolbar row', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const tipTapData = await umbracoApi.dataType.getByName(tipTapName); const toolbarValue = tipTapData.values.find(value => value.alias === 'toolbar'); if (rowCount - 1 === 0) { @@ -234,8 +224,7 @@ test('can disable extensions item', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const tipTapData = await umbracoApi.dataType.getByName(tipTapName); const extensionsValue = tipTapData.values.find(value => value.alias === 'extensions'); expect(extensionsValue.value.length).toBe(extensionsCount - 1); @@ -254,7 +243,7 @@ test('can add a statusbar', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const tipTapData = await umbracoApi.dataType.getByName(tipTapName); const statusbarValue = tipTapData.values.find(value => value.alias === 'statusbar'); expect(statusbarValue.value).toEqual([[statusbarApiValue]]); @@ -271,8 +260,8 @@ test('can remove a statusbar', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const tipTapData = await umbracoApi.dataType.getByName(tipTapName); const statusbarValue = tipTapData.values.find(value => value.alias === 'statusbar'); expect(statusbarValue).toBeFalsy(); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/TrueFalse.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/TrueFalse.spec.ts index 3b03ffcaac..ab163d88dc 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/TrueFalse.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/TrueFalse.spec.ts @@ -26,8 +26,7 @@ test('can update preset value state', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'default', true)).toBeTruthy(); }); @@ -35,14 +34,13 @@ test('can update show toggle labels', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.dataType.createDefaultTrueFalseDataType(customDataTypeName); await umbracoUi.dataType.goToDataType(customDataTypeName); - + // Act await umbracoUi.dataType.clickShowToggleLabelsToggle(); await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'showLabels', true)).toBeTruthy(); }); @@ -51,14 +49,13 @@ test('can update label on', async ({umbracoApi, umbracoUi}) => { const labelOnValue = 'Test Label On'; await umbracoApi.dataType.createDefaultTrueFalseDataType(customDataTypeName); await umbracoUi.dataType.goToDataType(customDataTypeName); - + // Act await umbracoUi.dataType.enterLabelOnValue(labelOnValue); await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'labelOn', labelOnValue)).toBeTruthy(); }); @@ -67,14 +64,13 @@ test('can update label off', async ({umbracoApi, umbracoUi}) => { const labelOffValue = 'Test Label Off'; await umbracoApi.dataType.createDefaultTrueFalseDataType(customDataTypeName); await umbracoUi.dataType.goToDataType(customDataTypeName); - + // Act await umbracoUi.dataType.enterLabelOffValue(labelOffValue); await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'labelOff', labelOffValue)).toBeTruthy(); }); @@ -95,4 +91,4 @@ test('the default configuration is correct', async ({umbracoApi, umbracoUi}) => expect(await umbracoApi.dataType.doesDataTypeHaveValue(dataTypeName, 'showLabels')).toBeFalsy(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(dataTypeName, 'labelOn')).toBeFalsy(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(dataTypeName, 'labelOff')).toBeFalsy(); -}); \ No newline at end of file +}); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/UploadField.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/UploadField.spec.ts index 41b384a6c9..5f2821e538 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/UploadField.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/UploadField.spec.ts @@ -33,8 +33,7 @@ test('can add accepted file extension', async ({ umbracoApi, umbracoUi }) => { await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.dataType.doesDataTypeHaveValue(customDataTypeName, 'fileExtensions', [fileExtensionValue])).toBeTruthy(); }); @@ -49,8 +48,7 @@ test('can remove accepted file extension', async ({ umbracoApi, umbracoUi }) => await umbracoUi.dataType.clickSaveButton(); // Assert - //await umbracoUi.dataType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.dataType.isErrorNotificationVisible(false); + await umbracoUi.dataType.isSuccessStateVisibleForSaveButton(); const customDataTypeData = await umbracoApi.dataType.getByName(customDataTypeName); expect(customDataTypeData.values).toEqual([]); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Dictionary/Dictionary.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Dictionary/Dictionary.spec.ts index 0bfee39f91..c8155e889c 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Dictionary/Dictionary.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Dictionary/Dictionary.spec.ts @@ -23,7 +23,7 @@ test('can create a dictionary item', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dictionary.clickSaveButton(); // Assert - //await umbracoUi.dictionary.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); + await umbracoUi.dictionary.waitForDictionaryToBeCreated(); await umbracoUi.dictionary.isErrorNotificationVisible(false); expect(await umbracoApi.dictionary.doesNameExist(dictionaryName)).toBeTruthy(); await umbracoUi.dictionary.clickLeftArrowButton(); @@ -44,9 +44,7 @@ test('can delete a dictionary item', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dictionary.deleteDictionary(); // Assert - // TODO: Since we are not asserting on a success notification yet, we need to wait to make sure the dictionary is deleted - await umbracoUi.waitForTimeout(500); - //await umbracoUi.dictionary.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); + await umbracoUi.dictionary.waitForDictionaryToBeDeleted(); await umbracoUi.dictionary.isErrorNotificationVisible(false); expect(await umbracoApi.dictionary.doesNameExist(dictionaryName)).toBeFalsy(); // Verify the dictionary item does not display in the tree @@ -69,7 +67,7 @@ test('can create a dictionary item in a dictionary', {tag: '@smoke'}, async ({um await umbracoUi.dictionary.clickSaveButton(); // Assert - //await umbracoUi.dictionary.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); + await umbracoUi.dictionary.waitForDictionaryToBeCreated(); await umbracoUi.dictionary.isErrorNotificationVisible(false); const dictionaryChildren = await umbracoApi.dictionary.getChildren(parentDictionaryId); expect(dictionaryChildren[0].name).toEqual(dictionaryName); @@ -133,7 +131,7 @@ test('can import a dictionary item', async ({umbracoApi, umbracoUi}) => { await umbracoUi.dictionary.importDictionary(udtFilePath); // Assert - await umbracoUi.waitForTimeout(500); + await umbracoUi.dictionary.waitForDictionaryToBeImported(); // Verify the imported dictionary item displays in the list await umbracoUi.reloadPage(); expect(await umbracoUi.dictionary.doesDictionaryListHaveText(importDictionaryName)).toBeTruthy(); @@ -156,13 +154,11 @@ test('can import a dictionary item with descendants', {tag: '@smoke'}, async ({u await umbracoUi.dictionary.clickActionsMenuForDictionary(dictionaryName); await umbracoUi.dictionary.clickImportActionMenuOption(); await umbracoUi.dictionary.importDictionary(udtFilePath); - // These timeouts are necessary as this test can fail - await umbracoUi.waitForTimeout(500); // Assert // Verify the imported dictionary items display in the list + await umbracoUi.dictionary.waitForDictionaryToBeImported(); await umbracoUi.reloadPage(); - await umbracoUi.waitForTimeout(500); expect(await umbracoUi.dictionary.doesDictionaryListHaveText(importParentDictionaryName)).toBeTruthy(); expect(await umbracoUi.dictionary.doesDictionaryListHaveText(importChildDictionaryName)).toBeTruthy(); // Verify the imported dictionary items display in the tree diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/ListViewMedia.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/ListViewMedia.spec.ts index cf892483d6..f33a608668 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/ListViewMedia.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/ListViewMedia.spec.ts @@ -105,8 +105,7 @@ test('can allow bulk trash in the media section', async ({umbracoApi, umbracoUi} await umbracoUi.media.clickConfirmTrashButton(); // Assert - //await umbracoUi.media.isSuccessNotificationVisible(); - await umbracoUi.media.isErrorNotificationVisible(false); + await umbracoUi.media.waitForMediaToBeTrashed(); expect(await umbracoApi.media.doesNameExist(firstMediaFileName)).toBeFalsy(); expect(await umbracoApi.media.doesNameExist(secondMediaFileName)).toBeFalsy(); expect(await umbracoApi.media.doesMediaItemExistInRecycleBin(firstMediaFileName)).toBeTruthy(); @@ -132,8 +131,7 @@ test.fixme('can allow bulk move in the media section', async ({umbracoApi, umbra await umbracoUi.media.clickChooseModalButton(); // Assert - //await umbracoUi.media.isSuccessNotificationVisible(); - await umbracoUi.media.isErrorNotificationVisible(false); + await umbracoUi.media.waitForMediaToBeMoved(); expect(await umbracoApi.media.doesMediaItemHaveChildName(mediaFolderId, firstMediaFileName)).toBeTruthy(); expect(await umbracoApi.media.doesMediaItemHaveChildName(mediaFolderId, secondMediaFileName)).toBeTruthy(); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/Media.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/Media.spec.ts index 25c923b50d..9292d61540 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/Media.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/Media.spec.ts @@ -14,8 +14,7 @@ test.afterEach(async ({umbracoApi}) => { await umbracoApi.media.ensureNameNotExists(mediaFileName); }); -//TODO: Remove skip when the frontend is ready. Currently it is possible to create an empty media file, should not be possible -test.skip('can not create a empty media file', async ({umbracoApi, umbracoUi}) => { +test('can not create a empty media file', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoUi.media.goToSection(ConstantHelper.sections.media); @@ -44,8 +43,7 @@ test('can rename a media file', async ({umbracoApi, umbracoUi}) => { await umbracoUi.media.clickSaveButton(); // Assert - //await umbracoUi.media.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.media.isErrorNotificationVisible(false); + await umbracoUi.media.isSuccessStateVisibleForSaveButton(); await umbracoUi.media.isMediaTreeItemVisible(mediaFileName); expect(await umbracoApi.media.doesNameExist(mediaFileName)).toBeTruthy(); }); @@ -72,8 +70,7 @@ for (const mediaFileType of mediaFileTypes) { await umbracoUi.media.clickSaveButton(); // Assert - //await umbracoUi.media.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.media.isErrorNotificationVisible(false); + await umbracoUi.media.waitForMediaItemToBeCreated(); const mediaData = await umbracoApi.media.getByName(mediaFileType.fileName); const mediaUrl = await umbracoApi.media.getMediaUrl(mediaData.id); await umbracoUi.media.doesMediaHaveThumbnail(mediaData.id, mediaFileType.thumbnail, mediaUrl); @@ -97,8 +94,7 @@ test('can create a folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.media.clickSaveButton(); // Assert - //await umbracoUi.media.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.media.isErrorNotificationVisible(false); + await umbracoUi.media.waitForMediaItemToBeCreated(); await umbracoUi.media.isMediaTreeItemVisible(folderName); expect(await umbracoApi.media.doesNameExist(folderName)).toBeTruthy(); @@ -119,8 +115,10 @@ test('can trash a folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.media.clickConfirmTrashButton(); // Assert + await umbracoUi.media.waitForMediaToBeTrashed(); await umbracoUi.media.doesSuccessNotificationHaveText(NotificationConstantHelper.success.movedToRecycleBin); await umbracoUi.media.isTreeItemVisible(folderName, false); + await umbracoUi.media.isItemVisibleInRecycleBin(folderName); expect(await umbracoApi.media.doesNameExist(folderName)).toBeFalsy(); }); @@ -133,14 +131,13 @@ test('can create a folder in a folder', async ({umbracoApi, umbracoUi}) => { // Act await umbracoUi.media.clickActionsMenuForName(parentFolderName); - await umbracoUi.media.clickCreateActionMenuOption(); + await umbracoUi.media.clickCreateModalButton(); await umbracoUi.media.clickMediaTypeName('Folder'); await umbracoUi.media.enterMediaItemName(folderName); await umbracoUi.media.clickSaveButton(); // Assert - //await umbracoUi.media.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.media.isErrorNotificationVisible(false); + await umbracoUi.media.waitForMediaItemToBeCreated(); await umbracoUi.media.isMediaTreeItemVisible(parentFolderName); await umbracoUi.media.isMediaTreeItemVisible(folderName, false); await umbracoUi.media.clickMediaCaretButtonForName(parentFolderName); @@ -182,7 +179,9 @@ test('can trash a media item', async ({umbracoApi, umbracoUi}) => { await umbracoUi.media.clickConfirmTrashButton(); // Assert + await umbracoUi.media.waitForMediaToBeTrashed(); await umbracoUi.media.doesSuccessNotificationHaveText(NotificationConstantHelper.success.movedToRecycleBin); + await umbracoUi.media.isMediaTreeItemVisible(mediaFileName, false); await umbracoUi.media.isItemVisibleInRecycleBin(mediaFileName); expect(await umbracoApi.media.doesNameExist(mediaFileName)).toBeFalsy(); expect(await umbracoApi.media.doesMediaItemExistInRecycleBin(mediaFileName)).toBeTruthy(); @@ -226,8 +225,7 @@ test('can delete a media item from the recycle bin', async ({umbracoApi, umbraco await umbracoUi.media.deleteMediaItem(mediaFileName); // Assert - //await umbracoUi.media.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.media.isErrorNotificationVisible(false); + await umbracoUi.media.waitForMediaToBeTrashed(); await umbracoUi.media.isItemVisibleInRecycleBin(mediaFileName, false, false); expect(await umbracoApi.media.doesNameExist(mediaFileName)).toBeFalsy(); expect(await umbracoApi.media.doesMediaItemExistInRecycleBin(mediaFileName)).toBeFalsy(); @@ -272,8 +270,7 @@ test('can trash a media node with a relation', async ({umbracoApi, umbracoUi}) = await umbracoUi.media.clickConfirmTrashButton(); // Assert - // await umbracoUi.media.doesSuccessNotificationHaveText(NotificationConstantHelper.success.movedToRecycleBin); - await umbracoUi.media.isErrorNotificationVisible(false); + await umbracoUi.media.waitForMediaToBeTrashed(); await umbracoUi.media.isItemVisibleInRecycleBin(mediaFileName); expect(await umbracoApi.media.doesNameExist(mediaFileName)).toBeFalsy(); expect(await umbracoApi.media.doesMediaItemExistInRecycleBin(mediaFileName)).toBeTruthy(); @@ -311,8 +308,7 @@ test('can bulk trash media nodes with a relation', async ({umbracoApi, umbracoUi await umbracoUi.media.clickConfirmTrashButton(); // Assert - // await umbracoUi.media.isSuccessNotificationVisible(); - await umbracoUi.media.isErrorNotificationVisible(false); + await umbracoUi.media.waitForMediaToBeTrashed(); expect(await umbracoApi.media.doesNameExist(firstMediaFileName)).toBeFalsy(); expect(await umbracoApi.media.doesNameExist(secondMediaFileName)).toBeFalsy(); expect(await umbracoApi.media.doesMediaItemExistInRecycleBin(firstMediaFileName)).toBeTruthy(); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Members/MemberGroups.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Members/MemberGroups.spec.ts index 54618fa4a7..3c8b3d9b88 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Members/MemberGroups.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Members/MemberGroups.spec.ts @@ -20,9 +20,8 @@ test('can create a member group', {tag: '@smoke'}, async ({umbracoApi, umbracoUi await umbracoUi.memberGroup.clickSaveButton(); // Assert - //await umbracoUi.memberGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.memberGroup.isErrorNotificationVisible(false); - await umbracoUi.memberGroup.clickLeftArrowButton(); + await umbracoUi.memberGroup.waitForMemberGroupToBeCreated(); + await umbracoUi.memberGroup.clickMemberGroupsSidebarButton(); await umbracoUi.memberGroup.isMemberGroupNameVisible(memberGroupName); expect(await umbracoApi.memberGroup.doesNameExist(memberGroupName)).toBeTruthy(); }); @@ -33,7 +32,7 @@ test('cannot create member group with empty name', async ({umbracoApi, umbracoUi await umbracoUi.memberGroup.clickSaveButton(); // Assert - // await umbracoUi.memberGroup.doesErrorNotificationHaveText(NotificationConstantHelper.error.emptyName); + await umbracoUi.memberGroup.isFailedStateButtonVisible(); expect(await umbracoApi.memberGroup.doesNameExist(memberGroupName)).toBeFalsy(); }); @@ -48,6 +47,7 @@ test('cannot create member group with duplicate name', async ({umbracoApi, umbra await umbracoUi.memberGroup.clickSaveButton(); // Assert + await umbracoUi.memberGroup.isFailedStateButtonVisible(); await umbracoUi.memberGroup.doesErrorNotificationHaveText(NotificationConstantHelper.error.duplicateName); }); @@ -63,8 +63,8 @@ test('can delete a member group', {tag: '@smoke'}, async ({umbracoApi, umbracoUi await umbracoUi.memberGroup.clickConfirmToDeleteButton(); // Assert - //await umbracoUi.memberGroup.isSuccessNotificationVisible(); - await umbracoUi.memberGroup.isErrorNotificationVisible(false); + await umbracoUi.memberGroup.waitForMemberGroupToBeDeleted(); + await umbracoUi.memberGroup.clickMemberGroupsSidebarButton(); await umbracoUi.memberGroup.isMemberGroupNameVisible(memberGroupName, false); expect(await umbracoApi.memberGroup.doesNameExist(memberGroupName)).toBeFalsy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Members/Members.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Members/Members.spec.ts index e20c444ced..6bbc40f1dd 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Members/Members.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Members/Members.spec.ts @@ -38,8 +38,9 @@ test('can create a member', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => await umbracoUi.member.clickSaveButton(); // Assert - //await umbracoUi.member.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created) - await umbracoUi.member.isErrorNotificationVisible(false);; + await umbracoUi.member.waitForMemberToBeCreated(); + await umbracoUi.member.clickMembersSidebarButton(); + await umbracoUi.member.isMemberWithNameVisible(memberName, true); expect(await umbracoApi.member.doesNameExist(memberName)).toBeTruthy(); }); @@ -55,8 +56,7 @@ test('can edit comments', async ({umbracoApi, umbracoUi}) => { await umbracoUi.member.clickSaveButton(); // Assert - //await umbracoUi.member.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved) - await umbracoUi.member.isErrorNotificationVisible(false);; + await umbracoUi.member.isSuccessStateVisibleForSaveButton(); const memberData = await umbracoApi.member.get(memberId); expect(memberData.values[0].value).toBe(comment); }); @@ -74,8 +74,7 @@ test('can edit username', async ({umbracoApi, umbracoUi}) => { await umbracoUi.member.clickSaveButton(); // Assert - //await umbracoUi.member.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved) - await umbracoUi.member.isErrorNotificationVisible(false);; + await umbracoUi.member.isSuccessStateVisibleForSaveButton(); const memberData = await umbracoApi.member.get(memberId); expect(memberData.username).toBe(updatedUsername); }); @@ -93,8 +92,7 @@ test('can edit email', async ({umbracoApi, umbracoUi}) => { await umbracoUi.member.clickSaveButton(); // Assert - //await umbracoUi.member.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved) - await umbracoUi.member.isErrorNotificationVisible(false);; + await umbracoUi.member.isSuccessStateVisibleForSaveButton(); const memberData = await umbracoApi.member.get(memberId); expect(memberData.email).toBe(updatedEmail); }); @@ -114,8 +112,7 @@ test('can edit password', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { await umbracoUi.member.clickSaveButton(); // Assert - //await umbracoUi.member.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved) - await umbracoUi.member.isErrorNotificationVisible(false);; + await umbracoUi.member.isSuccessStateVisibleForSaveButton(); }); test('can add member group', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { @@ -133,8 +130,7 @@ test('can add member group', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => await umbracoUi.member.clickSaveButton(); // Assert - //await umbracoUi.member.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved) - await umbracoUi.member.isErrorNotificationVisible(false);; + await umbracoUi.member.isSuccessStateVisibleForSaveButton(); const memberData = await umbracoApi.member.get(memberId); expect(memberData.groups[0]).toBe(memberGroupId); @@ -158,8 +154,7 @@ test('can remove member group', async ({umbracoApi, umbracoUi}) => { await umbracoUi.member.clickSaveButton(); // Assert - //await umbracoUi.member.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved) - await umbracoUi.member.isErrorNotificationVisible(false);; + await umbracoUi.member.isSuccessStateVisibleForSaveButton(); const memberData = await umbracoApi.member.get(memberId); expect(memberData.groups.length).toBe(0); @@ -203,8 +198,7 @@ test('can enable approved', async ({umbracoApi, umbracoUi}) => { await umbracoUi.member.clickSaveButton(); // Assert - //await umbracoUi.member.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved) - await umbracoUi.member.isErrorNotificationVisible(false);; + await umbracoUi.member.isSuccessStateVisibleForSaveButton(); const memberData = await umbracoApi.member.get(memberId); expect(memberData.isApproved).toBe(true); }); @@ -222,8 +216,9 @@ test('can delete member', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { await umbracoUi.memberGroup.clickConfirmToDeleteButton(); // Assert - //await umbracoUi.member.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted) - await umbracoUi.member.isErrorNotificationVisible(false);; + await umbracoUi.member.waitForMemberToBeDeleted(); + await umbracoUi.member.clickMembersSidebarButton(); + await umbracoUi.member.isMemberWithNameVisible(memberName, false); expect(await umbracoApi.member.doesNameExist(memberName)).toBeFalsy(); }); @@ -244,6 +239,7 @@ test('cannot create member with invalid email', async ({umbracoApi, umbracoUi}) await umbracoUi.member.clickSaveButton(); // Assert + await umbracoUi.member.isFailedStateButtonVisible(); await umbracoUi.member.doesErrorNotificationHaveText(NotificationConstantHelper.error.invalidEmail); expect(await umbracoApi.member.doesNameExist(memberName)).toBeFalsy(); }); @@ -262,6 +258,7 @@ test.skip('cannot update email to an invalid email', async ({umbracoApi, umbraco await umbracoUi.member.clickSaveButton(); // Assert + await umbracoUi.member.isFailedStateButtonVisible(); await umbracoUi.member.isErrorNotificationVisible(); const memberData = await umbracoApi.member.get(memberId); expect(memberData.email).toBe(email); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentBlueprint/DocumentBlueprint.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentBlueprint/DocumentBlueprint.spec.ts index 09db87d8a8..56663d32fe 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentBlueprint/DocumentBlueprint.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentBlueprint/DocumentBlueprint.spec.ts @@ -29,8 +29,7 @@ test('can create a document blueprint from the settings menu', {tag: '@smoke'}, await umbracoUi.documentBlueprint.clickSaveButton(); // Assert - //await umbracoUi.documentBlueprint.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentBlueprint.isErrorNotificationVisible(false); + await umbracoUi.documentBlueprint.waitForDocumentBlueprintToBeCreated() expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy(); await umbracoUi.documentBlueprint.isDocumentBlueprintRootTreeItemVisible(documentBlueprintName, true); }); @@ -49,8 +48,7 @@ test('can rename a document blueprint', async ({umbracoApi, umbracoUi}) => { await umbracoUi.documentBlueprint.clickSaveButton(); // Assert - //await umbracoUi.documentBlueprint.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentBlueprint.isErrorNotificationVisible(false); + await umbracoUi.documentBlueprint.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy(); expect(await umbracoApi.documentBlueprint.doesNameExist(wrongDocumentBlueprintName)).toBeFalsy(); await umbracoUi.documentBlueprint.isDocumentBlueprintRootTreeItemVisible(documentBlueprintName, true, false); @@ -70,8 +68,7 @@ test('can delete a document blueprint', async ({umbracoApi, umbracoUi}) => { await umbracoUi.documentBlueprint.clickConfirmToDeleteButton(); // Assert - //await umbracoUi.documentBlueprint.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.documentBlueprint.isErrorNotificationVisible(false); + await umbracoUi.documentBlueprint.waitForDocumentBlueprintToBeDeleted(); expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeFalsy(); await umbracoUi.documentBlueprint.isDocumentBlueprintRootTreeItemVisible(documentBlueprintName, false, false); }); @@ -89,8 +86,7 @@ test('can create a document blueprint from the content menu', async ({umbracoApi await umbracoUi.content.clickSaveModalButton(); // Assert - //await umbracoUi.documentBlueprint.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentBlueprint.isErrorNotificationVisible(false); + await umbracoUi.documentBlueprint.waitForDocumentBlueprintToBeCreated(); expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy(); await umbracoUi.documentBlueprint.goToSettingsTreeItem('Document Blueprints'); await umbracoUi.documentBlueprint.isDocumentBlueprintRootTreeItemVisible(documentBlueprintName, true); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentType.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentType.spec.ts index 0825634436..9c7fdf4e50 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentType.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentType.spec.ts @@ -24,8 +24,7 @@ test('can create a document type', {tag: '@smoke'}, async ({umbracoApi, umbracoU await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); await umbracoUi.documentType.reloadTree('Document Types'); await umbracoUi.documentType.isDocumentTreeItemVisible(documentTypeName); @@ -44,9 +43,7 @@ test('can create a document type with a template', {tag: '@smoke'}, async ({umbr await umbracoUi.documentType.clickSaveButton(); // Assert - // Checks if both the success notification for document Types and the template are visible - //await umbracoUi.documentType.doesSuccessNotificationsHaveCount(2); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); // Checks if the documentType contains the template const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); const templateData = await umbracoApi.template.getByName(documentTypeName); @@ -69,8 +66,7 @@ test('can create a element type', {tag: '@smoke'}, async ({umbracoApi, umbracoUi await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); // Checks if the isElement is true const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); @@ -86,14 +82,11 @@ test('can rename a document type', {tag: '@smoke'}, async ({umbracoApi, umbracoU // Act await umbracoUi.documentType.goToDocumentType(wrongName); - await umbracoUi.waitForTimeout(1000); await umbracoUi.documentType.enterDocumentTypeName(documentTypeName); - await umbracoUi.waitForTimeout(1000); await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); await umbracoUi.documentType.isDocumentTreeItemVisible(wrongName, false); await umbracoUi.documentType.isDocumentTreeItemVisible(documentTypeName); @@ -114,8 +107,7 @@ test('can update the alias for a document type', async ({umbracoApi, umbracoUi}) await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); await umbracoUi.documentType.isDocumentTreeItemVisible(documentTypeName, true); const documentTypeDataNew = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeDataNew.alias).toBe(newAlias); @@ -134,8 +126,7 @@ test('can add an icon for a document type', {tag: '@smoke'}, async ({umbracoApi, await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.icon).toBe(bugIcon); await umbracoUi.documentType.isDocumentTreeItemVisible(documentTypeName, true); @@ -153,7 +144,6 @@ test('can delete a document type', {tag: '@smoke'}, async ({umbracoApi, umbracoU await umbracoUi.documentType.clickDeleteAndConfirmButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeDeleted(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeFalsy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeCollectionWorkspace.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeCollectionWorkspace.spec.ts index d5fdd190e1..3001fe9c99 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeCollectionWorkspace.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeCollectionWorkspace.spec.ts @@ -26,8 +26,7 @@ test('can create a document type using create options', async ({umbracoApi, umbr await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); // Check if the created document type is displayed in the collection view and has correct icon await umbracoUi.documentType.clickDocumentTypesMenu(); @@ -39,7 +38,7 @@ test('can create a document type with a template using create options', async ({ // Arrange await umbracoApi.template.ensureNameNotExists(documentTypeName); await umbracoUi.documentType.clickDocumentTypesMenu(); - + // Act await umbracoUi.documentType.clickCreateActionWithOptionName('Document Type with Template'); await umbracoUi.documentType.enterDocumentTypeName(documentTypeName); @@ -47,8 +46,7 @@ test('can create a document type with a template using create options', async ({ // Assert // Checks if both the success notification for document Types and the template are visible - //await umbracoUi.documentType.doesSuccessNotificationsHaveCount(2); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); // Checks if the documentType contains the template const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); const templateData = await umbracoApi.template.getByName(documentTypeName); @@ -66,15 +64,14 @@ test('can create a document type with a template using create options', async ({ test('can create a element type using create options', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoUi.documentType.clickDocumentTypesMenu(); - + // Act await umbracoUi.documentType.clickCreateActionWithOptionName('Element Type'); await umbracoUi.documentType.enterDocumentTypeName(documentTypeName); await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); // Checks if the isElement is true const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); @@ -88,15 +85,14 @@ test('can create a element type using create options', async ({umbracoApi, umbra test('can create a document type folder using create options', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoUi.documentType.clickDocumentTypesMenu(); - + // Act await umbracoUi.documentType.clickCreateActionWithOptionName('Folder'); await umbracoUi.documentType.enterFolderName(documentFolderName); await umbracoUi.documentType.clickCreateFolderButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); const folder = await umbracoApi.documentType.getByName(documentFolderName); expect(folder.name).toBe(documentFolderName); // Check if the created document type folder is displayed in the collection view and has correct icon @@ -116,8 +112,7 @@ test('can create a document type in a folder using create options', async ({umbr await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); // Check if the created document type is displayed in the collection view and has correct icon await umbracoUi.documentType.goToDocumentType(documentFolderName); @@ -130,16 +125,14 @@ test('can create a document type with a template in a folder using create option await umbracoApi.template.ensureNameNotExists(documentTypeName); await umbracoApi.documentType.createFolder(documentFolderName); await umbracoUi.documentType.goToDocumentType(documentFolderName); - + // Act await umbracoUi.documentType.clickCreateActionWithOptionName('Document Type with Template'); await umbracoUi.documentType.enterDocumentTypeName(documentTypeName); await umbracoUi.documentType.clickSaveButton(); // Assert - // Checks if both the success notification for document Types and the template are visible - //await umbracoUi.documentType.doesSuccessNotificationsHaveCount(2); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); // Checks if the documentType contains the template const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); const templateData = await umbracoApi.template.getByName(documentTypeName); @@ -158,15 +151,14 @@ test('can create a element type in a folder using create options', async ({umbra // Arrange await umbracoApi.documentType.createFolder(documentFolderName); await umbracoUi.documentType.goToDocumentType(documentFolderName); - + // Act await umbracoUi.documentType.clickCreateActionWithOptionName('Element Type'); await umbracoUi.documentType.enterDocumentTypeName(documentTypeName); await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); // Checks if the isElement is true const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); @@ -183,15 +175,14 @@ test('can create a document type folder in a folder using create options', async await umbracoApi.documentType.ensureNameNotExists(childFolderName); await umbracoApi.documentType.createFolder(documentFolderName); await umbracoUi.documentType.goToDocumentType(documentFolderName); - + // Act await umbracoUi.documentType.clickCreateActionWithOptionName('Folder'); await umbracoUi.documentType.enterFolderName(childFolderName); await umbracoUi.documentType.clickCreateFolderButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); const folder = await umbracoApi.documentType.getByName(childFolderName); expect(folder.name).toBe(childFolderName); // Check if the created document type folder is displayed in the collection view and has correct icon diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeDesignTab.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeDesignTab.spec.ts index 031b8fa364..72a5936b0c 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeDesignTab.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeDesignTab.spec.ts @@ -28,8 +28,7 @@ test('can add a property to a document type', {tag: '@smoke'}, async ({umbracoAp await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); const dataType = await umbracoApi.dataType.getByName(dataTypeName); @@ -50,8 +49,7 @@ test('can update a property in a document type', {tag: '@smoke'}, async ({umbrac await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); const dataType = await umbracoApi.dataType.getByName(newDataTypeName); @@ -72,8 +70,7 @@ test('can update group name in a document type', async ({umbracoApi, umbracoUi}) await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.containers[0].name).toBe(newGroupName); @@ -92,8 +89,7 @@ test('can delete a group in a document type', {tag: '@smoke'}, async ({umbracoAp await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.containers.length).toBe(0); expect(documentTypeData.properties.length).toBe(0); @@ -112,8 +108,7 @@ test('can delete a tab in a document type', async ({umbracoApi, umbracoUi}) => { await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.containers.length).toBe(0); @@ -131,8 +126,7 @@ test('can delete a property editor in a document type', {tag: '@smoke'}, async ( await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.properties.length).toBe(0); @@ -153,8 +147,7 @@ test('can create a document type with a property in a tab', {tag: '@smoke'}, asy await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(await umbracoApi.documentType.doesTabContainCorrectPropertyEditorInGroup(documentTypeName, dataTypeName, documentTypeData.properties[0].dataType.id, tabName, groupName)).toBeTruthy(); @@ -177,8 +170,7 @@ test('can create a document type with multiple groups', async ({umbracoApi, umbr await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); expect(await umbracoApi.documentType.doesGroupContainCorrectPropertyEditor(documentTypeName, dataTypeName, dataTypeData.id, groupName)).toBeTruthy(); expect(await umbracoApi.documentType.doesGroupContainCorrectPropertyEditor(documentTypeName, secondDataTypeName, secondDataType.id, secondGroupName)).toBeTruthy(); @@ -204,8 +196,7 @@ test('can create a document type with multiple tabs', async ({umbracoApi, umbrac await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); expect(await umbracoApi.documentType.doesTabContainCorrectPropertyEditorInGroup(documentTypeName, dataTypeName, dataTypeData.id, tabName, groupName)).toBeTruthy(); expect(await umbracoApi.documentType.doesTabContainCorrectPropertyEditorInGroup(documentTypeName, secondDataTypeName, secondDataType.id, secondTabName, secondGroupName)).toBeTruthy(); @@ -222,15 +213,13 @@ test('can create a document type with a composition', {tag: '@smoke'}, async ({u // Act await umbracoUi.documentType.goToDocumentType(documentTypeName); - await umbracoUi.waitForTimeout(500); await umbracoUi.documentType.clickCompositionsButton(); await umbracoUi.documentType.clickModalMenuItemWithName(compositionDocumentTypeName); await umbracoUi.documentType.clickSubmitButton(); await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); expect(umbracoUi.documentType.doesGroupHaveValue(groupName)).toBeTruthy(); // Checks if the composition in the document type is correct const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); @@ -259,8 +248,7 @@ test('can remove a composition from a document type', async ({umbracoApi, umbrac await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); await umbracoUi.documentType.isGroupVisible(groupName, false); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.compositions).toEqual([]); @@ -286,8 +274,7 @@ test('can reorder groups in a document type', async ({umbracoApi, umbracoUi}) => await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); // Since we swapped sorting order, the firstGroupValue should have sortOrder 1 and the secondGroupValue should have sortOrder 0 expect(await umbracoApi.documentType.doesDocumentTypeGroupNameContainCorrectSortOrder(documentTypeName, secondGroupValue, 0)).toBeTruthy(); expect(await umbracoApi.documentType.doesDocumentTypeGroupNameContainCorrectSortOrder(documentTypeName, firstGroupValue, 1)).toBeTruthy(); @@ -312,8 +299,7 @@ test.skip('can reorder properties in a document type', async ({umbracoApi, umbra await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.properties[0].name).toBe(dataTypeNameTwo); expect(documentTypeData.properties[1].name).toBe(dataTypeName); @@ -337,8 +323,7 @@ test.skip('can reorder tabs in a document type', {tag: '@smoke'}, async ({umbrac await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.documentType.doesDocumentTypeTabNameContainCorrectSortOrder(documentTypeName, secondTabName, 0)).toBeTruthy(); expect(await umbracoApi.documentType.doesDocumentTypeTabNameContainCorrectSortOrder(documentTypeName, tabName, 1)).toBeTruthy(); }); @@ -358,8 +343,7 @@ test('can add a description to a property in a document type', async ({umbracoAp await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); await expect(umbracoUi.documentType.enterDescriptionTxt).toBeVisible(); expect(umbracoUi.documentType.doesDescriptionHaveValue(descriptionText)).toBeTruthy(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); @@ -380,8 +364,7 @@ test('can set is mandatory for a property in a document type', {tag: '@smoke'}, await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.properties[0].validation.mandatory).toBeTruthy(); }); @@ -404,8 +387,7 @@ test('can enable validation for a property in a document type', async ({umbracoA await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.properties[0].validation.regEx).toBe(regex); expect(documentTypeData.properties[0].validation.regExMessage).toBe(regexMessage); @@ -425,8 +407,7 @@ test('can allow vary by culture for a property in a document type', {tag: '@smok await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.properties[0].variesByCulture).toBeTruthy(); }); @@ -445,8 +426,7 @@ test('can set appearance to label on top for a property in a document type', asy await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.properties[0].appearance.labelOnTop).toBeTruthy(); }); @@ -466,8 +446,7 @@ test('can add a block list property with inline editing mode to a document type' await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.documentType.doesNameExist(documentTypeName)).toBeTruthy(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); const blockListDataTypeData = await umbracoApi.dataType.getByName(blockListDataTypeName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeFolder.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeFolder.spec.ts index e956c58e8f..691d930511 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeFolder.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeFolder.spec.ts @@ -22,8 +22,7 @@ test('can create a empty document type folder', {tag: '@smoke'}, async ({umbraco await umbracoUi.documentType.clickCreateFolderButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); const folder = await umbracoApi.documentType.getByName(documentFolderName); expect(folder.name).toBe(documentFolderName); // Checks if the folder is in the root @@ -42,8 +41,7 @@ test('can delete a document type folder', {tag: '@smoke'}, async ({umbracoApi, u await umbracoUi.documentType.clickDeleteAndConfirmButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeDeleted(); await umbracoApi.documentType.doesNameExist(documentFolderName); await umbracoUi.documentType.isDocumentTreeItemVisible(documentFolderName, false); }); @@ -61,11 +59,9 @@ test('can rename a document type folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.documentType.clickRenameActionMenuOption(); await umbracoUi.documentType.enterFolderName(documentFolderName); await umbracoUi.documentType.clickConfirmRenameButton(); - await umbracoUi.waitForTimeout(500); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeRenamed(); const folder = await umbracoApi.documentType.getByName(documentFolderName); expect(folder.name).toBe(documentFolderName); await umbracoUi.documentType.isDocumentTreeItemVisible(oldFolderName, false); @@ -88,8 +84,7 @@ test('can create a document type folder in a folder', async ({umbracoApi, umbrac await umbracoUi.documentType.clickCreateFolderButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); const folder = await umbracoApi.documentType.getByName(childFolderName); expect(folder.name).toBe(childFolderName); // Checks if the parentFolder contains the ChildFolder as a child @@ -120,8 +115,7 @@ test('can create a folder in a folder in a folder', {tag: '@smoke'}, async ({umb await umbracoUi.documentType.clickCreateFolderButton(); // Assert - //await umbracoUi.documentType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.waitForDocumentTypeToBeCreated(); await umbracoUi.documentType.reloadTree(parentFolderName); await umbracoUi.documentType.isDocumentTreeItemVisible(documentFolderName); const grandParentChildren = await umbracoApi.documentType.getChildren(grandParentFolderId); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeSettingsTab.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeSettingsTab.spec.ts index f9809aef14..0b4f856806 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeSettingsTab.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeSettingsTab.spec.ts @@ -24,8 +24,7 @@ test('can add allow vary by culture for a document type', {tag: '@smoke'}, async await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.isSuccessNotificationVisible(); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.variesByCulture).toBeTruthy(); }); @@ -43,8 +42,7 @@ test.skip('can add allow segmentation for a document type', async ({umbracoApi, await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.isSuccessNotificationVisible(); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.variesBySegment).toBeTruthy(); }); @@ -61,8 +59,7 @@ test('can set is an element type for a document type', {tag: '@smoke'}, async ({ await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.isSuccessNotificationVisible(); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.isElement).toBeTruthy(); }); @@ -80,8 +77,7 @@ test('can disable history cleanup for a document type', async ({umbracoApi, umbr await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.isSuccessNotificationVisible(); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.cleanup.preventCleanup).toBeTruthy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeStructureTab.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeStructureTab.spec.ts index 0a74181e39..b3b6ef65a4 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeStructureTab.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeStructureTab.spec.ts @@ -24,8 +24,7 @@ test('can add allow as root to a document type', {tag: '@smoke'}, async ({umbrac await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.isSuccessNotificationVisible(); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.allowedAsRoot).toBeTruthy(); }); @@ -44,8 +43,7 @@ test('can add an allowed child node to a document type', {tag: '@smoke'}, async await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.isSuccessNotificationVisible(); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.allowedDocumentTypes[0].documentType.id).toBe(documentTypeData.id); }); @@ -66,8 +64,7 @@ test('can remove an allowed child node from a document type', async ({umbracoApi await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.isSuccessNotificationVisible(); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.allowedDocumentTypes.length).toBe(0); @@ -91,8 +88,7 @@ test('can configure a collection for a document type', async ({umbracoApi, umbra await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.isSuccessNotificationVisible(); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.collection.id).toEqual(collectionDataTypeId); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeTemplatesTab.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeTemplatesTab.spec.ts index 61b09cf179..8d0aeb57b7 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeTemplatesTab.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeTemplatesTab.spec.ts @@ -31,8 +31,7 @@ test('can add an allowed template to a document type', {tag: '@smoke'}, async ({ await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.isSuccessNotificationVisible(); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.allowedTemplates[0].id).toBe(templateId); }); @@ -52,8 +51,7 @@ test('can set an allowed template as default for document type', async ({umbraco await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.isSuccessNotificationVisible(); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.allowedTemplates).toHaveLength(2); expect(documentTypeData.defaultTemplate.id).toBe(secondTemplateId); @@ -75,8 +73,7 @@ test.skip('can remove an allowed template from a document type', async ({umbraco await umbracoUi.documentType.clickSaveButton(); // Assert - //await umbracoUi.documentType.isSuccessNotificationVisible(); - await umbracoUi.documentType.isErrorNotificationVisible(false); + await umbracoUi.documentType.isSuccessStateVisibleForSaveButton(); const documentTypeData = await umbracoApi.documentType.getByName(documentTypeName); expect(documentTypeData.allowedTemplates).toHaveLength(0); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Language/Language.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Language/Language.spec.ts index 9a187be235..43a10231b0 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Language/Language.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Language/Language.spec.ts @@ -25,8 +25,7 @@ test('can add language', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { await umbracoUi.language.clickSaveButton(); // Assert - //await umbracoUi.language.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.language.isErrorNotificationVisible(false); + await umbracoUi.language.waitForLanguageToBeCreated(); expect(await umbracoApi.language.doesExist(isoCode)).toBeTruthy(); // Verify the created language displays in the list await umbracoUi.language.clickLanguagesMenu(); @@ -45,8 +44,7 @@ test('can update default language option', {tag: '@smoke'}, async ({umbracoApi, await umbracoUi.language.clickSaveButton(); // Assert - //await umbracoUi.language.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.language.isErrorNotificationVisible(false); + await umbracoUi.language.isSuccessStateVisibleForSaveButton(); const languageData = await umbracoApi.language.get(isoCode); expect(languageData.isDefault).toBe(true); @@ -69,8 +67,7 @@ test('can update mandatory language option', async ({umbracoApi, umbracoUi}) => await umbracoUi.language.clickSaveButton(); // Assert - //await umbracoUi.language.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.language.isErrorNotificationVisible(false); + await umbracoUi.language.isSuccessStateVisibleForSaveButton(); const languageData = await umbracoApi.language.get(isoCode); expect(languageData.isMandatory).toBe(true); }); @@ -85,8 +82,7 @@ test('can delete language', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => await umbracoUi.language.removeLanguageByName(languageName); // Assert - //await umbracoUi.language.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.language.isErrorNotificationVisible(false); + await umbracoUi.language.waitForLanguageToBeDeleted(); expect(await umbracoApi.language.doesExist(isoCode)).toBeFalsy(); await umbracoUi.language.isLanguageNameVisible(languageName, false); }); @@ -103,8 +99,7 @@ test('can remove fallback language', async ({umbracoApi, umbracoUi}) => { await umbracoUi.language.clickSaveButton(); // Act - //await umbracoUi.language.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.language.isErrorNotificationVisible(false); + await umbracoUi.language.isSuccessStateVisibleForSaveButton(); const languageData = await umbracoApi.language.get(isoCode); expect(languageData.fallbackIsoCode).toBeFalsy(); }); @@ -122,8 +117,7 @@ test('can add fallback language', async ({umbracoApi, umbracoUi}) => { await umbracoUi.language.clickSaveButton(); // Act - //await umbracoUi.language.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.language.isErrorNotificationVisible(false); + await umbracoUi.language.isSuccessStateVisibleForSaveButton(); const languageData = await umbracoApi.language.get(isoCode); expect(languageData.fallbackIsoCode).toBe(defaultLanguageIsoCode); }); @@ -140,5 +134,6 @@ test('cannot add a language with duplicate ISO code', async ({umbracoApi, umbrac await umbracoUi.language.clickSaveButton(); // Assert + await umbracoUi.language.isFailedStateButtonVisible(); await umbracoUi.language.doesErrorNotificationHaveText(NotificationConstantHelper.error.duplicateISOcode); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaType.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaType.spec.ts index 3849bae287..e1b07df0c1 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaType.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaType.spec.ts @@ -22,9 +22,9 @@ test('can create a media type', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.waitForMediaTypeToBeCreated(); expect(await umbracoApi.mediaType.doesNameExist(mediaTypeName)).toBeTruthy(); + await umbracoUi.mediaType.isMediaTypeTreeItemVisible(mediaTypeName, true); }); test('can rename a media type', async ({umbracoApi, umbracoUi}) => { @@ -39,9 +39,10 @@ test('can rename a media type', async ({umbracoApi, umbracoUi}) => { await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.mediaType.doesNameExist(mediaTypeName)).toBeTruthy(); + await umbracoUi.mediaType.isMediaTypeTreeItemVisible(wrongName, false); + await umbracoUi.mediaType.isMediaTypeTreeItemVisible(mediaTypeName, true); }); test('can update the alias for a media type', async ({umbracoApi, umbracoUi}) => { @@ -58,8 +59,7 @@ test('can update the alias for a media type', async ({umbracoApi, umbracoUi}) => await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(mediaTypeData.alias).toBe(updatedAlias); }); @@ -76,8 +76,7 @@ test('can add an icon for a media type', {tag: '@smoke'}, async ({umbracoApi, um await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(mediaTypeData.icon).toBe(bugIcon); await umbracoUi.mediaType.isTreeItemVisible(mediaTypeName, true); @@ -94,7 +93,7 @@ test('can delete a media type', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) await umbracoUi.mediaType.clickConfirmToDeleteButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.waitForMediaTypeToBeDeleted(); expect(await umbracoApi.mediaType.doesNameExist(mediaTypeName)).toBeFalsy(); + await umbracoUi.mediaType.isMediaTypeTreeItemVisible(mediaTypeName, false); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeCollectionWorkspace.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeCollectionWorkspace.spec.ts index e26954b3c8..81b97d774e 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeCollectionWorkspace.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeCollectionWorkspace.spec.ts @@ -26,13 +26,13 @@ test('can create a media type using create options', async ({umbracoApi, umbraco await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.waitForMediaTypeToBeCreated(); expect(await umbracoApi.mediaType.doesNameExist(mediaTypeName)).toBeTruthy(); // Check if the created media type is displayed in the collection view and has correct icon await umbracoUi.mediaType.clickMediaTypesMenu(); await umbracoUi.mediaType.doesCollectionTreeItemTableRowHaveName(mediaTypeName); await umbracoUi.mediaType.doesCollectionTreeItemTableRowHaveIcon(mediaTypeName, 'icon-picture'); + await umbracoUi.mediaType.isMediaTypeTreeItemVisible(mediaTypeName); }); test('can create a media type folder using create options', async ({umbracoApi, umbracoUi}) => { @@ -45,8 +45,7 @@ test('can create a media type folder using create options', async ({umbracoApi, await umbracoUi.mediaType.clickConfirmCreateFolderButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.waitForMediaTypeToBeCreated(); expect(await umbracoApi.mediaType.doesNameExist(mediaTypeFolderName)).toBeTruthy(); // Check if the created media type is displayed in the collection view and has correct icon await umbracoUi.mediaType.clickMediaTypesMenu(); @@ -65,8 +64,7 @@ test('can create a media type in a folder using create options', async ({umbraco await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.waitForMediaTypeToBeCreated(); expect(await umbracoApi.mediaType.doesNameExist(mediaTypeName)).toBeTruthy(); // Check if the created media type is displayed in the collection view and has correct icon await umbracoUi.mediaType.goToMediaType(mediaTypeFolderName); @@ -87,8 +85,7 @@ test('can create a media type folder in a folder using create options', async ({ await umbracoUi.mediaType.clickConfirmCreateFolderButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.waitForMediaTypeToBeCreated(); expect(await umbracoApi.mediaType.doesNameExist(childFolderName)).toBeTruthy(); // Check if the created media type is displayed in the collection view and has correct icon await umbracoUi.mediaType.doesCollectionTreeItemTableRowHaveName(childFolderName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeDesignTab.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeDesignTab.spec.ts index 60d3f7bf6c..f3e96e4f28 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeDesignTab.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeDesignTab.spec.ts @@ -28,8 +28,7 @@ test('can create a media type with a property', {tag: '@smoke'}, async ({umbraco await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.mediaType.doesNameExist(mediaTypeName)).toBeTruthy(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); const dataType = await umbracoApi.dataType.getByName(dataTypeName); @@ -49,8 +48,7 @@ test('can update a property in a media type', async ({umbracoApi, umbracoUi}) => await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); const dataType = await umbracoApi.dataType.getByName(newDataTypeName); // Checks if the correct property was added to the media type @@ -69,8 +67,7 @@ test('can update group name in a media type', async ({umbracoApi, umbracoUi}) => await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(mediaTypeData.containers[0].name).toBe(updatedGroupName); }); @@ -86,8 +83,7 @@ test('can delete a property in a media type', async ({umbracoApi, umbracoUi}) => await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(mediaTypeData.properties.length).toBe(0); }); @@ -106,8 +102,7 @@ test('can add a description to property in a media type', {tag: '@smoke'}, async await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); await expect(umbracoUi.mediaType.enterDescriptionTxt).toBeVisible(); expect(umbracoUi.mediaType.doesDescriptionHaveValue(descriptionText)).toBeTruthy(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); @@ -127,8 +122,7 @@ test('can set a property as mandatory in a media type', {tag: '@smoke'}, async ( await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(mediaTypeData.properties[0].validation.mandatory).toBeTruthy(); }); @@ -150,8 +144,7 @@ test('can set up validation for a property in a media type', async ({umbracoApi, await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(mediaTypeData.properties[0].validation.regEx).toBe(regex); expect(mediaTypeData.properties[0].validation.regExMessage).toBe(regexMessage); @@ -170,8 +163,7 @@ test('can set appearance as label on top for property in a media type', async ({ await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(mediaTypeData.properties[0].appearance.labelOnTop).toBeTruthy(); }); @@ -188,8 +180,7 @@ test('can delete a group in a media type', {tag: '@smoke'}, async ({umbracoApi, await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(mediaTypeData.containers.length).toBe(0); expect(mediaTypeData.properties.length).toBe(0); @@ -203,14 +194,11 @@ test('can create a media type with a property in a tab', {tag: '@smoke'}, async await umbracoUi.mediaType.goToMediaType(mediaTypeName); await umbracoUi.mediaType.clickAddTabButton(); await umbracoUi.mediaType.enterTabName(tabName); - // TODO: We need to wait to make sure the Tab name has been entered, otherwise the test can be flaky and the property editor is not added to the correctly - await umbracoUi.waitForTimeout(500); await umbracoUi.mediaType.addPropertyEditor(dataTypeName); await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); // Checks if the media type has the correct tab and property const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(await umbracoApi.mediaType.doesTabContainerCorrectPropertyEditor(mediaTypeName, tabName, mediaTypeData.properties[0].dataType.id)).toBeTruthy(); @@ -232,8 +220,7 @@ test('can create a media type with multiple groups', {tag: '@smoke'}, async ({um await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.mediaType.doesNameExist(mediaTypeName)).toBeTruthy(); expect(await umbracoApi.mediaType.doesGroupContainCorrectPropertyEditor(mediaTypeName, dataTypeName, dataTypeData.id, groupName)).toBeTruthy(); expect(await umbracoApi.mediaType.doesGroupContainCorrectPropertyEditor(mediaTypeName, secondDataTypeName, secondDataType.id, secondGroupName)).toBeTruthy(); @@ -258,8 +245,7 @@ test('can create a media type with multiple tabs', async ({umbracoApi, umbracoUi await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.mediaType.doesNameExist(mediaTypeName)).toBeTruthy(); expect(await umbracoApi.mediaType.doesTabContainCorrectPropertyEditorInGroup(mediaTypeName, dataTypeName, dataTypeData.id, tabName, groupName)).toBeTruthy(); expect(await umbracoApi.mediaType.doesTabContainCorrectPropertyEditorInGroup(mediaTypeName, secondDataTypeName, secondDataType.id, secondTabName, secondGroupName)).toBeTruthy(); @@ -277,8 +263,7 @@ test('can delete a tab from a media type', async ({umbracoApi, umbracoUi}) => { await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.mediaType.doesNameExist(mediaTypeName)).toBeTruthy(); }); @@ -299,8 +284,7 @@ test('can create a media type with a composition', async ({umbracoApi, umbracoUi await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); expect(umbracoUi.mediaType.doesGroupHaveValue(groupName)).toBeTruthy(); // Checks if the composition in the media type is correct const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); @@ -310,7 +294,8 @@ test('can create a media type with a composition', async ({umbracoApi, umbracoUi await umbracoApi.mediaType.ensureNameNotExists(compositionMediaTypeName); }); -test('can reorder groups in a media type', async ({umbracoApi, umbracoUi}) => { +// TODO can be flaky +test.fixme('can reorder groups in a media type', async ({umbracoApi, umbracoUi}) => { // Arrange const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName); const secondGroupName = 'SecondGroup'; @@ -326,11 +311,10 @@ test('can reorder groups in a media type', async ({umbracoApi, umbracoUi}) => { await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); // Since we swapped sorting order, the firstGroupValue should have sortOrder 1 and the secondGroupValue should have sortOrder 0 - expect(await umbracoApi.mediaType.doesMediaTypeGroupNameContainCorrectSortOrder(mediaTypeName, secondGroupValue, 0)).toBeTruthy(); - expect(await umbracoApi.mediaType.doesMediaTypeGroupNameContainCorrectSortOrder(mediaTypeName, firstGroupValue, 1)).toBeTruthy(); + // expect(await umbracoApi.mediaType.doesMediaTypeGroupNameContainCorrectSortOrder(mediaTypeName, secondGroupValue, 0)).toBeTruthy(); + // expect(await umbracoApi.mediaType.doesMediaTypeGroupNameContainCorrectSortOrder(mediaTypeName, firstGroupValue, 1)).toBeTruthy(); }); test('can reorder properties in a media type', async ({umbracoApi, umbracoUi}) => { @@ -350,8 +334,7 @@ test('can reorder properties in a media type', async ({umbracoApi, umbracoUi}) = await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(mediaTypeData.properties[0].name).toBe(dataTypeNameTwo); }); @@ -373,8 +356,7 @@ test.skip('can reorder tabs in a media type', async ({umbracoApi, umbracoUi}) => await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.mediaType.doesMediaTypeTabNameContainCorrectSortOrder(mediaTypeName, secondTabName, 0)).toBeTruthy(); expect(await umbracoApi.mediaType.doesMediaTypeTabNameContainCorrectSortOrder(mediaTypeName, tabName, 1)).toBeTruthy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeFolder.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeFolder.spec.ts index 30109d90d8..f249e10f23 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeFolder.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeFolder.spec.ts @@ -22,13 +22,11 @@ test('can create a empty media type folder', async ({umbracoApi, umbracoUi}) => await umbracoUi.mediaType.clickConfirmCreateFolderButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.waitForMediaTypeToBeCreated(); const folder = await umbracoApi.mediaType.getByName(mediaTypeFolderName); expect(folder.name).toBe(mediaTypeFolderName); // Checks if the folder is in the root - await umbracoUi.mediaType.clickRootFolderCaretButton(); - await umbracoUi.mediaType.isTreeItemVisible(mediaTypeFolderName, true); + await umbracoUi.mediaType.isMediaTypeTreeItemVisible(mediaTypeFolderName, true); }); test('can delete a media type folder', async ({umbracoApi, umbracoUi}) => { @@ -41,9 +39,9 @@ test('can delete a media type folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.mediaType.clickDeleteAndConfirmButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.waitForMediaTypeToBeDeleted(); expect(await umbracoApi.mediaType.doesNameExist(mediaTypeFolderName)).toBeFalsy(); + await umbracoUi.mediaType.isMediaTypeTreeItemVisible(mediaTypeFolderName, false); }); test('can rename a media type folder', async ({umbracoApi, umbracoUi}) => { @@ -61,10 +59,11 @@ test('can rename a media type folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.mediaType.clickConfirmRenameButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.waitForMediaTypeToBeRenamed(); const folder = await umbracoApi.mediaType.getByName(mediaTypeFolderName); expect(folder.name).toBe(mediaTypeFolderName); + await umbracoUi.mediaType.isMediaTypeTreeItemVisible(oldFolderName, false); + await umbracoUi.mediaType.isMediaTypeTreeItemVisible(mediaTypeFolderName, true); }); test('can create a media type folder in a folder', async ({umbracoApi, umbracoUi}) => { @@ -82,8 +81,7 @@ test('can create a media type folder in a folder', async ({umbracoApi, umbracoUi await umbracoUi.mediaType.clickConfirmCreateFolderButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.waitForMediaTypeToBeCreated(); await umbracoUi.mediaType.clickCaretButtonForName(mediaTypeFolderName); await umbracoUi.mediaType.isTreeItemVisible(childFolderName, true); const parentFolderChildren = await umbracoApi.mediaType.getChildren(parentFolderId); @@ -112,8 +110,7 @@ test('can create a media type folder in a folder in a folder', async ({umbracoAp await umbracoUi.mediaType.clickConfirmCreateFolderButton(); // Assert - //await umbracoUi.mediaType.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.waitForMediaTypeToBeCreated(); await umbracoUi.mediaType.clickCaretButtonForName(mediaTypeFolderName); await umbracoUi.mediaType.isTreeItemVisible(childFolderName, true); const grandParentFolderChildren = await umbracoApi.mediaType.getChildren(grandParentFolderId); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeStructureTab.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeStructureTab.spec.ts index 5410e830ec..0563a5b3a7 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeStructureTab.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/MediaType/MediaTypeStructureTab.spec.ts @@ -24,8 +24,7 @@ test('can create a media type with allow at root enabled', {tag: '@smoke'}, asyn await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(mediaTypeData.allowedAsRoot).toBeTruthy(); }); @@ -43,8 +42,7 @@ test('can create a media type with an allowed child node type', {tag: '@smoke'}, await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(mediaTypeData.allowedMediaTypes[0].mediaType.id).toBe(mediaTypeData.id); }); @@ -66,8 +64,7 @@ test('can create a media type with multiple allowed child nodes types', async ({ await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.mediaType.doesMediaTypeContainAllowedChildNodeIds(mediaTypeName, [mediaTypeId, secondMediaTypeId])).toBeTruthy(); // Clean @@ -89,8 +86,7 @@ test('can delete an allowed child note from a media type', {tag: '@smoke'}, asyn await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(childNodeName); expect(mediaTypeData.allowedMediaTypes.length).toBe(0); @@ -113,8 +109,7 @@ test('can configure a collection for a media type', async ({umbracoApi, umbracoU await umbracoUi.mediaType.clickSaveButton(); // Assert - //await umbracoUi.mediaType.isSuccessNotificationVisible(); - await umbracoUi.mediaType.isErrorNotificationVisible(false); + await umbracoUi.mediaType.isSuccessStateVisibleForSaveButton(); const mediaTypeData = await umbracoApi.mediaType.getByName(mediaTypeName); expect(mediaTypeData.collection.id).toEqual(collectionDataTypeId); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialView.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialView.spec.ts index 47d42fd27f..fb975529e6 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialView.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialView.spec.ts @@ -26,8 +26,7 @@ test('can create an empty partial view', {tag: '@smoke'}, async ({umbracoApi, um await umbracoUi.partialView.clickSaveButton(); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.waitForPartialViewToBeCreated(); expect(await umbracoApi.partialView.doesNameExist(partialViewFileName)).toBeTruthy(); // Verify the new partial view is displayed under the Partial Views section await umbracoUi.partialView.isPartialViewRootTreeItemVisible(partialViewFileName); @@ -47,8 +46,7 @@ test('can create a partial view from snippet', async ({umbracoApi, umbracoUi}) = await umbracoUi.partialView.clickSaveButton(); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.waitForPartialViewToBeCreated(); expect(await umbracoApi.partialView.doesExist(partialViewFileName)).toBeTruthy(); const partialViewData = await umbracoApi.partialView.getByName(partialViewFileName); @@ -82,7 +80,7 @@ test('can rename a partial view', {tag: '@smoke'}, async ({umbracoApi, umbracoUi await umbracoUi.partialView.rename(partialViewName); // Assert - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.waitForPartialViewToBeRenamed(); expect(await umbracoApi.partialView.doesNameExist(partialViewFileName)).toBeTruthy(); expect(await umbracoApi.partialView.doesNameExist(wrongPartialViewFileName)).toBeFalsy(); // Verify the old partial view is NOT displayed under the Partial Views section @@ -108,8 +106,7 @@ test('can update a partial view content', {tag: '@smoke'}, async ({umbracoApi, u await umbracoUi.partialView.clickSaveButton(); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.isSuccessStateVisibleForSaveButton(); const updatedPartialView = await umbracoApi.partialView.getByName(partialViewFileName); expect(updatedPartialView.content).toBe(updatedPartialViewContent); }); @@ -149,8 +146,7 @@ test.fixme('can use query builder with Order By statement for a partial view', a await umbracoUi.partialView.clickSaveButton(); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.isSuccessStateVisibleForSaveButton(); const updatedPartialView = await umbracoApi.partialView.getByName(partialViewFileName); expect(updatedPartialView.content).toBe(expectedTemplateContent); }); @@ -191,8 +187,7 @@ test.fixme('can use query builder with Where statement for a partial view', asyn await umbracoUi.partialView.clickSaveButton(); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.isSuccessStateVisibleForSaveButton(); const updatedPartialView = await umbracoApi.partialView.getByName(partialViewFileName); expect(updatedPartialView.content).toBe(expectedTemplateContent); }); @@ -213,8 +208,7 @@ test('can insert dictionary item into a partial view', async ({umbracoApi, umbra await umbracoUi.partialView.clickSaveButton(); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.isSuccessStateVisibleForSaveButton(); const partialViewData = await umbracoApi.partialView.getByName(partialViewFileName); expect(partialViewData.content).toBe(partialViewContent); }); @@ -233,8 +227,7 @@ test('can insert value into a partial view', async ({umbracoApi, umbracoUi}) => await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.isSuccessStateVisibleForSaveButton(); const partialViewData = await umbracoApi.partialView.getByName(partialViewFileName); expect(partialViewData.content).toBe(partialViewContent); }); @@ -250,8 +243,7 @@ test('can delete a partial view', {tag: '@smoke'}, async ({umbracoApi, umbracoUi await umbracoUi.partialView.clickDeleteAndConfirmButton(); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.waitForPartialViewToBeDeleted(); expect(await umbracoApi.partialView.doesExist(partialViewFileName)).toBeFalsy(); // Verify the partial view is NOT displayed under the Partial Views section await umbracoUi.partialView.clickRootFolderCaretButton(); @@ -295,7 +287,6 @@ test('cannot create a partial view with an empty name', async ({umbracoApi, umbr await umbracoUi.partialView.clickSaveButton(); // Assert - // TODO: Uncomment this when the front-end is ready. Currently there is no error displays. - // await umbracoUi.partialView.isErrorNotificationVisible(); + await umbracoUi.partialView.isFailedStateButtonVisible(); expect(await umbracoApi.partialView.doesNameExist(partialViewFileName)).toBeFalsy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialViewFolder.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialViewFolder.spec.ts index b3d9215036..21bb81e47b 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialViewFolder.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialViewFolder.spec.ts @@ -23,8 +23,7 @@ test('can create a folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.partialView.createPartialViewFolder(folderName); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.waitForPartialViewToBeCreated(); expect(await umbracoApi.partialView.doesFolderExist(folderName)).toBeTruthy(); // Verify the partial view folder is displayed under the Partial Views section await umbracoUi.partialView.clickRootFolderCaretButton(); @@ -43,8 +42,7 @@ test('can delete a folder', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => await umbracoUi.partialView.clickDeleteAndConfirmButton(); // Assert - //await umbracoUi.partialView.isSuccessNotificationVisible(); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.waitForPartialViewToBeDeleted(); expect(await umbracoApi.partialView.doesFolderExist(folderName)).toBeFalsy(); // Verify the partial view folder is NOT displayed under the Partial Views section await umbracoUi.partialView.clickRootFolderCaretButton(); @@ -67,8 +65,7 @@ test('can create a partial view in a folder', async ({umbracoApi, umbracoUi}) => await umbracoUi.partialView.clickSaveButton(); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.waitForPartialViewToBeCreated(); const childrenData = await umbracoApi.partialView.getChildren(folderPath); expect(childrenData[0].name).toEqual(partialViewFileName); // Verify the partial view is displayed in the folder under the Partial Views section @@ -97,8 +94,7 @@ test('can create a partial view in a folder in a folder', async ({umbracoApi, um await umbracoUi.partialView.clickSaveButton(); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.waitForPartialViewToBeCreated(); const childFolderChildrenData = await umbracoApi.partialView.getChildren(childFolderPath); expect(childFolderChildrenData[0].name).toEqual(partialViewFileName); @@ -118,8 +114,7 @@ test('can create a folder in a folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.partialView.createPartialViewFolder(childFolderName); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.waitForPartialViewToBeCreated(); expect(await umbracoApi.partialView.doesNameExist(childFolderName)).toBeTruthy(); const partialViewChildren = await umbracoApi.partialView.getChildren('/' + folderName); expect(partialViewChildren[0].path).toBe('/' + folderName + '/' + childFolderName); @@ -142,8 +137,7 @@ test('can create a folder in a folder in a folder', {tag: '@smoke'}, async ({umb await umbracoUi.partialView.createPartialViewFolder(childOfChildFolderName); // Assert - //await umbracoUi.partialView.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.partialView.isErrorNotificationVisible(false); + await umbracoUi.partialView.waitForPartialViewToBeCreated(); expect(await umbracoApi.partialView.doesNameExist(childOfChildFolderName)).toBeTruthy(); const partialViewChildren = await umbracoApi.partialView.getChildren('/' + folderName + '/' + childFolderName); expect(partialViewChildren[0].path).toBe('/' + folderName + '/' + childFolderName + '/' + childOfChildFolderName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/Script.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/Script.spec.ts index 69611cd633..c9bf110c17 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/Script.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/Script.spec.ts @@ -25,8 +25,7 @@ test('can create a empty script', {tag: '@smoke'}, async ({umbracoApi, umbracoUi await umbracoUi.script.clickSaveButton(); // Assert - //await umbracoUi.script.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.script.isErrorNotificationVisible(false); + await umbracoUi.script.waitForScriptToBeCreated(); expect(await umbracoApi.script.doesNameExist(scriptName)).toBeTruthy(); await umbracoUi.script.isScriptRootTreeItemVisible(scriptName); }); @@ -45,8 +44,7 @@ test('can create a script with content', async ({umbracoApi, umbracoUi}) => { await umbracoUi.script.clickSaveButton(); // Assert - //await umbracoUi.script.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.script.isErrorNotificationVisible(false); + await umbracoUi.script.waitForScriptToBeCreated(); expect(await umbracoApi.script.doesNameExist(scriptName)).toBeTruthy(); const scriptData = await umbracoApi.script.getByName(scriptName); expect(scriptData.content).toBe(scriptContent); @@ -65,8 +63,7 @@ test('can update a script', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => await umbracoUi.script.clickSaveButton(); // Assert - //await umbracoUi.script.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.script.isErrorNotificationVisible(false); + await umbracoUi.script.isSuccessStateVisibleForSaveButton(); const updatedScript = await umbracoApi.script.get(scriptPath); expect(updatedScript.content).toBe(updatedScriptContent); }); @@ -82,8 +79,7 @@ test('can delete a script', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => await umbracoUi.script.clickDeleteAndConfirmButton(); // Assert - //await umbracoUi.script.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.script.isErrorNotificationVisible(false); + await umbracoUi.script.waitForScriptToBeDeleted(); expect(await umbracoApi.script.doesNameExist(scriptName)).toBeFalsy(); await umbracoUi.script.isScriptRootTreeItemVisible(scriptName, false, false); }); @@ -100,7 +96,7 @@ test('can rename a script', async ({umbracoApi, umbracoUi}) => { await umbracoUi.script.rename(scriptName); // Assert - await umbracoUi.script.isErrorNotificationVisible(false); + await umbracoUi.script.waitForScriptToBeRenamed(); expect(await umbracoApi.script.doesNameExist(scriptName)).toBeTruthy(); expect(await umbracoApi.script.doesNameExist(wrongScriptName)).toBeFalsy(); }); @@ -116,7 +112,6 @@ test('cannot create a script with an empty name', async ({umbracoApi, umbracoUi} await umbracoUi.script.clickSaveButton(); // Assert - // TODO: Uncomment this when the front-end is ready. Currently there is no error displays. - //await umbracoUi.script.isErrorNotificationVisible(); + await umbracoUi.script.isFailedStateButtonVisible(); expect(await umbracoApi.script.doesNameExist(scriptName)).toBeFalsy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/ScriptFolder.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/ScriptFolder.spec.ts index a7bd693303..4d28c618f6 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/ScriptFolder.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/ScriptFolder.spec.ts @@ -22,8 +22,7 @@ test('can create a folder', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => await umbracoUi.script.createScriptFolder(scriptFolderName); // Assert - //await umbracoUi.script.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.script.isErrorNotificationVisible(false); + await umbracoUi.script.waitForScriptToBeCreated(); expect(await umbracoApi.script.doesFolderExist(scriptFolderName)).toBeTruthy(); await umbracoUi.script.isScriptRootTreeItemVisible(scriptFolderName); }); @@ -39,8 +38,7 @@ test('can delete a folder', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => await umbracoUi.script.clickDeleteAndConfirmButton(); // Assert - //await umbracoUi.script.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.script.isErrorNotificationVisible(false); + await umbracoUi.script.waitForScriptToBeDeleted(); expect(await umbracoApi.script.doesFolderExist(scriptFolderName)).toBeFalsy(); await umbracoUi.script.isScriptRootTreeItemVisible(scriptFolderName, false, false); }); @@ -61,8 +59,7 @@ test('can create a script in a folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.script.clickSaveButton(); // Assert - //await umbracoUi.script.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.script.isErrorNotificationVisible(false); + await umbracoUi.script.waitForScriptToBeCreated(); expect(await umbracoApi.script.doesNameExist(scriptName)).toBeTruthy(); const scriptChildren = await umbracoApi.script.getChildren('/' + scriptFolderName); expect(scriptChildren[0].path).toBe('/' + scriptFolderName + '/' + scriptName); @@ -84,8 +81,7 @@ test('can create a folder in a folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.script.createScriptFolder(childFolderName); // Assert - //await umbracoUi.script.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.script.isErrorNotificationVisible(false); + await umbracoUi.script.waitForScriptToBeCreated(); expect(await umbracoApi.script.doesNameExist(childFolderName)).toBeTruthy(); const scriptChildren = await umbracoApi.script.getChildren('/' + scriptFolderName); expect(scriptChildren[0].path).toBe('/' + scriptFolderName + '/' + childFolderName); @@ -108,8 +104,7 @@ test('can create a folder in a folder in a folder', {tag: '@smoke'}, async ({umb await umbracoUi.script.createScriptFolder(childOfChildFolderName); // Assert - //await umbracoUi.script.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.script.isErrorNotificationVisible(false); + await umbracoUi.script.waitForScriptToBeCreated(); expect(await umbracoApi.script.doesNameExist(childOfChildFolderName)).toBeTruthy(); const scriptChildren = await umbracoApi.script.getChildren('/' + scriptFolderName + '/' + childFolderName); expect(scriptChildren[0].path).toBe('/' + scriptFolderName + '/' + childFolderName + '/' + childOfChildFolderName); @@ -134,8 +129,7 @@ test('can create a script in a folder in a folder', async ({umbracoApi, umbracoU await umbracoUi.script.clickSaveButton(); // Assert - //await umbracoUi.script.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.script.isErrorNotificationVisible(false); + await umbracoUi.script.waitForScriptToBeCreated(); expect(await umbracoApi.script.doesNameExist(scriptName)).toBeTruthy(); const scriptChildren = await umbracoApi.script.getChildren('/' + scriptFolderName + '/' + childFolderName); expect(scriptChildren[0].path).toBe('/' + scriptFolderName + '/' + childFolderName + '/' + scriptName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/Stylesheet.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/Stylesheet.spec.ts index 0e3e8caf8d..be9657a16e 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/Stylesheet.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/Stylesheet.spec.ts @@ -27,8 +27,7 @@ test('can create a empty stylesheet', {tag: '@smoke'}, async ({umbracoApi, umbra await umbracoUi.stylesheet.clickSaveButton(); // Assert - //await umbracoUi.stylesheet.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.stylesheet.isErrorNotificationVisible(false); + await umbracoUi.stylesheet.waitForStylesheetToBeCreated(); expect(await umbracoApi.stylesheet.doesNameExist(stylesheetName)).toBeTruthy(); await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(stylesheetName); }); @@ -47,8 +46,7 @@ test('can create a stylesheet with content', async ({umbracoApi, umbracoUi}) => await umbracoUi.stylesheet.clickSaveButton(); // Assert - //await umbracoUi.stylesheet.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.stylesheet.isErrorNotificationVisible(false); + await umbracoUi.stylesheet.waitForStylesheetToBeCreated(); expect(await umbracoApi.stylesheet.doesNameExist(stylesheetName)).toBeTruthy(); const stylesheetData = await umbracoApi.stylesheet.getByName(stylesheetName); expect(stylesheetData.content).toEqual(stylesheetContent); @@ -67,8 +65,7 @@ test.skip('can update a stylesheet', {tag: '@smoke'}, async ({umbracoApi, umbrac await umbracoUi.stylesheet.clickSaveButton(); // Assert - //await umbracoUi.stylesheet.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.stylesheet.isErrorNotificationVisible(false); + await umbracoUi.stylesheet.isSuccessStateVisibleForSaveButton(); const stylesheetData = await umbracoApi.stylesheet.getByName(stylesheetName); expect(stylesheetData.content).toEqual(stylesheetContent); }); @@ -84,8 +81,7 @@ test('can delete a stylesheet', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) await umbracoUi.stylesheet.clickDeleteAndConfirmButton(); // Assert - //await umbracoUi.stylesheet.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.stylesheet.isErrorNotificationVisible(false); + await umbracoUi.stylesheet.waitForStylesheetToBeDeleted(); expect(await umbracoApi.stylesheet.doesNameExist(stylesheetName)).toBeFalsy(); await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(stylesheetName, false, false); }); @@ -103,7 +99,7 @@ test('can rename a stylesheet', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) await umbracoUi.stylesheet.rename(stylesheetName); // Assert - await umbracoUi.stylesheet.isErrorNotificationVisible(false); + await umbracoUi.stylesheet.waitForStylesheetToBeRenamed(); expect(await umbracoApi.stylesheet.doesNameExist(stylesheetName)).toBeTruthy(); expect(await umbracoApi.stylesheet.doesNameExist(wrongStylesheetName)).toBeFalsy(); }); @@ -119,7 +115,6 @@ test('cannot create a stylesheet with an empty name', async ({umbracoApi, umbrac await umbracoUi.stylesheet.clickSaveButton(); // Assert - // TODO: Uncomment this when the front-end is ready. Currently there is no error displays. - //await umbracoUi.stylesheet.isErrorNotificationVisible(); + await umbracoUi.stylesheet.isFailedStateButtonVisible(); expect(await umbracoApi.stylesheet.doesNameExist(stylesheetName)).toBeFalsy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/StylesheetFolder.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/StylesheetFolder.spec.ts index 3d70ad63fa..8304a1de2e 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/StylesheetFolder.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/StylesheetFolder.spec.ts @@ -22,8 +22,7 @@ test('can create a folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.stylesheet.createStylesheetFolder(stylesheetFolderName); // Assert - //await umbracoUi.stylesheet.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.stylesheet.isErrorNotificationVisible(false); + await umbracoUi.stylesheet.waitForStylesheetToBeCreated(); expect(await umbracoApi.stylesheet.doesFolderExist(stylesheetFolderName)).toBeTruthy(); await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(stylesheetFolderName); }); @@ -39,8 +38,7 @@ test('can delete a folder', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => await umbracoUi.stylesheet.clickDeleteAndConfirmButton(); // Assert - //await umbracoUi.stylesheet.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.stylesheet.isErrorNotificationVisible(false); + await umbracoUi.stylesheet.waitForStylesheetToBeDeleted(); expect(await umbracoApi.stylesheet.doesFolderExist(stylesheetFolderName)).toBeFalsy(); await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(stylesheetFolderName, false, false); }); @@ -57,8 +55,7 @@ test('can create a folder in a folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.stylesheet.createStylesheetFolder(childFolderName); //Assert - //await umbracoUi.stylesheet.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.stylesheet.isErrorNotificationVisible(false); + await umbracoUi.stylesheet.waitForStylesheetToBeCreated(); expect(await umbracoApi.stylesheet.doesNameExist(childFolderName)).toBeTruthy(); const styleChildren = await umbracoApi.stylesheet.getChildren('/' + stylesheetFolderName); expect(styleChildren[0].path).toBe('/' + stylesheetFolderName + '/' + childFolderName); @@ -81,8 +78,7 @@ test('can create a folder in a folder in a folder', {tag: '@smoke'}, async ({umb await umbracoUi.stylesheet.createStylesheetFolder(childOfChildFolderName); // Assert - //await umbracoUi.stylesheet.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.stylesheet.isErrorNotificationVisible(false); + await umbracoUi.stylesheet.waitForStylesheetToBeCreated(); expect(await umbracoApi.stylesheet.doesNameExist(childOfChildFolderName)).toBeTruthy(); const styleChildren = await umbracoApi.stylesheet.getChildren('/' + stylesheetFolderName + '/' + childFolderName); expect(styleChildren[0].path).toBe('/' + stylesheetFolderName + '/' + childFolderName + '/' + childOfChildFolderName); @@ -106,8 +102,7 @@ test('can create a stylesheet in a folder', async ({umbracoApi, umbracoUi}) => { await umbracoUi.stylesheet.clickSaveButton(); // Assert - //await umbracoUi.stylesheet.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.stylesheet.isErrorNotificationVisible(false); + await umbracoUi.stylesheet.waitForStylesheetToBeCreated(); expect(await umbracoApi.stylesheet.doesNameExist(stylesheetName)).toBeTruthy(); const stylesheetChildren = await umbracoApi.stylesheet.getChildren('/' + stylesheetFolderName); expect(stylesheetChildren[0].path).toBe('/' + stylesheetFolderName + '/' + stylesheetName); @@ -136,8 +131,7 @@ test('can create a stylesheet in a folder in a folder', async ({umbracoApi, umbr await umbracoUi.stylesheet.clickSaveButton(); // Assert - //await umbracoUi.stylesheet.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.stylesheet.isErrorNotificationVisible(false); + await umbracoUi.stylesheet.waitForStylesheetToBeCreated(); expect(await umbracoApi.stylesheet.doesNameExist(stylesheetName)).toBeTruthy(); const stylesheetChildren = await umbracoApi.stylesheet.getChildren('/' + stylesheetFolderName + '/' + childFolderName); expect(stylesheetChildren[0].path).toBe('/' + stylesheetFolderName + '/' + childFolderName + '/' + stylesheetName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Template/Templates.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Template/Templates.spec.ts index 6d6e36da83..bdca513e24 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Template/Templates.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Template/Templates.spec.ts @@ -24,8 +24,7 @@ test('can create a template', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) = await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.waitForTemplateToBeCreated(); expect(await umbracoApi.template.doesNameExist(templateName)).toBeTruthy(); await umbracoUi.template.isTemplateRootTreeItemVisible(templateName); }); @@ -44,8 +43,7 @@ test('can update content of a template', {tag: '@smoke'}, async ({umbracoApi, um await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.isSuccessStateVisibleForSaveButton(); // Checks if the template was updated const updatedTemplate = await umbracoApi.template.getByName(templateName); expect(updatedTemplate.content).toBe(updatedTemplateContent); @@ -65,8 +63,7 @@ test('can rename a template', async ({umbracoApi, umbracoUi}) => { await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.isSuccessStateVisibleForSaveButton(); const templateData = await umbracoApi.template.get(templateId); expect(templateData.name).toBe(templateName); }); @@ -82,8 +79,7 @@ test('can delete a template', async ({umbracoApi, umbracoUi}) => { await umbracoUi.template.clickDeleteAndConfirmButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.waitForTemplateToBeDeleted(); await umbracoUi.template.reloadTemplateTree(); expect(await umbracoApi.template.doesNameExist(templateName)).toBeFalsy(); await umbracoUi.template.isTemplateRootTreeItemVisible(templateName, false, false); @@ -104,8 +100,7 @@ test('can set a template as master template', async ({umbracoApi, umbracoUi}) => await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.isSuccessStateVisibleForSaveButton(); await umbracoUi.template.isMasterTemplateNameVisible(templateName); // Checks if the childTemplate has the masterTemplate set const childTemplateData = await umbracoApi.template.getByName(childTemplateName); @@ -132,8 +127,7 @@ test('can remove a master template', async ({umbracoApi, umbracoUi}) => { await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.isSuccessStateVisibleForSaveButton(); await umbracoUi.template.isMasterTemplateNameVisible('No master'); const childTemplate = await umbracoApi.template.getByName(childTemplateName); expect(childTemplate.masterTemplate).toBe(null); @@ -176,8 +170,7 @@ test.skip('can use query builder with Order By statement for a template', async await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.isSuccessStateVisibleForSaveButton(); const templateData = await umbracoApi.template.getByName(templateName); expect(templateData.content).toBe(expectedTemplateContent); }); @@ -217,8 +210,7 @@ test.fixme('can use query builder with Where statement for a template', async ({ await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.isSuccessStateVisibleForSaveButton(); const templateData = await umbracoApi.template.getByName(templateName); expect(templateData.content).toBe(expectedTemplateContent); }); @@ -236,8 +228,7 @@ test('can insert sections - render child template into a template', async ({umbr await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.isSuccessStateVisibleForSaveButton(); const templateData = await umbracoApi.template.getByName(templateName); expect(templateData.content).toBe(templateContent); }); @@ -256,8 +247,7 @@ test('can insert sections - render a named section into a template', async ({umb await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.isSuccessStateVisibleForSaveButton(); const templateData = await umbracoApi.template.getByName(templateName); expect(templateData.content).toBe(templateContent); }); @@ -276,8 +266,7 @@ test('can insert sections - define a named section into a template', async ({umb await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.isSuccessNotificationVisible(); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.isSuccessStateVisibleForSaveButton(); const templateData = await umbracoApi.template.getByName(templateName); expect(templateData.content).toBe(templateContent); }); @@ -296,8 +285,7 @@ test('can insert dictionary item into a template', async ({umbracoApi, umbracoUi await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.isSuccessStateVisibleForSaveButton(); const templateData = await umbracoApi.template.getByName(templateName); expect(templateData.content).toBe(templateContent); @@ -320,8 +308,7 @@ test('can insert partial view into a template', async ({umbracoApi, umbracoUi}) await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.isSuccessStateVisibleForSaveButton(); const templateData = await umbracoApi.template.getByName(templateName); expect(templateData.content).toBe(templateContent); }); @@ -338,8 +325,7 @@ test('can insert value into a template', async ({umbracoApi, umbracoUi}) => { await umbracoUi.template.clickSaveButton(); // Assert - //await umbracoUi.template.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.template.isErrorNotificationVisible(false); + await umbracoUi.template.isSuccessStateVisibleForSaveButton(); const templateData = await umbracoApi.template.getByName(templateName); expect(templateData.content).toBe(templateContent); }); @@ -382,8 +368,6 @@ test('cannot create a template with an empty name', {tag: '@smoke'}, async ({umb await umbracoUi.template.clickSaveButton(); // Assert - // await umbracoUi.template.isErrorNotificationVisible(); - // TODO: Uncomment this when the front-end updates the error message - //await umbracoUi.template.doesErrorNotificationHaveText(NotificationConstantHelper.error.emptyName); + await umbracoUi.template.isFailedStateButtonVisible(); expect(await umbracoApi.template.doesNameExist(templateName)).toBeFalsy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/ContentWithTinyMCERichTextEditor.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/ContentWithTinyMCERichTextEditor.spec.ts index 963bf3b551..37bfc1c97f 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/ContentWithTinyMCERichTextEditor.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/ContentWithTinyMCERichTextEditor.spec.ts @@ -45,7 +45,6 @@ test('can create content with a rich text editor that has a stylesheet', async ( await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); expect(await umbracoApi.document.doesNameExist(documentName)).toBeTruthy(); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/DefaultPermissionsInContent.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/DefaultPermissionsInContent.spec.ts index 0c23b9283d..dc96923248 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/DefaultPermissionsInContent.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/DefaultPermissionsInContent.spec.ts @@ -193,8 +193,8 @@ test('can create content with create permission enabled', async ({umbracoApi, um await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.waitForContentToBeCreated(); + expect(await umbracoApi.document.doesNameExist(testDocumentName)).toBeTruthy(); }); test('can not create content with create permission disabled', async ({umbracoApi, umbracoUi}) => { @@ -351,8 +351,7 @@ test('can update content with update permission enabled', async ({umbracoApi, um await umbracoUi.content.clickSaveButton(); // Assert - //await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.content.isErrorNotificationVisible(false); + await umbracoUi.content.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.document.doesNameExist(testDocumentName)).toBeTruthy(); }); @@ -371,7 +370,8 @@ test.skip('can not update content with update permission disabled', async ({umbr await umbracoUi.content.isActionsMenuForNameVisible(rootDocumentName, false); }); -test('can duplicate content with duplicate permission enabled', async ({umbracoApi, umbracoUi}) => { +// Needs create permission to be enabled to duplicate content +test.fixme('can duplicate content with duplicate permission enabled', async ({umbracoApi, umbracoUi}) => { // Arrange const duplicatedContentName = rootDocumentName + ' (1)'; userGroupId = await umbracoApi.userGroup.createUserGroupWithDuplicatePermission(userGroupName); @@ -412,11 +412,12 @@ test('can not duplicate content with duplicate permission disabled', async ({umb await umbracoUi.content.isActionsMenuForNameVisible(rootDocumentName, false); }); -test('can move content with move to permission enabled', async ({umbracoApi, umbracoUi}) => { +// Needs create permission to be enabled to move content +test.fixme('can move content with move to permission enabled', async ({umbracoApi, umbracoUi}) => { // Arrange const moveToDocumentName = 'SecondRootDocument'; const moveToDocumentId = await umbracoApi.document.createDocumentWithTextContent(moveToDocumentName, rootDocumentTypeId, documentText, dataTypeName); - userGroupId = await umbracoApi.userGroup.createUserGroupWithMoveToPermission(userGroupName); + userGroupId = await umbracoApi.userGroup.createUserGroupWithMoveToPermission(userGroupName, true); await umbracoApi.user.setUserPermissions(testUser.name, testUser.email, testUser.password, userGroupId); testUserCookieAndToken = await umbracoApi.user.loginToUser(testUser.name, testUser.email, testUser.password); await umbracoUi.goToBackOffice(); @@ -455,7 +456,8 @@ test('can not move content with move to permission disabled', async ({umbracoApi await umbracoUi.content.isActionsMenuForNameVisible(rootDocumentName, false); }); -test('can sort children with sort children permission enabled', async ({umbracoApi, umbracoUi}) => { +// Needs a better way to assert +test.fixme('can sort children with sort children permission enabled', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.document.createDefaultDocumentWithParent(childDocumentTwoName, childDocumentTypeId, rootDocumentId); userGroupId = await umbracoApi.userGroup.createUserGroupWithSortChildrenPermission(userGroupName); @@ -475,11 +477,10 @@ test('can sort children with sort children permission enabled', async ({umbracoA await umbracoUi.content.clickSortButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.itemsSorted); // TODO: uncomment when it is not flaky - // await umbracoUi.content.clickCaretButtonForContentName(rootDocumentName); - // await umbracoUi.content.doesIndexDocumentInTreeContainName(rootDocumentName, childDocumentTwoName, 0); - // await umbracoUi.content.doesIndexDocumentInTreeContainName(rootDocumentName, childDocumentOneName, 1); + await umbracoUi.content.clickCaretButtonForContentName(rootDocumentName); + await umbracoUi.content.doesIndexDocumentInTreeContainName(rootDocumentName, childDocumentTwoName, 0); + await umbracoUi.content.doesIndexDocumentInTreeContainName(rootDocumentName, childDocumentOneName, 1); }); test('can not sort children with sort children permission disabled', async ({umbracoApi, umbracoUi}) => { @@ -499,6 +500,7 @@ test('can not sort children with sort children permission disabled', async ({umb test('can set culture and hostnames with culture and hostnames permission enabled', async ({umbracoApi, umbracoUi}) => { // Arrange + const domainName = '/domain'; userGroupId = await umbracoApi.userGroup.createUserGroupWithCultureAndHostnamesPermission(userGroupName); await umbracoApi.user.setUserPermissions(testUser.name, testUser.email, testUser.password, userGroupId); testUserCookieAndToken = await umbracoApi.user.loginToUser(testUser.name, testUser.email, testUser.password); @@ -509,11 +511,15 @@ test('can set culture and hostnames with culture and hostnames permission enable await umbracoUi.content.clickActionsMenuForContent(rootDocumentName); await umbracoUi.content.clickCultureAndHostnamesActionMenuOption(); await umbracoUi.content.clickAddNewDomainButton(); - await umbracoUi.content.enterDomain('/domain'); + await umbracoUi.content.enterDomain(domainName); await umbracoUi.content.clickSaveModalButton(); // Assert - await umbracoUi.content.doesSuccessNotificationHaveText(NotificationConstantHelper.success.culturesAndHostnamesSaved); + await umbracoUi.content.waitForDomainToBeCreated(); + const document = await umbracoApi.document.getByName(rootDocumentName); + const domains = await umbracoApi.document.getDomains(document.id); + expect(domains.domains[0].domainName).toEqual(domainName); + expect(domains.domains[0].isoCode).toEqual('en-US'); }); test('can not set culture and hostnames with culture and hostnames permission disabled', async ({umbracoApi, umbracoUi}) => { @@ -530,7 +536,7 @@ test('can not set culture and hostnames with culture and hostnames permission di await umbracoUi.content.isActionsMenuForNameVisible(rootDocumentName, false); }); -// TODO: Notification is not correct 'Public acccess setting created' should be 'access' +// TODO: Notification is not correct 'Public access setting created' should be 'access' test.skip('can set public access with public access permission enabled', async ({umbracoApi, umbracoUi}) => { // Arrange userGroupId = await umbracoApi.userGroup.createUserGroupWithPublicAccessPermission(userGroupName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/Languages.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/Languages.spec.ts index 4026dcb505..e27f43c25e 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/Languages.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/Languages.spec.ts @@ -80,8 +80,7 @@ test.fixme('can rename content with language set in userGroup', async ({umbracoA await umbracoUi.content.clickSaveAndCloseButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); await umbracoUi.content.isContentInTreeVisible(updatedContentName); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/MemberSection.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/MemberSection.spec.ts index 220bd02395..47d0b2d1ea 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/MemberSection.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/Permissions/UserGroup/MemberSection.spec.ts @@ -69,8 +69,7 @@ test.skip('can create member with members section set', async ({umbracoApi, umbr await umbracoUi.member.clickSaveButton(); // Assert - //await umbracoUi.member.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created) - await umbracoUi.member.isErrorNotificationVisible(false);; + await umbracoUi.member.waitForMemberToBeCreated(); await umbracoUi.member.doesErrorNotificationHaveText(NotificationConstantHelper.error.noAccessToResource, false); expect(await umbracoApi.member.doesNameExist(memberName)).toBeTruthy(); }); @@ -93,8 +92,7 @@ test.skip('can update member with members section set', async ({umbracoApi, umbr await umbracoUi.member.clickSaveButton(); // Assert - //await umbracoUi.member.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved) - await umbracoUi.member.isErrorNotificationVisible(false);; + await umbracoUi.member.isSuccessStateVisibleForSaveButton(false); await umbracoUi.member.doesErrorNotificationHaveText(NotificationConstantHelper.error.noAccessToResource, false); const memberData = await umbracoApi.member.get(memberId); expect(memberData.username).toBe(updatedUsername); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/User.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/User.spec.ts index bb55acd9d8..32c7d55344 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/User.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/User.spec.ts @@ -31,8 +31,7 @@ test('can create a user', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { await umbracoUi.user.clickCreateUserButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.waitForUserToBeCreated(); expect(await umbracoApi.user.doesNameExist(nameOfTheUser)).toBeTruthy(); }); @@ -50,8 +49,7 @@ test('can rename a user', async ({umbracoApi, umbracoUi}) => { await umbracoUi.user.clickSaveButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.user.doesNameExist(nameOfTheUser)).toBeTruthy(); }); @@ -68,8 +66,7 @@ test('can delete a user', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { await umbracoUi.user.clickConfirmToDeleteButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.waitForUserToBeDeleted(); expect(await umbracoApi.user.doesNameExist(nameOfTheUser)).toBeFalsy(); // Checks if the user is deleted from the list await umbracoUi.user.clickUsersMenu(); @@ -92,8 +89,7 @@ test('can add multiple user groups to a user', async ({umbracoApi, umbracoUi}) = await umbracoUi.user.clickSaveButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.user.doesUserContainUserGroupIds(nameOfTheUser, [userGroupWriters.id, userGroupTranslators.id])).toBeTruthy(); }); @@ -110,8 +106,7 @@ test('can remove a user group from a user', {tag: '@smoke'}, async ({umbracoApi, await umbracoUi.user.clickSaveButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.isSuccessStateVisibleForSaveButton(); const userData = await umbracoApi.user.getByName(nameOfTheUser); expect(userData.userGroupIds).toEqual([]); }); @@ -129,8 +124,7 @@ test('can update culture for a user', async ({umbracoApi, umbracoUi}) => { await umbracoUi.user.clickSaveButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.isSuccessStateVisibleForSaveButton(); const userData = await umbracoApi.user.getByName(nameOfTheUser); expect(userData.languageIsoCode).toEqual(danishIsoCode); }); @@ -155,8 +149,7 @@ test('can add a content start node to a user', {tag: '@smoke'}, async ({umbracoA await umbracoUi.user.clickSaveButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.user.doesUserContainContentStartNodeIds(nameOfTheUser, [documentId])).toBeTruthy(); // Clean @@ -191,8 +184,7 @@ test('can add multiple content start nodes for a user', async ({umbracoApi, umbr await umbracoUi.user.clickSaveButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.user.doesUserContainContentStartNodeIds(nameOfTheUser, [documentId, secondDocumentId])).toBeTruthy(); // Clean @@ -225,8 +217,7 @@ test('can remove a content start node from a user', {tag: '@smoke'}, async ({umb await umbracoUi.user.clickSaveButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.user.doesUserContainContentStartNodeIds(nameOfTheUser, [documentId])).toBeFalsy(); // Clean @@ -251,8 +242,7 @@ test('can add media start nodes for a user', {tag: '@smoke'}, async ({umbracoApi await umbracoUi.user.clickSaveButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.user.doesUserContainMediaStartNodeIds(nameOfTheUser, [mediaId])).toBeTruthy(); // Clean @@ -284,8 +274,7 @@ test('can add multiple media start nodes for a user', async ({umbracoApi, umbrac await umbracoUi.user.clickSaveButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.user.doesUserContainMediaStartNodeIds(nameOfTheUser, [firstMediaId, secondMediaId])).toBeTruthy(); // Clean @@ -314,8 +303,7 @@ test('can remove a media start node from a user', async ({umbracoApi, umbracoUi} await umbracoUi.user.clickSaveButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.user.doesUserContainMediaStartNodeIds(nameOfTheUser, [mediaId])).toBeFalsy(); // Clean @@ -334,8 +322,7 @@ test('can allow access to all documents for a user', async ({umbracoApi, umbraco await umbracoUi.user.clickSaveButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.isSuccessStateVisibleForSaveButton(); const userData = await umbracoApi.user.getByName(nameOfTheUser); expect(userData.hasDocumentRootAccess).toBeTruthy() }); @@ -352,8 +339,7 @@ test('can allow access to all media for a user', async ({umbracoApi, umbracoUi}) await umbracoUi.user.clickSaveButton(); // Assert - //await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.user.isErrorNotificationVisible(false); + await umbracoUi.user.isSuccessStateVisibleForSaveButton(); const userData = await umbracoApi.user.getByName(nameOfTheUser); expect(userData.hasMediaRootAccess).toBeTruthy(); }); @@ -472,9 +458,7 @@ test('can enable a user', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { await umbracoUi.user.clickConfirmEnableButton(); // Assert - // TODO: Unskip when it shows userEnabled/userInactive instead of userDisabled - // await umbracoUi.user.doesSuccessNotificationHaveText(NotificationConstantHelper.success.userEnabled); - await umbracoUi.user.isUserActiveTextVisible(); + await umbracoUi.user.doesSuccessNotificationHaveText(newTestUser + NotificationConstantHelper.success.userEnabled); // The state of the user is not enabled. The reason for this is that the user has not logged in, resulting in the state Inactive. const userData = await umbracoApi.user.getByName(newTestUser); expect(userData.state).toBe(inactiveStatus); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/UserGroups.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/UserGroups.spec.ts index 375cccdf47..1d54792e0c 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/UserGroups.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/UserGroups.spec.ts @@ -59,8 +59,7 @@ test('can create an empty user group', async ({umbracoApi, umbracoUi}) => { await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.created); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.waitForUserGroupToBeCreated(); expect(await umbracoApi.userGroup.doesNameExist(userGroupName)).toBeTruthy(); // Checks if the user group was created in the UI as well await umbracoUi.userGroup.clickUserGroupsButton(); @@ -80,8 +79,7 @@ test('can rename a user group', async ({umbracoApi, umbracoUi}) => { await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.userGroup.doesNameExist(userGroupName)).toBeTruthy(); // Checks if the user group was created in the UI as well await umbracoUi.userGroup.clickUserGroupsButton(); @@ -100,8 +98,7 @@ test('can update a user group', async ({umbracoApi, umbracoUi}) => { await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); await umbracoUi.reloadPage(); await umbracoUi.userGroup.doesUserGroupHavePermission(allPermissions.uiPermission[0]); const userGroupData = await umbracoApi.userGroup.getByName(userGroupName); @@ -120,8 +117,7 @@ test('can delete a user group', async ({umbracoApi, umbracoUi}) => { await umbracoUi.userGroup.clickConfirmToDeleteButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.deleted); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.waitForUserGroupToBeDeleted(); expect(await umbracoApi.userGroup.doesNameExist(userGroupName)).toBeFalsy(); await umbracoUi.userGroup.clickUserGroupsButton(); await umbracoUi.userGroup.isUserGroupWithNameVisible(userGroupName, false); @@ -138,8 +134,7 @@ test('can add a section to a user group', async ({umbracoApi, umbracoUi}) => { await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); await umbracoUi.userGroup.clickUserGroupsButton(); await umbracoUi.userGroup.doesUserGroupTableHaveSection(userGroupName, 'Content'); }) @@ -155,8 +150,7 @@ test('can add multiple sections to a user group', async ({umbracoApi, umbracoUi} await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); await umbracoUi.userGroup.clickUserGroupsButton(); await umbracoUi.userGroup.doesUserGroupTableHaveSection(userGroupName, 'Content'); await umbracoUi.userGroup.doesUserGroupTableHaveSection(userGroupName, 'Media'); @@ -174,8 +168,7 @@ test('can remove a section from a user group', async ({umbracoApi, umbracoUi}) = await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); await umbracoUi.userGroup.clickUserGroupsButton(); await umbracoUi.userGroup.doesUserGroupTableHaveSection(userGroupName, 'Content', false); const userGroupData = await umbracoApi.userGroup.getByName(userGroupName); @@ -193,8 +186,7 @@ test('can add a language to a user group', async ({umbracoApi, umbracoUi}) => { await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); await umbracoUi.reloadPage(); await umbracoUi.userGroup.doesUserGroupContainLanguage(englishLanguage); expect(await umbracoApi.userGroup.doesUserGroupContainLanguage(userGroupName, 'en-US')).toBeTruthy(); @@ -211,8 +203,7 @@ test('can enable all languages for a user group', async ({umbracoApi, umbracoUi} await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.userGroup.doesUserGroupContainAccessToAllLanguages(userGroupName)).toBeTruthy(); }) @@ -230,8 +221,7 @@ test('can add multiple languages to a user group', async ({umbracoApi, umbracoUi await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); await umbracoUi.reloadPage(); await umbracoUi.userGroup.doesUserGroupContainLanguage(englishLanguage); await umbracoUi.userGroup.doesUserGroupContainLanguage(danishLanguage); @@ -255,8 +245,7 @@ test('can remove language from a user group', async ({umbracoApi, umbracoUi}) => await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); await umbracoUi.reloadPage(); await umbracoUi.userGroup.doesUserGroupContainLanguage(englishLanguage, false); expect(await umbracoApi.userGroup.doesUserGroupContainLanguage(userGroupName, 'en-US')).toBeFalsy(); @@ -280,8 +269,7 @@ test('can add a content start node to a user group', async ({umbracoApi, umbraco await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.userGroup.doesUserGroupContainContentStartNodeId(userGroupName, documentId)).toBeTruthy(); // Clean @@ -306,8 +294,7 @@ test('can remove a content start node from a user group ', async ({umbracoApi, u await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.userGroup.doesUserGroupContainContentStartNodeId(userGroupName, documentId)).toBeFalsy(); // Clean @@ -325,8 +312,7 @@ test('can enable access to all content from a user group ', async ({umbracoApi, await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.userGroup.doesUserGroupContainDocumentRootAccess(userGroupName)).toBeTruthy(); }); @@ -346,8 +332,7 @@ test('can add a media start node to a user group', async ({umbracoApi, umbracoUi await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.userGroup.doesUserGroupContainMediaStartNodeId(userGroupName, mediaId)).toBeTruthy(); // Clean @@ -370,8 +355,7 @@ test('can remove a media start node from a user group ', async ({umbracoApi, umb await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.userGroup.doesUserGroupContainMediaStartNodeId(userGroupName, mediaId)).toBeFalsy(); // Clean @@ -389,8 +373,7 @@ test('can enable access to all media in a user group ', async ({umbracoApi, umbr await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.userGroup.doesUserGroupContainMediaRootAccess(userGroupName)).toBeTruthy(); }); @@ -405,8 +388,7 @@ test('can enable all permissions for a user group', async ({umbracoApi, umbracoU await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); await umbracoUi.reloadPage(); await umbracoUi.userGroup.doesUserGroupHavePermissionEnabled(allPermissions.uiPermission); const userGroupData = await umbracoApi.userGroup.getByName(userGroupName); @@ -432,8 +414,7 @@ test('can add granular permission to a specific document for a user group', asyn await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.userGroup.doesUserGroupContainGranularPermissionsForDocument(userGroupName, documentId, [allPermissions.verbPermission[0]])).toBeTruthy(); // Clean @@ -459,8 +440,7 @@ test('can add all granular permissions to a specific document for a user group', await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); await umbracoUi.reloadPage(); await umbracoUi.userGroup.clickGranularPermissionWithName(documentName); await umbracoUi.userGroup.doesUserGroupHavePermissionEnabled(allPermissions.uiPermission); @@ -487,8 +467,7 @@ test('can remove granular permission to a specific document for a user group', a await umbracoUi.userGroup.clickSaveButton(); // Assert - //await umbracoUi.userGroup.doesSuccessNotificationHaveText(NotificationConstantHelper.success.saved); - await umbracoUi.userGroup.isErrorNotificationVisible(false); + await umbracoUi.userGroup.isSuccessStateVisibleForSaveButton(); expect(await umbracoApi.userGroup.doesUserGroupContainGranularPermissionsForDocument(userGroupName, documentId, [allPermissions.verbPermission[0]])).toBeFalsy(); // Clean