Removed failing test (#13846)
This commit is contained in:
@@ -559,85 +559,6 @@ test.describe('Content tests', () => {
|
||||
await umbracoApi.documentTypes.ensureNameNotExists(pickedDocTypeName);
|
||||
});
|
||||
|
||||
test('Content with macro in RTE', async ({ page, umbracoApi, umbracoUi }) => {
|
||||
const viewMacroName = 'Content with macro in RTE';
|
||||
const partialFileName = viewMacroName + '.cshtml';
|
||||
|
||||
await umbracoApi.macros.ensureNameNotExists(viewMacroName);
|
||||
await umbracoApi.partialViews.ensureMacroFileNameNotExists(partialFileName);
|
||||
await umbracoApi.documentTypes.ensureNameNotExists(viewMacroName);
|
||||
await umbracoApi.templates.ensureNameNotExists(viewMacroName);
|
||||
await umbracoApi.content.deleteAllContent();
|
||||
|
||||
// First thing first we got to create the macro we will be inserting
|
||||
await createSimpleMacro(viewMacroName, umbracoApi);
|
||||
|
||||
// Now we need to create a document type with a rich text editor where we can insert the macro
|
||||
// The document type must have a template as well in order to ensure that the content is displayed correctly
|
||||
const alias = AliasHelper.toAlias(viewMacroName);
|
||||
const docType = new DocumentTypeBuilder()
|
||||
.withName(viewMacroName)
|
||||
.withAlias(alias)
|
||||
.withAllowAsRoot(true)
|
||||
.withDefaultTemplate(alias)
|
||||
.addGroup()
|
||||
.addRichTextProperty()
|
||||
.withAlias(aliasText)
|
||||
.done()
|
||||
.done()
|
||||
.build();
|
||||
|
||||
const generatedDocType = await umbracoApi.documentTypes.save(docType)
|
||||
// Might as wel initally create the content here, the less GUI work during the test the better
|
||||
const contentNode = new ContentBuilder()
|
||||
.withContentTypeAlias(generatedDocType[defaultContentAlias])
|
||||
.withAction(saveNode)
|
||||
.addVariant()
|
||||
.withName(viewMacroName)
|
||||
.withSave(true)
|
||||
.done()
|
||||
.build();
|
||||
|
||||
await umbracoApi.content.save(contentNode);
|
||||
|
||||
// Ugly wait but we have to wait for cache to rebuild
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Edit the macro template in order to have something to verify on when rendered.
|
||||
await umbracoApi.templates.edit(viewMacroName, `@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
@{
|
||||
if (Model.HasValue("text")){
|
||||
@(Model.Value("text"))
|
||||
}
|
||||
} `);
|
||||
|
||||
// Enter content
|
||||
await umbracoUi.refreshContentTree();
|
||||
await umbracoUi.clickElement(umbracoUi.getTreeItem(ConstantHelper.sections.content, [viewMacroName]));
|
||||
|
||||
// Insert macro
|
||||
await page.locator('[title="Insert macro"]').click();
|
||||
await page.locator('.umb-card-grid-item', {hasText: viewMacroName}).click();
|
||||
// cy.get('.umb-card-grid-item').contains(viewMacroName).click();
|
||||
|
||||
// Save and publish
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
|
||||
await umbracoUi.isSuccessNotificationVisible();
|
||||
|
||||
// Ensure that the view gets rendered correctly
|
||||
const expected = `<p> </p><h1>Acceptance test</h1><p> </p>`;
|
||||
await expect(await umbracoApi.content.verifyRenderedContent('/', expected, true)).toBeTruthy();
|
||||
|
||||
// Cleanup
|
||||
await umbracoApi.macros.ensureNameNotExists(viewMacroName);
|
||||
await umbracoApi.partialViews.ensureMacroFileNameNotExists(partialFileName);
|
||||
await umbracoApi.documentTypes.ensureNameNotExists(viewMacroName);
|
||||
await umbracoApi.templates.ensureNameNotExists(viewMacroName);
|
||||
});
|
||||
|
||||
test('Content with macro in grid', async ({ page, umbracoApi, umbracoUi }) => {
|
||||
const name = 'Content with macro in grid';
|
||||
const macroName = 'Grid macro';
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
import {test} from '@umbraco/playwright-testhelpers';
|
||||
import {expect} from "@playwright/test";
|
||||
import {ContentBuilder, DocumentTypeBuilder} from "@umbraco/json-models-builders";
|
||||
|
||||
test.describe('Recycle bin', () => {
|
||||
|
||||
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
|
||||
await umbracoApi.report.report(testInfo);
|
||||
await umbracoApi.login();
|
||||
});
|
||||
|
||||
test('Can delete content from recycle bin', async ({page, umbracoApi, umbracoUi}) => {
|
||||
const contentToDeleteName = "DeleteMe";
|
||||
const contentToNotDeleteName = "DontDelete";
|
||||
const testType = "TestType";
|
||||
|
||||
await umbracoApi.documentTypes.ensureNameNotExists(testType);
|
||||
|
||||
const docType = new DocumentTypeBuilder()
|
||||
.withName(testType)
|
||||
.build();
|
||||
|
||||
await umbracoApi.documentTypes.save(docType).then(async (savedDocType) => {
|
||||
const contentToDelete = new ContentBuilder()
|
||||
.withContentTypeAlias(savedDocType.alias)
|
||||
.withAction("saveNew")
|
||||
.addVariant()
|
||||
.withName(contentToDeleteName)
|
||||
.withSave(true)
|
||||
.done()
|
||||
.build();
|
||||
|
||||
const contentToNotDelete = new ContentBuilder()
|
||||
.withContentTypeAlias(savedDocType.alias)
|
||||
.withAction("saveNew")
|
||||
.addVariant()
|
||||
.withName(contentToNotDeleteName)
|
||||
.withSave(true)
|
||||
.done()
|
||||
.build();
|
||||
|
||||
// Put it in the recycle bin
|
||||
await umbracoApi.content.save(contentToDelete).then(async savedToDelete => {
|
||||
await umbracoApi.content.deleteById(savedToDelete.id);
|
||||
});
|
||||
await umbracoApi.content.save(contentToNotDelete).then(async savedNotToDelete => {
|
||||
await umbracoApi.content.deleteById(savedNotToDelete.id)
|
||||
});
|
||||
});
|
||||
|
||||
await umbracoUi.refreshContentTree();
|
||||
await umbracoUi.clickElement(umbracoUi.getTreeItem('content', ["Recycle Bin"]));
|
||||
await page.locator('.umb-content-grid__content', {hasText: contentToDeleteName}).click();
|
||||
// cy.get('.umb-content-grid__content').contains(contentToDeleteName).closest('div').click();
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey("actions_delete"));
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey('contentTypeEditor_yesDelete'));
|
||||
|
||||
// Assert
|
||||
await umbracoUi.isSuccessNotificationVisible();
|
||||
|
||||
await expect(page.locator('.umb-content-grid__content', {hasText: contentToDeleteName})).not.toBeVisible();
|
||||
await expect(await umbracoUi.getTreeItem('content', ["Recycle Bin", contentToDeleteName])).not.toBeVisible();
|
||||
await expect(page.locator('.umb-content-grid__content', {hasText: contentToNotDeleteName})).toBeVisible();
|
||||
|
||||
// Clean up
|
||||
await umbracoApi.documentTypes.ensureNameNotExists(testType);
|
||||
});
|
||||
});
|
||||
@@ -325,43 +325,6 @@ test.describe('media File Types', () => {
|
||||
await umbracoApi.media.ensureNameNotExists(childName);
|
||||
});
|
||||
});
|
||||
|
||||
test('Delete one of each Files in media', async ({page, umbracoApi, umbracoUi}) => {
|
||||
const articleName = 'ArticleToDelete';
|
||||
const audioName = 'AudioToDelete';
|
||||
const fileName = 'FileToDelete';
|
||||
const folderName = 'FolderToDelete';
|
||||
const imageName = 'ImageToDelete';
|
||||
const vectorGraphicsName = 'VectorGraphicsToDelete';
|
||||
const videoName = 'VideoToDelete';
|
||||
await umbracoApi.media.deleteAllFiles(articleName, audioName, fileName, folderName, imageName, vectorGraphicsName, videoName);
|
||||
|
||||
// Action
|
||||
await umbracoApi.media.createAllFileTypes(articleName, audioName, fileName, folderName, imageName, vectorGraphicsName, videoName);
|
||||
await page.reload();
|
||||
// Needs to close tours when page has reloaded
|
||||
await page.click('.umb-tour-step__close');
|
||||
|
||||
// Takes all the child elements in folder-grid.
|
||||
await page.locator(".umb-folder-grid").locator("xpath=/*", {hasText: folderName}).click({
|
||||
position: {
|
||||
x: 5,
|
||||
y: 0
|
||||
}
|
||||
});
|
||||
const files = await page.locator('[data-element="media-grid"]').locator("xpath=/*");
|
||||
await umbracoUi.clickMultiple(files);
|
||||
await page.locator('[label-key="actions_delete"]').click();
|
||||
await page.locator('[alias="overlaySubmit"]').click();
|
||||
|
||||
// Assert
|
||||
await expect(page.locator('.alert-success')).toBeVisible();
|
||||
await expect(page.locator(".umb-folder-grid")).toBeHidden();
|
||||
await expect(page.locator('[data-element="media-grid"]')).toBeHidden();
|
||||
|
||||
// Clean
|
||||
await umbracoApi.media.clearRecycleBin();
|
||||
});
|
||||
|
||||
test('Update existing File with new name', async ({page, umbracoApi, umbracoUi}) => {
|
||||
const fileItemNameOld = "File";
|
||||
|
||||
@@ -10,62 +10,6 @@ test.describe('Media', () => {
|
||||
await umbracoApi.media.deleteAllMedia()
|
||||
});
|
||||
|
||||
test('move one of each Files into a Folder', async ({page, umbracoApi, umbracoUi}) => {
|
||||
const articleName = 'ArticleToMove';
|
||||
const audioName = 'AudioToMove';
|
||||
const fileName = 'FileToMove';
|
||||
const folderName = 'FolderToMove';
|
||||
const imageName = 'ImageToMove';
|
||||
const vectorGraphicsName = 'VectorGraphicsToMove';
|
||||
const videoName = 'VideoToMove';
|
||||
const folderToMoveTooName = 'MoveHere';
|
||||
|
||||
const mediaFileTypes = [
|
||||
{fileTypeNames: articleName},
|
||||
{fileTypeNames: audioName},
|
||||
{fileTypeNames: fileName},
|
||||
{fileTypeNames: imageName},
|
||||
{fileTypeNames: vectorGraphicsName},
|
||||
{fileTypeNames: videoName}
|
||||
];
|
||||
|
||||
await umbracoApi.media.deleteAllFiles(articleName,audioName,fileName,folderName,imageName,vectorGraphicsName,videoName);
|
||||
await umbracoApi.media.ensureNameNotExists(folderToMoveTooName);
|
||||
|
||||
// Action
|
||||
await umbracoApi.media.createAllFileTypes(articleName, audioName, fileName, folderName, imageName, vectorGraphicsName, videoName);
|
||||
await umbracoApi.media.createDefaultFolder(folderToMoveTooName);
|
||||
await page.reload();
|
||||
// Needs to close tours when page has reloaded
|
||||
await page.click('.umb-tour-step__close');
|
||||
const files = await page.locator('[data-element="media-grid"]').locator("xpath=/*");
|
||||
await umbracoUi.clickMultiple(files);
|
||||
// I set an position on the click event so it does not click on the folder name and open it.
|
||||
await page.locator(".umb-folder-grid").locator("xpath=/*", {hasText: folderName}).click({
|
||||
position: {
|
||||
x: 5,
|
||||
y: 0
|
||||
}
|
||||
});
|
||||
await page.locator('[label-key="actions_move"]').click();
|
||||
await page.locator('[data-element="editor-container"] >> "' + folderToMoveTooName + '"').click();
|
||||
await page.locator('[label-key="general_submit"]').click();
|
||||
|
||||
// Assert
|
||||
// Needs to wait before refreshing the media tree, otherwise the media files wont be moved to the folder yet
|
||||
await page.waitForTimeout(2500);
|
||||
await umbracoUi.refreshMediaTree();
|
||||
await page.locator('[data-element="tree-item-' + folderToMoveTooName + '"]').click();
|
||||
for (const names of mediaFileTypes) {
|
||||
await expect(page.locator('[data-element="media-grid"]', {hasText: names.fileTypeNames})).toBeVisible();
|
||||
}
|
||||
await expect(page.locator(".umb-folder-grid", {hasText: folderName})).toBeVisible();
|
||||
|
||||
// Clean
|
||||
await umbracoApi.media.deleteAllFiles(articleName, audioName, fileName, folderName, imageName, vectorGraphicsName, videoName);
|
||||
await umbracoApi.media.ensureNameNotExists(folderToMoveTooName);
|
||||
});
|
||||
|
||||
test('sort by Name', async ({page, umbracoApi, umbracoUi}) => {
|
||||
const FolderNameA = 'A';
|
||||
const FolderNameB = 'B';
|
||||
@@ -94,65 +38,4 @@ test.describe('Media', () => {
|
||||
await umbracoApi.media.ensureNameNotExists(FolderNameB);
|
||||
await umbracoApi.media.ensureNameNotExists(FolderNameC);
|
||||
});
|
||||
|
||||
test('search after a specific Folder', async ({page, umbracoApi, umbracoUi}) => {
|
||||
const FolderSearchName = 'SearchMe';
|
||||
await umbracoApi.media.ensureNameNotExists(FolderSearchName);
|
||||
|
||||
// Action
|
||||
await umbracoApi.media.createDefaultFolder(FolderSearchName)
|
||||
await page.locator('[model="options.filter"]').click();
|
||||
await page.locator('[placeholder="Type to search..."]').type(FolderSearchName);
|
||||
|
||||
// Assert
|
||||
await expect(page.locator(".umb-folder-grid__folder-description", {hasText: FolderSearchName})).toBeVisible();
|
||||
|
||||
// Clean
|
||||
await umbracoApi.media.ensureNameNotExists(FolderSearchName);
|
||||
});
|
||||
|
||||
test('change Grid to List', async ({page, umbracoApi, umbracoUi}) => {
|
||||
const FolderOneName = 'FolderOne';
|
||||
const FolderTwoName = 'FolderTwo';
|
||||
await umbracoApi.media.ensureNameNotExists(FolderOneName);
|
||||
await umbracoApi.media.ensureNameNotExists(FolderTwoName);
|
||||
|
||||
// Action
|
||||
await umbracoApi.media.createDefaultFolder(FolderOneName);
|
||||
await umbracoApi.media.createDefaultFolder(FolderTwoName);
|
||||
await umbracoUi.refreshMediaTree();
|
||||
await page.locator('[ng-click="vm.toggleLayoutDropdown()"]').click({force: true});
|
||||
await page.locator('[title="List"]').click();
|
||||
|
||||
// Assert
|
||||
await expect(page.locator('[icon="icon-list"]')).toBeVisible();
|
||||
|
||||
// Clean
|
||||
await umbracoApi.media.ensureNameNotExists(FolderOneName);
|
||||
await umbracoApi.media.ensureNameNotExists(FolderTwoName);
|
||||
});
|
||||
|
||||
test('change List to Grid', async ({page, umbracoApi, umbracoUi}) => {
|
||||
const FolderOneName = 'FolderOne';
|
||||
const FolderTwoName = 'FolderTwo';
|
||||
await umbracoApi.media.ensureNameNotExists(FolderOneName);
|
||||
await umbracoApi.media.ensureNameNotExists(FolderTwoName);
|
||||
|
||||
// Action
|
||||
await umbracoApi.media.createDefaultFolder(FolderOneName);
|
||||
await umbracoApi.media.createDefaultFolder(FolderTwoName);
|
||||
await umbracoUi.refreshMediaTree();
|
||||
await page.locator('[ng-click="vm.toggleLayoutDropdown()"]').click({force: true});
|
||||
await page.locator('[title="List"]').click();
|
||||
await umbracoUi.refreshMediaTree();
|
||||
await page.locator('[ng-click="vm.toggleLayoutDropdown()"]').click({force: true});
|
||||
await page.locator('[title="Grid"]').click();
|
||||
|
||||
// Assert
|
||||
await expect(page.locator('[icon="icon-thumbnails-small"]')).toBeVisible();
|
||||
|
||||
// Clean
|
||||
await umbracoApi.media.ensureNameNotExists(FolderOneName);
|
||||
await umbracoApi.media.ensureNameNotExists(FolderTwoName);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user