V11/bugfix/fixed flaky test (#13893)
* Moved deleteAllMedia to afterEach, the reason for that is that we delete all the media in each test. * Added additional timeout and a WaitForTimeout(), the reason for the WaitForTimeout is because it can take a second for the modelsbuilder to update the view. * Added more timeout for the isSuccessNotificationVisible. Updated the helper ensureNameNotExists so they actually delete the partialViews * Updated the locators for deleting the UK language. Added an expect for checking if the UK language is visible in the UI * Updated the position where the dragAndDrop drops to * Changed the trace so we only save the trace on the first retry, it saves a lot of time when the tests are running, since we dont need to save the trace and then delete the trace after each successful test * Updated locators. Added an expect so the test waits until the / is visible in the URL before going further into the test * Changed back to retain on failure on the pipelines, the reason for that is if a test only fails once, then we wont see what the actual error was in the test when looking on the pipeline. * Added an expect so we wait until the page is loaded for packages * Updated the dragAndDrop so they hopefully work. * Changed values for dragAndDrop * Updated the dragAndDrop values * Bumped playwright version
This commit is contained in:
55
tests/Umbraco.Tests.AcceptanceTest/package-lock.json
generated
55
tests/Umbraco.Tests.AcceptanceTest/package-lock.json
generated
@@ -17,7 +17,7 @@
|
||||
"xhr2": "^0.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.29",
|
||||
"@playwright/test": "^1.31",
|
||||
"del": "^6.0.0",
|
||||
"ncp": "^2.0.0",
|
||||
"prompt": "^1.2.0",
|
||||
@@ -86,19 +86,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@playwright/test": {
|
||||
"version": "1.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.30.0.tgz",
|
||||
"integrity": "sha512-SVxkQw1xvn/Wk/EvBnqWIq6NLo1AppwbYOjNLmyU0R1RoQ3rLEBtmjTnElcnz8VEtn11fptj1ECxK0tgURhajw==",
|
||||
"version": "1.31.1",
|
||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.31.1.tgz",
|
||||
"integrity": "sha512-IsytVZ+0QLDh1Hj83XatGp/GsI1CDJWbyDaBGbainsh0p2zC7F4toUocqowmjS6sQff2NGT3D9WbDj/3K2CJiA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"playwright-core": "1.30.0"
|
||||
"playwright-core": "1.31.1"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@sideway/address": {
|
||||
@@ -409,6 +412,20 @@
|
||||
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "7.2.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||
@@ -725,9 +742,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.30.0",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.30.0.tgz",
|
||||
"integrity": "sha512-7AnRmTCf+GVYhHbLJsGUtskWTE33SwMZkybJ0v6rqR1boxq2x36U7p1vDRV7HO2IwTZgmycracLxPEJI49wu4g==",
|
||||
"version": "1.31.1",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.31.1.tgz",
|
||||
"integrity": "sha512-JTyX4kV3/LXsvpHkLzL2I36aCdml4zeE35x+G5aPc4bkLsiRiQshU5lWeVpHFAuC8xAcbI6FDcw/8z3q2xtJSQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
@@ -1018,13 +1035,14 @@
|
||||
}
|
||||
},
|
||||
"@playwright/test": {
|
||||
"version": "1.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.30.0.tgz",
|
||||
"integrity": "sha512-SVxkQw1xvn/Wk/EvBnqWIq6NLo1AppwbYOjNLmyU0R1RoQ3rLEBtmjTnElcnz8VEtn11fptj1ECxK0tgURhajw==",
|
||||
"version": "1.31.1",
|
||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.31.1.tgz",
|
||||
"integrity": "sha512-IsytVZ+0QLDh1Hj83XatGp/GsI1CDJWbyDaBGbainsh0p2zC7F4toUocqowmjS6sQff2NGT3D9WbDj/3K2CJiA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
"playwright-core": "1.30.0"
|
||||
"fsevents": "2.3.2",
|
||||
"playwright-core": "1.31.1"
|
||||
}
|
||||
},
|
||||
"@sideway/address": {
|
||||
@@ -1273,6 +1291,13 @@
|
||||
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
|
||||
"dev": true
|
||||
},
|
||||
"fsevents": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.2.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||
@@ -1503,9 +1528,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"playwright-core": {
|
||||
"version": "1.30.0",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.30.0.tgz",
|
||||
"integrity": "sha512-7AnRmTCf+GVYhHbLJsGUtskWTE33SwMZkybJ0v6rqR1boxq2x36U7p1vDRV7HO2IwTZgmycracLxPEJI49wu4g==",
|
||||
"version": "1.31.1",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.31.1.tgz",
|
||||
"integrity": "sha512-JTyX4kV3/LXsvpHkLzL2I36aCdml4zeE35x+G5aPc4bkLsiRiQshU5lWeVpHFAuC8xAcbI6FDcw/8z3q2xtJSQ==",
|
||||
"dev": true
|
||||
},
|
||||
"prompt": {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"createTest": "node createTest.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.29",
|
||||
"@playwright/test": "^1.31",
|
||||
"typescript": "^4.8.3",
|
||||
"tslib": "^2.4.0",
|
||||
"del": "^6.0.0",
|
||||
|
||||
@@ -36,6 +36,7 @@ const config: PlaywrightTestConfig = {
|
||||
// baseURL: 'http://localhost:44332',
|
||||
|
||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||
// When working locally it can be a good idea to use trace: 'on-first-retry' instead of 'retain-on-failure', it can cut the local test times in half.
|
||||
trace: 'retain-on-failure',
|
||||
ignoreHTTPSErrors: true,
|
||||
},
|
||||
|
||||
@@ -920,7 +920,7 @@ test.describe('BlockGridEditorAreasContent', () => {
|
||||
// Drags and drops the ElementBody to another element
|
||||
const dragFrom = await page.locator('[data-element-udi="' + ElementMoveFromUdi + '"]').locator('[data-content-element-type-alias="' + elementBodyAlias + '"]');
|
||||
const dragTo = await page.locator('[data-element-udi="' + ElementMoveToUdi + '"]').locator('[data-area-alias="' + titleArea + '"]').getByRole('button', {name: 'Add content'});
|
||||
await umbracoUi.dragAndDrop(dragFrom, dragTo, 0, 0, 10);
|
||||
await umbracoUi.dragAndDrop(dragFrom, dragTo, -15, 0, 15);
|
||||
|
||||
// Assert
|
||||
// Expects the element MoveFrom to have 0 entries
|
||||
|
||||
@@ -230,7 +230,7 @@ test.describe('BlockGridEditorContent', () => {
|
||||
// Drag and Drop
|
||||
const dragFromLocator = await page.locator('[data-content-element-type-key="' + element['key'] + '"]', {hasText: bottomBlock});
|
||||
const dragToLocator = await page.locator('[data-content-element-type-key="' + element['key'] + '"]', {hasText: topBlock});
|
||||
await umbracoUi.dragAndDrop(dragFromLocator, dragToLocator, 10, 0, 10);
|
||||
await umbracoUi.dragAndDrop(dragFromLocator, dragToLocator, 10, -5, 15);
|
||||
|
||||
// Assert
|
||||
// Checks if the BottomBlock is moved to be under TopBlock
|
||||
@@ -289,7 +289,7 @@ test.describe('BlockGridEditorContent', () => {
|
||||
// Drag and Drop
|
||||
const dragFromLocator = await page.locator('[data-content-element-type-key="' + element['key'] + '"]', {hasText: rightBlock});
|
||||
const dragToLocator = await page.locator('[data-content-element-type-key="' + element['key'] + '"]', {hasText: leftBlock});
|
||||
await umbracoUi.dragAndDrop(dragFromLocator, dragToLocator, 0, 20, 10);
|
||||
await umbracoUi.dragAndDrop(dragFromLocator, dragToLocator, -5, 20, 15);
|
||||
|
||||
// Assert
|
||||
// Checks if the rightBlock is moved to the right side of the blocks
|
||||
|
||||
@@ -583,7 +583,10 @@ test.describe('BlockGridEditorDataTypeBlock', () => {
|
||||
await umbracoUi.navigateToDataType(blockGridName);
|
||||
|
||||
// Drags the element from the default group to the 'MoveToHere' Group.
|
||||
await page.locator('.umb-block-card-group').nth(0).locator('[data-content-element-type-key="' + element['key'] + '"]').dragTo(page.locator('[key="blockEditor_addBlockType"]').nth(1));
|
||||
const dragFrom = await page.locator('.umb-block-card-group').nth(0).locator('[data-content-element-type-key="' + element['key'] + '"]');
|
||||
const dragTo = await page.locator('[key="blockEditor_addBlockType"]').nth(1);
|
||||
await umbracoUi.dragAndDrop(dragFrom, dragTo, 0, 0, 15);
|
||||
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));
|
||||
|
||||
// Assert
|
||||
@@ -620,7 +623,10 @@ test.describe('BlockGridEditorDataTypeBlock', () => {
|
||||
await umbracoUi.navigateToDataType(blockGridName);
|
||||
|
||||
// Drags the group GroupMove under GroupNotMoving
|
||||
await page.locator('.umb-block-card-group >> [icon="icon-navigation"]').nth(0).dragTo(page.locator('[key="blockEditor_addBlockType"]').nth(2));
|
||||
const dragFrom = await page.locator('.umb-block-card-group >> [icon="icon-navigation"]').nth(0);
|
||||
const dragTo = await page.locator('[key="blockEditor_addBlockType"]').nth(2);
|
||||
await umbracoUi.dragAndDrop(dragFrom, dragTo, 0, 0, 15);
|
||||
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));
|
||||
|
||||
// Assert
|
||||
@@ -634,7 +640,9 @@ test.describe('BlockGridEditorDataTypeBlock', () => {
|
||||
await umbracoUi.doesDataTypeExist(blockGridName);
|
||||
});
|
||||
|
||||
test('can move a group with elements in a block grid editor ', async ({page, umbracoApi, umbracoUi}) => {
|
||||
test('can move a group with elements in a block grid editor', async ({page, umbracoApi, umbracoUi}, testInfo) => {
|
||||
await testInfo.slow();
|
||||
|
||||
const GroupMove = 'GroupMove';
|
||||
const GroupNotMoving = 'GroupNotMoving';
|
||||
|
||||
@@ -674,17 +682,12 @@ test.describe('BlockGridEditorDataTypeBlock', () => {
|
||||
await umbracoUi.navigateToDataType(blockGridName);
|
||||
|
||||
// Drags the group GroupMove under GroupNotMoving
|
||||
await page.locator('.umb-block-card-group >> [icon="icon-navigation"]').nth(0).hover();
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(0, -20);
|
||||
await page.locator('[key="blockEditor_addBlockType"]').nth(2).hover({
|
||||
position: {
|
||||
x: 0, y: 20
|
||||
}
|
||||
});
|
||||
await page.mouse.up();
|
||||
const dragFrom = await page.locator('.umb-block-card-group >> [icon="icon-navigation"]').nth(0);
|
||||
const dragTo = await page.locator('[key="blockEditor_addBlockType"]').nth(2);
|
||||
await umbracoUi.dragAndDrop(dragFrom, dragTo, 20, 0, 15);
|
||||
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));
|
||||
|
||||
|
||||
// Assert
|
||||
await umbracoUi.isSuccessNotificationVisible();
|
||||
// Checks if the elements were moved with their group
|
||||
|
||||
@@ -120,7 +120,6 @@ test.describe('DataTypes', () => {
|
||||
});
|
||||
|
||||
test('Test Url Picker', async ({page, umbracoApi, umbracoUi}) => {
|
||||
|
||||
const urlPickerDocTypeName = 'Url Picker Test';
|
||||
const pickerDocTypeAlias = AliasHelper.toAlias(urlPickerDocTypeName);
|
||||
|
||||
@@ -155,18 +154,18 @@ test.describe('DataTypes', () => {
|
||||
await page.locator('.umb-tree-root').click({button: "right"});
|
||||
await page.locator('[data-element="action-create"]').click();
|
||||
await page.locator('[data-element="action-create-' + pickerDocTypeAlias + '"] > .umb-action-link').click();
|
||||
|
||||
|
||||
// Fill out content
|
||||
await umbracoUi.setEditorHeaderName('UrlPickerContent');
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
|
||||
await umbracoUi.isSuccessNotificationVisible();
|
||||
await page.locator('span:has-text("×")').click();
|
||||
await page.locator('.umb-node-preview-add').click();
|
||||
|
||||
// Should really try and find a better way to do this, but umbracoTreeItem tries to click the content pane in the background
|
||||
await page.locator('#treePicker >> [data-element="tree-item-UrlPickerContent"]').click();
|
||||
await page.locator('.umb-editor-footer-content__right-side > [button-style="success"] > .umb-button > .btn > .umb-button__content').click();
|
||||
await expect(await page.locator('.umb-node-preview__name').first()).toBeVisible();
|
||||
|
||||
await page.locator('[data-element="editor-container"]').locator('[data-element="tree-item-UrlPickerContent"]').click();
|
||||
await expect(page.locator('[alias="urlLinkPicker"]').locator('input[id="urlLinkPicker"]')).toHaveValue('/');
|
||||
await page.locator('.umb-editor-footer-content__right-side').locator('[label-key="' + ConstantHelper.buttons.submit + '"]').click();
|
||||
await expect(page.locator('.umb-node-preview__name').first()).toBeVisible();
|
||||
|
||||
// Save and publish
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
|
||||
|
||||
@@ -59,19 +59,19 @@ test.describe('Languages', () => {
|
||||
await expect(doesExistEN).toBe(true);
|
||||
|
||||
// Delete UK Language
|
||||
await page.locator('umb-button[label-key="general_delete"]').last().click();
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey('contentTypeEditor_yesDelete'));
|
||||
await page.getByRole('button', {name: language2}).locator('[label-key=' + ConstantHelper.buttons.delete + ']').click();
|
||||
await umbracoUi.clickDataElementByElementName('button-overlaySubmit');
|
||||
|
||||
// Assert the da language still exists and that the uk is deleted
|
||||
// DA
|
||||
doesExistDA = await umbracoApi.languages.exists(language1);
|
||||
await expect(doesExistDA).toBe(true);
|
||||
// EN
|
||||
await expect(page.getByRole('button', {name: language2})).not.toBeVisible();
|
||||
doesExistEN = await umbracoApi.languages.exists(language2);
|
||||
await expect(doesExistEN).toBe(false);
|
||||
|
||||
// Cleanup
|
||||
await umbracoApi.languages.ensureCultureNotExists(language1);
|
||||
await umbracoApi.languages.ensureCultureNotExists(language2);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,7 +7,13 @@ test.describe('Media', () => {
|
||||
await umbracoApi.report.report(testInfo);
|
||||
await umbracoApi.login();
|
||||
await umbracoUi.goToSection(ConstantHelper.sections.media);
|
||||
await umbracoApi.media.deleteAllMedia()
|
||||
await umbracoApi.media.deleteAllMedia();
|
||||
await umbracoApi.media.clearRecycleBin();
|
||||
});
|
||||
|
||||
test.afterEach(async ({page, umbracoApi, umbracoUi}, testInfo) => {
|
||||
await umbracoApi.media.deleteAllMedia();
|
||||
await umbracoApi.media.clearRecycleBin();
|
||||
});
|
||||
|
||||
test('move one of each Files into a Folder', async ({page, umbracoApi, umbracoUi}) => {
|
||||
@@ -28,10 +34,7 @@ test.describe('Media', () => {
|
||||
{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);
|
||||
@@ -60,20 +63,13 @@ test.describe('Media', () => {
|
||||
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';
|
||||
const FolderNameC = 'C';
|
||||
await umbracoApi.media.ensureNameNotExists(FolderNameA);
|
||||
await umbracoApi.media.ensureNameNotExists(FolderNameB);
|
||||
await umbracoApi.media.ensureNameNotExists(FolderNameC);
|
||||
|
||||
|
||||
// Action
|
||||
await umbracoApi.media.createDefaultFolder(FolderNameC);
|
||||
await umbracoApi.media.createDefaultFolder(FolderNameB);
|
||||
@@ -88,16 +84,10 @@ test.describe('Media', () => {
|
||||
// Assert
|
||||
const item = await page.locator('[ui-sortable="vm.sortableOptions"]').locator("xpath=/*[1]")
|
||||
await expect(item).toContainText(FolderNameA);
|
||||
|
||||
// Clean
|
||||
await umbracoApi.media.ensureNameNotExists(FolderNameA);
|
||||
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)
|
||||
@@ -106,16 +96,11 @@ test.describe('Media', () => {
|
||||
|
||||
// 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);
|
||||
@@ -126,17 +111,11 @@ test.describe('Media', () => {
|
||||
|
||||
// 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);
|
||||
@@ -150,9 +129,5 @@ test.describe('Media', () => {
|
||||
|
||||
// Assert
|
||||
await expect(page.locator('[icon="icon-thumbnails-small"]')).toBeVisible();
|
||||
|
||||
// Clean
|
||||
await umbracoApi.media.ensureNameNotExists(FolderOneName);
|
||||
await umbracoApi.media.ensureNameNotExists(FolderTwoName);
|
||||
});
|
||||
});
|
||||
@@ -193,7 +193,9 @@ test.describe('Modelsbuilder tests', () => {
|
||||
await umbracoApi.templates.ensureNameNotExists(docTypeName);
|
||||
});
|
||||
|
||||
test('Can update view and document type', async ({page, umbracoApi, umbracoUi}) => {
|
||||
test('Can update view and document type', async ({page, umbracoApi, umbracoUi},testInfo) => {
|
||||
await testInfo.slow();
|
||||
|
||||
const docTypeName = "TestDocument";
|
||||
const docTypeAlias = AliasHelper.toAlias(docTypeName);
|
||||
const propertyAlias = "title";
|
||||
@@ -263,7 +265,7 @@ test.describe('Modelsbuilder tests', () => {
|
||||
// We only have to type out the opening tag, the editor adds the closing tag automatically.
|
||||
await editor.type("<p>@Model.Bod");
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));
|
||||
await umbracoUi.isSuccessNotificationVisible({timeout: 10000});
|
||||
await umbracoUi.isSuccessNotificationVisible({timeout: 20000});
|
||||
await page.locator('span:has-text("×")').click();
|
||||
|
||||
// Navigate to the content section and update the content
|
||||
@@ -273,6 +275,8 @@ test.describe('Modelsbuilder tests', () => {
|
||||
await page.locator("#bod").type("Fancy body text");
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await umbracoApi.content.verifyRenderedContent("/", "<h1>" + propertyValue + "</h1><p>Fancy body text</p>", true);
|
||||
|
||||
await umbracoApi.content.deleteAllContent();
|
||||
|
||||
@@ -79,6 +79,7 @@ test.describe('Packages', () => {
|
||||
// Fill out package creation form
|
||||
// Waits until the element package Content is visible
|
||||
await page.locator('[key="packager_packageContent"]').isVisible();
|
||||
await expect(page.locator('[label="@treeHeaders_documentTypes"]').locator('[text="' + rootDocTypeName + '"]')).toBeVisible();
|
||||
await page.locator("#headerName").type(packageName);
|
||||
await page.locator('.controls > .umb-node-preview-add').click();
|
||||
await page.locator('.umb-tree-item__label').first().click();
|
||||
|
||||
@@ -23,7 +23,7 @@ test.describe('Partial Views', () => {
|
||||
const name = "TestPartialView";
|
||||
const fileName = name + ".cshtml";
|
||||
|
||||
await umbracoApi.partialViews.ensureNameNotExists(fileName);
|
||||
await umbracoApi.partialViews.ensureNameNotExists('', fileName);
|
||||
|
||||
await openPartialViewsCreatePanel(page, umbracoUi);
|
||||
|
||||
@@ -31,23 +31,23 @@ test.describe('Partial Views', () => {
|
||||
await page.locator('.menu-label localize[key="create_newEmptyPartialView"]').click();
|
||||
|
||||
//Type name
|
||||
await umbracoUi.setEditorHeaderName(name);
|
||||
await page.locator('[data-element="editor-name-field"]').type(name);
|
||||
|
||||
//Save
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));
|
||||
|
||||
//Assert
|
||||
await umbracoUi.isSuccessNotificationVisible({timeout:10000});
|
||||
await umbracoUi.isSuccessNotificationVisible({timeout: 20000});
|
||||
|
||||
//Clean up
|
||||
await umbracoApi.partialViews.ensureNameNotExists(fileName);
|
||||
await umbracoApi.partialViews.ensureNameNotExists('', fileName);
|
||||
});
|
||||
|
||||
test('Create partial view from snippet', async ({page, umbracoApi, umbracoUi}) => {
|
||||
const name = "TestPartialViewFromSnippet";
|
||||
const fileName = name + ".cshtml";
|
||||
|
||||
await umbracoApi.partialViews.ensureNameNotExists(fileName);
|
||||
await umbracoApi.partialViews.ensureNameNotExists('', fileName);
|
||||
|
||||
await openPartialViewsCreatePanel(page, umbracoUi);
|
||||
|
||||
@@ -63,10 +63,10 @@ test.describe('Partial Views', () => {
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));
|
||||
|
||||
// Assert
|
||||
await umbracoUi.isSuccessNotificationVisible({timeout:10000});
|
||||
await umbracoUi.isSuccessNotificationVisible({timeout:20000});
|
||||
|
||||
// Clean up
|
||||
await umbracoApi.partialViews.ensureNameNotExists(fileName);
|
||||
await umbracoApi.partialViews.ensureNameNotExists('', fileName);
|
||||
});
|
||||
|
||||
test('Partial view with no name', async ({page, umbracoApi, umbracoUi}) => {
|
||||
@@ -90,7 +90,7 @@ test.describe('Partial Views', () => {
|
||||
const name = "TestDeletePartialView";
|
||||
const fileName = name + ".cshtml";
|
||||
|
||||
await umbracoApi.partialViews.ensureNameNotExists(fileName);
|
||||
await umbracoApi.partialViews.ensureNameNotExists('', fileName);
|
||||
|
||||
// Build and save partial view
|
||||
const partialView = new PartialViewBuilder()
|
||||
@@ -111,14 +111,14 @@ test.describe('Partial Views', () => {
|
||||
await expect(await page.locator("body", { hasText: fileName})).not.toBeVisible();
|
||||
|
||||
// Clean
|
||||
await umbracoApi.partialViews.ensureNameNotExists(fileName);
|
||||
await umbracoApi.partialViews.ensureNameNotExists('', fileName);
|
||||
});
|
||||
|
||||
test('Edit partial view', async ({page, umbracoApi, umbracoUi}) => {
|
||||
const name = 'EditPartialView';
|
||||
const fileName = name + ".cshtml";
|
||||
|
||||
await umbracoApi.partialViews.ensureNameNotExists(fileName);
|
||||
await umbracoApi.partialViews.ensureNameNotExists('', fileName);
|
||||
|
||||
const partialView = new PartialViewBuilder()
|
||||
.withName(name)
|
||||
@@ -135,9 +135,9 @@ test.describe('Partial Views', () => {
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));
|
||||
|
||||
// Assert
|
||||
await umbracoUi.isSuccessNotificationVisible({timeout:10000});
|
||||
await umbracoUi.isSuccessNotificationVisible({timeout:20000});
|
||||
|
||||
// Clean
|
||||
await umbracoApi.partialViews.ensureNameNotExists(fileName);
|
||||
await umbracoApi.partialViews.ensureNameNotExists('', fileName);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user