V14 QA applied changes from our test helpers (#16889)

* Made fixes based on changes in our test helpers

* Bumped version

* Fixed user tests
This commit is contained in:
Andreas Zerbst
2024-08-12 05:28:34 +02:00
committed by GitHub
parent 1c1b4c6ee8
commit b30a45a248
10 changed files with 58 additions and 64 deletions

View File

@@ -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"
}
},

View File

@@ -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",

View File

@@ -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();

View File

@@ -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');
});
});

View File

@@ -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

View File

@@ -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();

View File

@@ -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);

View File

@@ -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();

View File

@@ -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();

View File

@@ -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});