From b30a45a24880d2c0d521611c0b9cc83dae4d5caf Mon Sep 17 00:00:00 2001 From: Andreas Zerbst <73799582+andr317c@users.noreply.github.com> Date: Mon, 12 Aug 2024 05:28:34 +0200 Subject: [PATCH] V14 QA applied changes from our test helpers (#16889) * Made fixes based on changes in our test helpers * Bumped version * Fixed user tests --- .../package-lock.json | 18 ++++++++--------- .../Umbraco.Tests.AcceptanceTest/package.json | 4 ++-- .../Content/ChildrenContent.spec.ts | 18 ++++++++--------- .../DefaultConfig/Content/Content.spec.ts | 6 +++--- .../Content/ContentInfoTab.spec.ts | 14 ++++++------- .../Content/ContentWithContentPicker.spec.ts | 6 +++--- .../Content/ContentWithMediaPicker.spec.ts | 10 ++++------ .../ContentWithMultipleMediaPicker.spec.ts | 12 +++++------ .../Content/RedirectManagement.spec.ts | 20 +++++++++---------- .../tests/DefaultConfig/Users/User.spec.ts | 14 +++++-------- 10 files changed, 58 insertions(+), 64 deletions(-) diff --git a/tests/Umbraco.Tests.AcceptanceTest/package-lock.json b/tests/Umbraco.Tests.AcceptanceTest/package-lock.json index 68293e0e27..264945f43c 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/package-lock.json +++ b/tests/Umbraco.Tests.AcceptanceTest/package-lock.json @@ -7,8 +7,8 @@ "name": "acceptancetest", "hasInstallScript": true, "dependencies": { - "@umbraco/json-models-builders": "^2.0.13", - "@umbraco/playwright-testhelpers": "^2.0.0-beta.70", + "@umbraco/json-models-builders": "^2.0.14", + "@umbraco/playwright-testhelpers": "^2.0.0-beta.73", "camelize": "^1.0.0", "dotenv": "^16.3.1", "faker": "^4.1.0", @@ -132,19 +132,19 @@ } }, "node_modules/@umbraco/json-models-builders": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/@umbraco/json-models-builders/-/json-models-builders-2.0.13.tgz", - "integrity": "sha512-HeI6I2BO8/3rJyinJTFxhpBSr/TaCc+S1Si+9SXIlze+Erq+yraor706mQDsgIuLfUzAYgmLLoQFxMVof/P7Kw==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/@umbraco/json-models-builders/-/json-models-builders-2.0.14.tgz", + "integrity": "sha512-fP6hVSSph1iFQ1c65UH80AM6QK3r1CzuIiYOvZh+QOoVzpVFtH1VCHL3J2k8AwaHWLVAEopcvtvH5kkl7Luqww==", "dependencies": { "camelize": "^1.0.1" } }, "node_modules/@umbraco/playwright-testhelpers": { - "version": "2.0.0-beta.70", - "resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-2.0.0-beta.70.tgz", - "integrity": "sha512-voNem+L8Nct5bsjbS8HLWK2BCOh7gu834OS487Os1Mj4ebZbHk04YkBYNh7X8HWLNZ1NYqTquAWbFb9RxEgnnw==", + "version": "2.0.0-beta.73", + "resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-2.0.0-beta.73.tgz", + "integrity": "sha512-CCURatZa7Ipui9ZTqdZmkpx89Sr5AJLoXogniq6mv84mSVGeCQFYzHvw1op2UE8nkKY5/wyqfrCihjrbW5v8lw==", "dependencies": { - "@umbraco/json-models-builders": "2.0.13", + "@umbraco/json-models-builders": "2.0.14", "node-fetch": "^2.6.7" } }, diff --git a/tests/Umbraco.Tests.AcceptanceTest/package.json b/tests/Umbraco.Tests.AcceptanceTest/package.json index fdb6ab3b7c..9cccd40a36 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/package.json +++ b/tests/Umbraco.Tests.AcceptanceTest/package.json @@ -21,8 +21,8 @@ "wait-on": "^7.2.0" }, "dependencies": { - "@umbraco/json-models-builders": "^2.0.13", - "@umbraco/playwright-testhelpers": "^2.0.0-beta.70", + "@umbraco/json-models-builders": "^2.0.14", + "@umbraco/playwright-testhelpers": "^2.0.0-beta.73", "camelize": "^1.0.0", "dotenv": "^16.3.1", "faker": "^4.1.0", 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 20067cd7f4..176f19c2b3 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ChildrenContent.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ChildrenContent.spec.ts @@ -24,7 +24,7 @@ test.afterEach(async ({umbracoApi}) => { test('can create child node', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { // Arrange childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName); - documentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedChildNode(documentTypeName, childDocumentTypeId, true); + documentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedChildNode(documentTypeName, childDocumentTypeId); contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); @@ -33,11 +33,11 @@ test('can create child node', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) = await umbracoUi.content.clickActionsMenuForContent(contentName); await umbracoUi.content.clickCreateButton(); await umbracoUi.content.chooseDocumentType(childDocumentTypeName); - // This wait is needed + // This wait is needed await umbracoUi.waitForTimeout(500); await umbracoUi.content.enterContentName(childContentName); await umbracoUi.content.clickSaveButton(); - + // Assert await umbracoUi.content.isSuccessNotificationVisible(); expect(await umbracoApi.document.doesNameExist(childContentName)).toBeTruthy(); @@ -61,9 +61,9 @@ test('can create child node in child node', async ({umbracoApi, umbracoUi}) => { let childContentId: any; await umbracoApi.documentType.ensureNameNotExists(childOfChildDocumentTypeName); childOfChildDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childOfChildDocumentTypeName); - childDocumentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedChildNode(childDocumentTypeName, childOfChildDocumentTypeId, true); - documentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedChildNode(documentTypeName, childDocumentTypeId, true); - contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); + childDocumentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedChildNode(childDocumentTypeName, childOfChildDocumentTypeId); + documentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedChildNode(documentTypeName, childDocumentTypeId); + contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); childContentId = await umbracoApi.document.createDefaultDocumentWithParent(childContentName, childDocumentTypeId, contentId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); @@ -73,7 +73,7 @@ test('can create child node in child node', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.clickActionsMenuForContent(childContentName); await umbracoUi.content.clickCreateButton(); await umbracoUi.content.chooseDocumentType(childOfChildDocumentTypeName); - // This wait is needed + // This wait is needed await umbracoUi.waitForTimeout(500); await umbracoUi.content.enterContentName(childOfChildContentName); await umbracoUi.content.clickSaveButton(); @@ -94,7 +94,7 @@ test('can create child node in child node', async ({umbracoApi, umbracoUi}) => { test('cannot publish child if the parent is not published', async ({umbracoApi, umbracoUi}) => { // Arrange childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName); - documentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedChildNode(documentTypeName, childDocumentTypeId, true); + documentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedChildNode(documentTypeName, childDocumentTypeId); contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoApi.document.createDefaultDocumentWithParent(childContentName, childDocumentTypeId, contentId); await umbracoUi.goToBackOffice(); @@ -114,7 +114,7 @@ test('cannot publish child if the parent is not published', async ({umbracoApi, test('can publish with descendants', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { // Arrange childDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childDocumentTypeName); - documentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedChildNode(documentTypeName, childDocumentTypeId, true); + documentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedChildNode(documentTypeName, childDocumentTypeId); contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); await umbracoApi.document.createDefaultDocumentWithParent(childContentName, childDocumentTypeId, contentId); await umbracoUi.goToBackOffice(); 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 98f0a6ec21..0c7a869eb0 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Content.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Content.spec.ts @@ -91,7 +91,7 @@ test('can rename content', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.goToSection(ConstantHelper.sections.content); // Act - await umbracoUi.content.openContent(wrongContentName); + await umbracoUi.content.goToContentWithName(wrongContentName); await umbracoUi.content.enterContentName(contentName); await umbracoUi.content.clickSaveButton(); @@ -111,7 +111,7 @@ test('can update content', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.goToSection(ConstantHelper.sections.content); // Act - await umbracoUi.content.openContent(contentName); + await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.enterTextstring(contentText); await umbracoUi.content.clickSaveButton(); @@ -159,4 +159,4 @@ test('can unpublish content', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) = await umbracoUi.content.isSuccessNotificationVisible(); const contentData = await umbracoApi.document.getByName(contentName); expect(contentData.variants[0].state).toBe('Draft'); -}); \ No newline at end of file +}); 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 5ec48a6a67..b2cbeb9c6e 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentInfoTab.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentInfoTab.spec.ts @@ -27,11 +27,11 @@ test('can see correct information when published', async ({umbracoApi, umbracoUi await umbracoUi.content.goToSection(ConstantHelper.sections.content); // Act - await umbracoUi.content.openContent(contentName); + await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.clickInfoTab(); await umbracoUi.content.doesLinkHaveText(notPublishContentLink); await umbracoUi.content.clickSaveAndPublishButton(); - + // Assert const contentData = await umbracoApi.document.get(contentId); // TODO: Uncomment this when front-end is ready. Currently the link is not updated immediately after publishing @@ -58,7 +58,7 @@ test('can open document type', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.goToSection(ConstantHelper.sections.content); // Act - await umbracoUi.content.openContent(contentName); + await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.clickDocumentTypeByName(documentTypeName); // Assert @@ -74,9 +74,9 @@ test('can open template', async ({umbracoApi, umbracoUi}) => { contentId = await umbracoApi.document.createDocumentWithTemplate(contentName, documentTypeId, templateId); await umbracoUi.goToBackOffice(); await umbracoUi.content.goToSection(ConstantHelper.sections.content); - + // Act - await umbracoUi.content.openContent(contentName); + await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.clickTemplateByName(templateName); // Assert @@ -100,7 +100,7 @@ test('can change template', async ({umbracoApi, umbracoUi}) => { await umbracoUi.content.goToSection(ConstantHelper.sections.content); // Act - await umbracoUi.content.openContent(contentName); + await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.changeTemplate(firstTemplateName, secondTemplateName); await umbracoUi.content.clickSaveButton(); @@ -127,7 +127,7 @@ test('cannot change to a template that is not allowed in the document type', asy await umbracoUi.content.goToSection(ConstantHelper.sections.content); // Act - await umbracoUi.content.openContent(contentName); + await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.clickEditTemplateByName(firstTemplateName); // Assert 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 478cc7e3b4..ce18c79e9a 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithContentPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithContentPicker.spec.ts @@ -98,7 +98,7 @@ test('can choose start node for the content picker in the content', async ({umbr await umbracoApi.documentType.ensureNameNotExists(childContentPickerDocumentTypeName); const childContentPickerDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childContentPickerDocumentTypeName); const contentPickerDocumentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedChildNode(contentPickerName, childContentPickerDocumentTypeId); - const contentPickerId = await umbracoApi.document.createDefaultDocument(contentPickerName, contentPickerDocumentTypeId); + const contentPickerId = await umbracoApi.document.createDefaultDocument(contentPickerName, contentPickerDocumentTypeId); await umbracoApi.document.createDefaultDocumentWithParent(childContentPickerName, childContentPickerDocumentTypeId, contentPickerId); // Create a custom content picker with start node const customDataTypeId = await umbracoApi.dataType.createContentPickerDataTypeWithStartNode(customDataTypeName, contentPickerId); @@ -129,7 +129,7 @@ test.skip('can ignore user start node for the content picker in the content', as await umbracoApi.documentType.ensureNameNotExists(childContentPickerDocumentTypeName); const childContentPickerDocumentTypeId = await umbracoApi.documentType.createDefaultDocumentType(childContentPickerDocumentTypeName); const contentPickerDocumentTypeId = await umbracoApi.documentType.createDocumentTypeWithAllowedChildNode(contentPickerName, childContentPickerDocumentTypeId); - const contentPickerId = await umbracoApi.document.createDefaultDocument(contentPickerName, contentPickerDocumentTypeId); + const contentPickerId = await umbracoApi.document.createDefaultDocument(contentPickerName, contentPickerDocumentTypeId); await umbracoApi.document.createDefaultDocumentWithParent(childContentPickerName, childContentPickerDocumentTypeId, contentPickerId); // Create a custom content picker with the setting "ignore user start node" is enable const customDataTypeId = await umbracoApi.dataType.createContentPickerDataTypeWithIgnoreUserStartNodes(customDataTypeName, contentPickerId); @@ -161,7 +161,7 @@ test('can remove content picker in the content', async ({umbracoApi, umbracoUi}) await umbracoUi.content.goToSection(ConstantHelper.sections.content); // Act - await umbracoUi.content.openContent(contentName); + await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.removeContentPicker(contentPickerName); await umbracoUi.content.clickSaveButton(); 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 b263700fd3..b8cb9f4c66 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMediaPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMediaPicker.spec.ts @@ -12,13 +12,13 @@ test.beforeEach(async ({umbracoApi, umbracoUi}) => { await umbracoApi.documentType.ensureNameNotExists(documentTypeName); await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.media.ensureNameNotExists(mediaFileName); - mediaFileId = await umbracoApi.media.createDefaultMedia(mediaFileName, mediaTypeName); + mediaFileId = await umbracoApi.media.createDefaultMediaFile(mediaFileName); await umbracoUi.goToBackOffice(); }); test.afterEach(async ({umbracoApi}) => { await umbracoApi.media.ensureNameNotExists(mediaFileName); - await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.documentType.ensureNameNotExists(documentTypeName); }); @@ -33,7 +33,6 @@ test('can create content with the media picker data type', {tag: '@smoke'}, asyn await umbracoUi.content.clickCreateButton(); await umbracoUi.content.chooseDocumentType(documentTypeName); await umbracoUi.content.enterContentName(contentName); - await umbracoUi.content.clickChooseMediaPickerButton(); await umbracoUi.content.selectMediaByName(mediaFileName); await umbracoUi.content.clickSubmitButton(); await umbracoUi.content.clickSaveButton(); @@ -60,7 +59,6 @@ test('can publish content with the media picker data type', async ({umbracoApi, await umbracoUi.content.clickCreateButton(); await umbracoUi.content.chooseDocumentType(documentTypeName); await umbracoUi.content.enterContentName(contentName); - await umbracoUi.content.clickChooseMediaPickerButton(); await umbracoUi.content.selectMediaByName(mediaFileName); await umbracoUi.content.clickSubmitButton(); await umbracoUi.content.clickSaveAndPublishButton(); @@ -84,7 +82,7 @@ test('can remove a media picker in the content', async ({umbracoApi, umbracoUi}) await umbracoUi.content.goToSection(ConstantHelper.sections.content); // Act - await umbracoUi.content.openContent(contentName); + await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.removeMediaPickerByName(mediaFileName); await umbracoUi.content.clickSaveButton(); @@ -103,7 +101,7 @@ test('can limit the media picker in the content by setting the start node', asyn await umbracoApi.media.ensureNameNotExists(mediaFolderName); const mediaFolderId = await umbracoApi.media.createDefaultMediaFolder(mediaFolderName); await umbracoApi.media.ensureNameNotExists(childMediaName); - await umbracoApi.media.createDefaultMedia(childMediaName, mediaTypeName, mediaFolderId); + await umbracoApi.media.createDefaultMediaFileAndParentId(childMediaName, mediaFolderId); const customDataTypeId = await umbracoApi.dataType.createMediaPickerDataTypeWithStartNodeId(customDataTypeName, mediaFolderId); await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, customDataTypeName, customDataTypeId); await umbracoUi.content.goToSection(ConstantHelper.sections.content); 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 fb3440ad1d..0093866fdd 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultipleMediaPicker.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithMultipleMediaPicker.spec.ts @@ -15,16 +15,16 @@ test.beforeEach(async ({umbracoApi, umbracoUi}) => { await umbracoApi.documentType.ensureNameNotExists(documentTypeName); await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.media.ensureNameNotExists(firstMediaFileName); - firstMediaFileId = await umbracoApi.media.createDefaultMedia(firstMediaFileName, firstMediaTypeName); + firstMediaFileId = await umbracoApi.media.createDefaultMediaFile(firstMediaFileName); await umbracoApi.media.ensureNameNotExists(secondMediaFileName); - secondMediaFileId = await umbracoApi.media.createDefaultMedia(secondMediaFileName, secondMediaTypeName); + secondMediaFileId = await umbracoApi.media.createDefaultMediaWithImage(secondMediaFileName); await umbracoUi.goToBackOffice(); }); test.afterEach(async ({umbracoApi}) => { await umbracoApi.media.ensureNameNotExists(firstMediaFileName); await umbracoApi.media.ensureNameNotExists(secondMediaFileName); - await umbracoApi.document.ensureNameNotExists(contentName); + await umbracoApi.document.ensureNameNotExists(contentName); await umbracoApi.documentType.ensureNameNotExists(documentTypeName); }); @@ -39,8 +39,8 @@ test('can create content with multiple media picker data type', async ({umbracoA await umbracoUi.content.clickCreateButton(); await umbracoUi.content.chooseDocumentType(documentTypeName); await umbracoUi.content.enterContentName(contentName); - await umbracoUi.content.clickChooseMediaPickerButton(); await umbracoUi.content.selectMediaByName(firstMediaFileName); + await umbracoUi.content.clickSubmitButton(); await umbracoUi.content.selectMediaByName(secondMediaFileName); await umbracoUi.content.clickSubmitButton(); await umbracoUi.content.clickSaveButton(); @@ -68,8 +68,8 @@ test('can publish content with multiple media picker data type', async ({umbraco await umbracoUi.content.clickCreateButton(); await umbracoUi.content.chooseDocumentType(documentTypeName); await umbracoUi.content.enterContentName(contentName); - await umbracoUi.content.clickChooseMediaPickerButton(); await umbracoUi.content.selectMediaByName(firstMediaFileName); + await umbracoUi.content.clickSubmitButton(); await umbracoUi.content.selectMediaByName(secondMediaFileName); await umbracoUi.content.clickSubmitButton(); await umbracoUi.content.clickSaveAndPublishButton(); @@ -94,7 +94,7 @@ test('can remove a media picker in the content', async ({umbracoApi, umbracoUi}) await umbracoUi.content.goToSection(ConstantHelper.sections.content); // Act - await umbracoUi.content.openContent(contentName); + await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.removeMediaPickerByName(firstMediaFileName); await umbracoUi.content.clickSaveButton(); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RedirectManagement.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RedirectManagement.spec.ts index 0cfe5e2c18..62d92f7b55 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RedirectManagement.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RedirectManagement.spec.ts @@ -13,7 +13,7 @@ test.beforeEach(async ({umbracoApi, umbracoUi}) => { await umbracoApi.redirectManagement.setStatus(enableStatus); await umbracoUi.goToBackOffice(); // Create a content - await umbracoApi.documentType.ensureNameNotExists(documentTypeName); + await umbracoApi.documentType.ensureNameNotExists(documentTypeName); documentTypeId = await umbracoApi.documentType.createDefaultDocumentTypeWithAllowAsRoot(documentTypeName); contentId = await umbracoApi.document.createDefaultDocument(contentName, documentTypeId); // Publish the content @@ -36,10 +36,10 @@ test('can disable URL tracker', async ({umbracoApi, umbracoUi}) => { await umbracoUi.redirectManagement.clickDisableButton(); // Assert - // Verfiy that if renaming a published page, there are no redirects have been made - // rename the published content + // Verify that if renaming a published page, there are no redirects have been made + // rename the published content await umbracoUi.content.goToSection(ConstantHelper.sections.content); - await umbracoUi.content.openContent(contentName); + await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.enterContentName(updatedContentName); await umbracoUi.content.clickSaveAndPublishButton(); // verify that there is no redirects have been made @@ -63,10 +63,10 @@ test.skip('can re-enable URL tracker', async ({umbracoApi, umbracoUi}) => { await umbracoUi.redirectManagement.clickEnableURLTrackerButton(); // Assert - // Verfiy that if renaming a published page, there are one redirects have been made - // rename the published content + // Verify that if renaming a published page, there are one redirects have been made + // rename the published content await umbracoUi.content.goToSection(ConstantHelper.sections.content); - await umbracoUi.content.openContent(contentName); + await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.enterContentName(updatedContentName); await umbracoUi.content.clickSaveAndPublishButton(); // verify that there is one redirects have been made @@ -90,7 +90,7 @@ test.skip('can search for original URL', async ({umbracoUi}) => { await umbracoUi.redirectManagement.clickRedirectManagementTab(); await umbracoUi.redirectManagement.enterOriginalUrl(searchKeyword); await umbracoUi.redirectManagement.clickSearchButton(); - + // Assert // TODO: verify the search result }); @@ -98,9 +98,9 @@ test.skip('can search for original URL', async ({umbracoUi}) => { // TODO: Remove skip when the frond-end is ready. Currently there is no redirect have been made after renaming a published page test.skip('can delete a redirect', async ({umbracoApi, umbracoUi}) => { // Arrange - // Rename the published content + // Rename the published content await umbracoUi.content.goToSection(ConstantHelper.sections.content); - await umbracoUi.content.openContent(contentName); + await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.enterContentName(updatedContentName); await umbracoUi.content.clickSaveAndPublishButton(); 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 789bf96939..87c69bb6a9 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/User.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Users/User.spec.ts @@ -224,12 +224,11 @@ test('can remove a content start node from a user', {tag: '@smoke'}, async ({umb test('can add media start nodes for a user', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => { // Arrange - const mediaTypeName = 'File'; const mediaName = 'TestMediaFile'; const userGroup = await umbracoApi.userGroup.getByName(defaultUserGroupName); await umbracoApi.user.createDefaultUser(nameOfTheUser, userEmail, [userGroup.id]); await umbracoApi.media.ensureNameNotExists(mediaName); - const mediaId = await umbracoApi.media.createDefaultMedia(mediaName, mediaTypeName); + const mediaId = await umbracoApi.media.createDefaultMediaFile(mediaName); await umbracoUi.user.goToSection(ConstantHelper.sections.users); // Act @@ -249,15 +248,14 @@ test('can add media start nodes for a user', {tag: '@smoke'}, async ({umbracoApi test('can add multiple media start nodes for a user', async ({umbracoApi, umbracoUi}) => { // Arrange - const mediaTypeName = 'File'; const userGroup = await umbracoApi.userGroup.getByName(defaultUserGroupName); const userId = await umbracoApi.user.createDefaultUser(nameOfTheUser, userEmail, [userGroup.id]); const mediaName = 'TestMediaFile'; const secondMediaName = 'SecondMediaFile'; await umbracoApi.media.ensureNameNotExists(mediaName); await umbracoApi.media.ensureNameNotExists(secondMediaName); - const firstMediaId = await umbracoApi.media.createDefaultMedia(mediaName, mediaTypeName); - const secondMediaId = await umbracoApi.media.createDefaultMedia(secondMediaName, mediaTypeName); + const firstMediaId = await umbracoApi.media.createDefaultMediaFile(mediaName); + const secondMediaId = await umbracoApi.media.createDefaultMediaFile(secondMediaName); // Adds the media start node to the user const userData = await umbracoApi.user.getByName(nameOfTheUser); userData.mediaStartNodeIds.push({id: firstMediaId}); @@ -283,12 +281,11 @@ test('can add multiple media start nodes for a user', async ({umbracoApi, umbrac test('can remove a media start node from a user', async ({umbracoApi, umbracoUi}) => { // Arrange - const mediaTypeName = 'File'; const userGroup = await umbracoApi.userGroup.getByName(defaultUserGroupName); const userId = await umbracoApi.user.createDefaultUser(nameOfTheUser, userEmail, [userGroup.id]); const mediaName = 'TestMediaFile'; await umbracoApi.media.ensureNameNotExists(mediaName); - const mediaId = await umbracoApi.media.createDefaultMedia(mediaName, mediaTypeName); + const mediaId = await umbracoApi.media.createDefaultMediaFile(mediaName); // Adds the media start node to the user const userData = await umbracoApi.user.getByName(nameOfTheUser); userData.mediaStartNodeIds.push({id: mediaId}); @@ -374,12 +371,11 @@ test('can see if the user has the correct access based on content start nodes', test('can see if the user has the correct access based on media start nodes', async ({umbracoApi, umbracoUi}) => { // Arrange - const mediaTypeName = 'File'; const userGroup = await umbracoApi.userGroup.getByName(defaultUserGroupName); const userId = await umbracoApi.user.createDefaultUser(nameOfTheUser, userEmail, [userGroup.id]); const mediaName = 'TestMediaFile'; await umbracoApi.media.ensureNameNotExists(mediaName); - const mediaId = await umbracoApi.media.createDefaultMedia(mediaName, mediaTypeName); + const mediaId = await umbracoApi.media.createDefaultMediaFile(mediaName); // Adds the media start node to the user const userData = await umbracoApi.user.getByName(nameOfTheUser); userData.mediaStartNodeIds.push({id: mediaId});