From b833bace1e1cf090b6cded1b2c8a5cdacd334ed5 Mon Sep 17 00:00:00 2001 From: Nhu Dinh <150406148+nhudinh0309@users.noreply.github.com> Date: Tue, 30 Apr 2024 14:11:38 +0700 Subject: [PATCH] V14 QA Fixing failing tests for Partial View (#16181) * Added code to block unnecessary resources * Updated createFolder * Bumped version of test helper * Changed clickCreateButton to clickCreateLink due to UI changes * Bumped version of json builder * Reversed previous code * Removed waitForTimeout * Removed waitForTimeout after login * Bumped version of json builder * Changed delete folder method * Bumped version of test helper * Update create link * Removed waitForTimeout * Added skip tests since currently only can view relations * Added more explicit wait * Removed hard wait * Removed invalid verification step due to paging * Moved get set telemetry level from test to before/after test * Bumped version of test helper * Added smoke tags - not done * Added smoke tags * Fixed merge conflict * Added code to run smoke E2E tests after each build instead of full E2E tests * Updated command to run smoke test * Added more smoke tag * Added reload tree steps * Bumped version * Removed hard waits * Reduced wait time * Reversed hard waits * Set up full test suite in nightly build * Fixed conditions * Changed config * Added more waits * Reversed yaml file * Reversed yaml files * Reversed YAML files * Added .skip for failing tests due to RTE --- .../Umbraco.Tests.AcceptanceTest/package.json | 3 +- .../DefaultConfig/DataType/DataType.spec.ts | 8 ++-- .../DataType/DataTypeFolder.spec.ts | 2 +- .../Dictionary/Dictionary.spec.ts | 6 +-- .../DefaultConfig/LogViewer/LogViewer.spec.ts | 38 ++++++++++------ .../Packages/CreatedPackages.spec.ts | 2 +- .../Settings/PartialView/PartialView.spec.ts | 22 +++++----- .../PartialView/PartialViewFolder.spec.ts | 30 +++++++------ .../Settings/Script/Script.spec.ts | 28 ++++++------ .../Settings/Script/ScriptFolder.spec.ts | 44 +++++++++++-------- .../Settings/Stylesheet/Stylesheet.spec.ts | 36 ++++++++------- .../Stylesheet/StylesheetFolder.spec.ts | 44 +++++++++++-------- .../Settings/Template/Templates.spec.ts | 4 +- .../tests/auth.setup.ts | 2 +- 14 files changed, 150 insertions(+), 119 deletions(-) diff --git a/tests/Umbraco.Tests.AcceptanceTest/package.json b/tests/Umbraco.Tests.AcceptanceTest/package.json index 3139c2d673..6c7fa69d68 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/package.json +++ b/tests/Umbraco.Tests.AcceptanceTest/package.json @@ -7,7 +7,8 @@ "ui": "npx playwright test --headed DefaultConfig", "test": "npx playwright test DefaultConfig", "all": "npx playwright test", - "createTest": "node createTest.js" + "createTest": "node createTest.js", + "smokeTest": "npx playwright test DefaultConfig --grep \"@smoke\"" }, "devDependencies": { "@playwright/test": "^1.43", diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataType.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataType.spec.ts index eb49abb704..ebfaa69a94 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataType.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataType.spec.ts @@ -15,7 +15,7 @@ test.describe('Data Types basic functionalities tests', () => { await umbracoApi.dataType.ensureNameNotExists(dataTypeName); }); - test('can create a data type', async ({umbracoApi, umbracoUi}) => { + test('can create a data type @smoke', async ({umbracoApi, umbracoUi}) => { // Act await umbracoUi.dataType.clickActionsMenuAtRoot(); await umbracoUi.dataType.clickCreateButton(); @@ -28,7 +28,7 @@ test.describe('Data Types basic functionalities tests', () => { expect(await umbracoApi.dataType.doesNameExist(dataTypeName)).toBeTruthy(); }); - test('can update a data type name', async ({umbracoApi, umbracoUi}) => { + test('can update a data type name @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const wrongDataTypeName = 'Wrong Data Type'; await umbracoApi.dataType.ensureNameNotExists(wrongDataTypeName); @@ -45,7 +45,7 @@ test.describe('Data Types basic functionalities tests', () => { expect(await umbracoApi.dataType.doesNameExist(wrongDataTypeName)).toBeFalsy(); }); - test.skip('can delete a data type', async ({umbracoApi, umbracoUi}) => { + test.skip('can delete a data type @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.dataType.create(dataTypeName, editorAlias, []); expect(await umbracoApi.dataType.doesNameExist(dataTypeName)).toBeTruthy(); @@ -59,7 +59,7 @@ test.describe('Data Types basic functionalities tests', () => { expect(await umbracoApi.dataType.doesNameExist(dataTypeName)).toBeFalsy(); }); - test.skip('can change Property Editor in a data type', async ({umbracoApi, umbracoUi}) => { + test.skip('can change Property Editor in a data type @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const updatedEditorName = 'Text Area'; const updatedEditorAlias = 'Umbraco.TextArea'; diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataTypeFolder.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataTypeFolder.spec.ts index af767be8e0..6200fe1e8c 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataTypeFolder.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/DataTypeFolder.spec.ts @@ -48,7 +48,7 @@ test.describe('Data Types Folder tests', () => { expect(await umbracoApi.dataType.doesNameExist(wrongDataTypeFolderName)).toBeFalsy(); }); - test('can delete a data type folder', async ({umbracoApi, umbracoUi}) => { + test('can delete a data type folder @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.dataType.createFolder(dataTypeFolderName); expect(await umbracoApi.dataType.doesNameExist(dataTypeFolderName)).toBeTruthy(); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Dictionary/Dictionary.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Dictionary/Dictionary.spec.ts index 17d955be67..5456bcf576 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Dictionary/Dictionary.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Dictionary/Dictionary.spec.ts @@ -47,7 +47,7 @@ test.describe('Dictionary tests', () => { // TODO: when frontend is ready, verify the new dictionary item is NOT displayed in list view and in tree }); - test.skip('can create a dictionary item in a dictionary', async ({umbracoApi, umbracoUi}) => { + test.skip('can create a dictionary item in a dictionary @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.dictionary.ensureNameNotExists(parentDictionaryName); let parentDictionaryId = await umbracoApi.dictionary.create(parentDictionaryName); @@ -82,7 +82,7 @@ test.describe('Dictionary tests', () => { }); // Remove skip when export function works - test.skip('can export a dictionary item with descendants', async ({umbracoApi, umbracoUi}) => { + test.skip('can export a dictionary item with descendants @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.dictionary.ensureNameNotExists(parentDictionaryName); let parentDictionaryId = await umbracoApi.dictionary.create(parentDictionaryName); @@ -117,7 +117,7 @@ test.describe('Dictionary tests', () => { }); // Remove skip when import function works - test.skip('can import a dictionary item with descendants', async ({umbracoApi, umbracoUi}) => { + test.skip('can import a dictionary item with descendants @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const udtFilePath = './fixtures/dictionary/TestDictionaryWithDescendants.udt'; await umbracoApi.dictionary.ensureNameNotExists(parentDictionaryName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/LogViewer/LogViewer.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/LogViewer/LogViewer.spec.ts index b9917c60cc..52995ffa9f 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/LogViewer/LogViewer.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/LogViewer/LogViewer.spec.ts @@ -1,50 +1,52 @@ -import {ConstantHelper, test} from '@umbraco/playwright-testhelpers'; +import {test} from '@umbraco/playwright-testhelpers'; import {expect} from "@playwright/test"; test.describe('Log Viewer tests', () => { + let startTelemetryLevel = ''; - test.beforeEach(async ({umbracoUi}) => { + test.beforeEach(async ({umbracoApi, umbracoUi}) => { await umbracoUi.goToBackOffice(); await umbracoUi.logViewer.goToSettingsTreeItem('Log Viewer'); + startTelemetryLevel = await umbracoApi.telemetry.getLevel(); }); - test('can search', async ({umbracoApi, umbracoUi}) => { + test.afterEach(async ({umbracoApi}) => { + await umbracoApi.telemetry.setLevel(startTelemetryLevel); + }); + + test('can search @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange - const startTelemetryLevel = await umbracoApi.telemetry.getLevel(); const telemetryLevel = 'Minimal'; await umbracoApi.telemetry.setLevel(telemetryLevel); // Act await umbracoUi.logViewer.clickSearchButton(); + await umbracoUi.logViewer.waitUntilLoadingSpinnerInvisible(); await umbracoUi.logViewer.enterSearchKeyword(telemetryLevel); + await umbracoUi.logViewer.waitUntilLoadingSpinnerInvisible(); // Assert // Checks if there is a log with the telemetry level to minimal - await umbracoUi.waitForTimeout(1000); await umbracoUi.logViewer.doesFirstLogHaveMessage('Telemetry level set to "' + telemetryLevel + '"'); - - // Clean - await umbracoApi.telemetry.setLevel(startTelemetryLevel); + }); - test('can change the search log level', async ({umbracoApi, umbracoUi}) => { + test('can change the search log level', async ({umbracoUi}) => { // Arrange - const logInformation = await umbracoApi.logViewer.getLevelCount(); - const expectedLogCount = Math.min(logInformation.information, 100); const logLevel = 'Information'; // Act await umbracoUi.logViewer.clickSearchButton(); + await umbracoUi.logViewer.waitUntilLoadingSpinnerInvisible(); await umbracoUi.logViewer.selectLogLevel(logLevel); + await umbracoUi.logViewer.waitUntilLoadingSpinnerInvisible(); // Assert // Check if the search log level indicator is visible await umbracoUi.logViewer.doesLogLevelIndicatorDisplay(logLevel); - // Check if the log count matches the expected count - await umbracoUi.logViewer.doesLogLevelCountMatch(logLevel, expectedLogCount); }); - test('can create a saved search', async ({umbracoApi, umbracoUi}) => { + test('can create a saved search @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const searchName = 'TestSavedSearch'; const search = 'test saved search'; @@ -52,7 +54,9 @@ test.describe('Log Viewer tests', () => { // Act await umbracoUi.logViewer.clickSearchButton(); + await umbracoUi.logViewer.waitUntilLoadingSpinnerInvisible(); await umbracoUi.logViewer.enterSearchKeyword(search); + await umbracoUi.logViewer.waitUntilLoadingSpinnerInvisible(); await umbracoUi.logViewer.saveSearch(searchName); // Assert @@ -77,7 +81,9 @@ test.describe('Log Viewer tests', () => { // Act await umbracoUi.logViewer.clickSearchButton(); + await umbracoUi.logViewer.waitUntilLoadingSpinnerInvisible(); await umbracoUi.logViewer.enterSearchKeyword(search); + await umbracoUi.logViewer.waitUntilLoadingSpinnerInvisible(); // Checks if the complex search works before saving it. await umbracoUi.logViewer.doesLogLevelCountMatch('Fatal', expectedLogCountFatal); await umbracoUi.logViewer.doesLogLevelCountMatch('Error', expectedLogCountError); @@ -103,6 +109,7 @@ test.describe('Log Viewer tests', () => { // Act await umbracoUi.logViewer.clickSearchButton(); + await umbracoUi.logViewer.waitUntilLoadingSpinnerInvisible(); await umbracoUi.logViewer.clickSavedSearchesButton(); await umbracoUi.logViewer.removeSavedSearchByName(searchName + ' ' + search); await umbracoUi.logViewer.clickDeleteButton(); @@ -120,7 +127,9 @@ test.describe('Log Viewer tests', () => { // Act await umbracoUi.logViewer.clickSearchButton(); + await umbracoUi.logViewer.waitUntilLoadingSpinnerInvisible(); await umbracoUi.logViewer.enterSearchKeyword(search); + await umbracoUi.logViewer.waitUntilLoadingSpinnerInvisible(); await umbracoUi.logViewer.clickFirstLogSearchResult(); // Assert @@ -182,6 +191,7 @@ test.describe('Log Viewer tests', () => { // Act await umbracoUi.logViewer.clickSavedSearchByName(searchName); + await umbracoUi.logViewer.waitUntilLoadingSpinnerInvisible(); // Assert // Checks if the search has the correct search value diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Packages/CreatedPackages.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Packages/CreatedPackages.spec.ts index 953a3208ac..2c2512010e 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Packages/CreatedPackages.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Packages/CreatedPackages.spec.ts @@ -16,7 +16,7 @@ test.describe('Created packages tests', () => { await umbracoApi.package.ensureNameNotExists(packageName); }); - test.skip('can create a empty package', async ({umbracoUi}) => { + test.skip('can create a empty package @smoke', async ({umbracoUi}) => { // Act await umbracoUi.package.clickCreatePackageButton(); await umbracoUi.package.enterPackageName(packageName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialView.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialView.spec.ts index d917cf2648..08daab83ea 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialView.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialView.spec.ts @@ -18,7 +18,7 @@ test.describe('Partial View tests', () => { await umbracoApi.dictionary.ensureNameNotExists(dictionaryName); }); - test('can create an empty partial view', async ({umbracoApi, umbracoUi}) => { + test('can create an empty partial view @smoke', async ({umbracoApi, umbracoUi}) => { // Act await umbracoUi.partialView.clickActionsMenuAtRoot(); await umbracoUi.partialView.clickCreateButton(); @@ -30,8 +30,7 @@ test.describe('Partial View tests', () => { await umbracoUi.partialView.isSuccessNotificationVisible(); expect(await umbracoApi.partialView.doesNameExist(partialViewFileName)).toBeTruthy(); // Verify the new partial view is displayed under the Partial Views section - await umbracoUi.partialView.clickRootFolderCaretButton(); - await umbracoUi.partialView.isPartialViewTreeItemVisibile(partialViewFileName); + await umbracoUi.partialView.isPartialViewRootTreeItemVisibile(partialViewFileName); }) test('can create a partial view from snippet', async ({umbracoApi, umbracoUi}) => { @@ -64,11 +63,10 @@ test.describe('Partial View tests', () => { } // Verify the new partial view is displayed under the Partial Views section - await umbracoUi.partialView.clickRootFolderCaretButton(); - await umbracoUi.partialView.isPartialViewTreeItemVisibile(partialViewFileName); + await umbracoUi.partialView.isPartialViewRootTreeItemVisibile(partialViewFileName); }); - test('can rename a partial view', async ({umbracoApi, umbracoUi}) => { + test('can rename a partial view @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const wrongPartialViewName = 'WrongName'; const wrongPartialViewFileName = wrongPartialViewName + '.cshtml'; @@ -78,7 +76,7 @@ test.describe('Partial View tests', () => { expect(await umbracoApi.partialView.doesExist(wrongPartialViewFileName)).toBeTruthy(); //Act - await umbracoUi.partialView.clickRootFolderCaretButton(); + await umbracoUi.partialView.reloadPartialViewTree(); await umbracoUi.partialView.clickActionsMenuForPartialView(wrongPartialViewFileName); await umbracoUi.partialView.rename(partialViewName); @@ -87,12 +85,12 @@ test.describe('Partial View tests', () => { expect(await umbracoApi.partialView.doesNameExist(partialViewFileName)).toBeTruthy(); expect(await umbracoApi.partialView.doesNameExist(wrongPartialViewFileName)).toBeFalsy(); // Verify the old partial view is NOT displayed under the Partial Views section - await umbracoUi.partialView.isPartialViewTreeItemVisibile(wrongPartialViewFileName, false); + await umbracoUi.partialView.isPartialViewRootTreeItemVisibile(wrongPartialViewFileName, false); // Verify the new partial view is displayed under the Partial Views section - await umbracoUi.partialView.isPartialViewTreeItemVisibile(partialViewFileName); + await umbracoUi.partialView.isPartialViewRootTreeItemVisibile(partialViewFileName); }); - test('can update a partial view content', async ({umbracoApi, umbracoUi}) => { + test('can update a partial view content @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const updatedPartialViewContent = defaultPartialViewContent + '@{\r\n' + @@ -236,7 +234,7 @@ test.describe('Partial View tests', () => { expect(partialViewData.content).toBe(partialViewContent); }); - test('can delete a partial view', async ({umbracoApi, umbracoUi}) => { + test('can delete a partial view @smoke', async ({umbracoApi, umbracoUi}) => { //Arrange await umbracoApi.partialView.create(partialViewFileName, partialViewFileName, '/'); expect(await umbracoApi.partialView.doesExist(partialViewFileName)).toBeTruthy(); @@ -251,7 +249,7 @@ test.describe('Partial View tests', () => { expect(await umbracoApi.partialView.doesExist(partialViewFileName)).toBeFalsy(); // Verify the partial view is NOT displayed under the Partial Views section await umbracoUi.partialView.clickRootFolderCaretButton(); - await umbracoUi.partialView.isPartialViewTreeItemVisibile(partialViewFileName, false); + await umbracoUi.partialView.isPartialViewRootTreeItemVisibile(partialViewFileName, false); }); // TODO: Remove skip when the front-end is ready. Currently the returned items count is not updated after choosing the root content. diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialViewFolder.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialViewFolder.spec.ts index 692750bb25..0a3cf05e65 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialViewFolder.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialViewFolder.spec.ts @@ -9,7 +9,6 @@ test.describe('Partial View Folder tests', () => { test.beforeEach(async ({umbracoUi, umbracoApi}) => { await umbracoApi.partialView.ensureNameNotExists(folderName); await umbracoUi.goToBackOffice(); - await umbracoUi.partialView.goToSection(ConstantHelper.sections.settings); }); test.afterEach(async ({umbracoApi}) => { @@ -18,6 +17,7 @@ test.describe('Partial View Folder tests', () => { test('can create a folder', async ({umbracoApi, umbracoUi}) => { // Act + await umbracoUi.partialView.goToSection(ConstantHelper.sections.settings); await umbracoUi.partialView.clickActionsMenuAtRoot(); await umbracoUi.partialView.createFolder(folderName); @@ -26,16 +26,17 @@ test.describe('Partial View Folder tests', () => { expect(await umbracoApi.partialView.doesFolderExist(folderName)).toBeTruthy(); // Verify the partial view folder is displayed under the Partial Views section await umbracoUi.partialView.clickRootFolderCaretButton(); - await umbracoUi.partialView.isPartialViewTreeItemVisibile(folderName); + await umbracoUi.partialView.isPartialViewRootTreeItemVisibile(folderName); }); - test('can delete a folder', async ({umbracoApi, umbracoUi}) => { + test('can delete a folder @smoke', async ({umbracoApi, umbracoUi}) => { //Arrange await umbracoApi.partialView.createFolder(folderName); expect(await umbracoApi.partialView.doesFolderExist(folderName)).toBeTruthy(); // Act - await umbracoUi.partialView.clickRootFolderCaretButton(); + await umbracoUi.partialView.goToSection(ConstantHelper.sections.settings); + await umbracoUi.partialView.reloadPartialViewTree(); await umbracoUi.partialView.clickActionsMenuForPartialView(folderName); await umbracoUi.partialView.deleteFolder(); @@ -44,7 +45,7 @@ test.describe('Partial View Folder tests', () => { expect(await umbracoApi.partialView.doesFolderExist(folderName)).toBeFalsy(); // Verify the partial view folder is NOT displayed under the Partial Views section await umbracoUi.partialView.clickRootFolderCaretButton(); - await umbracoUi.partialView.isPartialViewTreeItemVisibile(folderName, false); + await umbracoUi.partialView.isPartialViewRootTreeItemVisibile(folderName, false); }); test('can place a partial view into folder', async ({umbracoApi, umbracoUi}) => { @@ -54,7 +55,8 @@ test.describe('Partial View Folder tests', () => { expect(await umbracoApi.partialView.doesFolderExist(folderName)).toBeTruthy(); // Act - await umbracoUi.partialView.clickRootFolderCaretButton(); + await umbracoUi.partialView.goToSection(ConstantHelper.sections.settings); + await umbracoUi.partialView.reloadPartialViewTree(); await umbracoUi.partialView.clickActionsMenuForPartialView(folderName); await umbracoUi.partialView.clickCreateButton(); await umbracoUi.partialView.clickNewEmptyPartialViewButton(); @@ -66,9 +68,9 @@ test.describe('Partial View Folder tests', () => { const childrenData = await umbracoApi.partialView.getChildren(folderPath); expect(childrenData[0].name).toEqual(partialViewFileName); // Verify the partial view is displayed in the folder under the Partial Views section - await umbracoUi.partialView.isPartialViewTreeItemVisibile(partialViewFileName, false); + await umbracoUi.partialView.isPartialViewRootTreeItemVisibile(partialViewFileName, false); await umbracoUi.partialView.clickCaretButtonForName(folderName); - await umbracoUi.partialView.isPartialViewTreeItemVisibile(partialViewFileName); + await umbracoUi.partialView.isPartialViewRootTreeItemVisibile(partialViewFileName); }); test('can create a folder in a folder', async ({umbracoApi, umbracoUi}) => { @@ -77,7 +79,8 @@ test.describe('Partial View Folder tests', () => { const childFolderName = 'childFolderName'; // Act - await umbracoUi.partialView.clickRootFolderCaretButton(); + await umbracoUi.partialView.goToSection(ConstantHelper.sections.settings); + await umbracoUi.partialView.reloadPartialViewTree(); await umbracoUi.partialView.clickActionsMenuForPartialView(folderName); await umbracoUi.partialView.createFolder(childFolderName); @@ -87,10 +90,10 @@ test.describe('Partial View Folder tests', () => { const partialViewChildren = await umbracoApi.partialView.getChildren('/' + folderName); expect(partialViewChildren[0].path).toBe('/' + folderName + '/' + childFolderName); await umbracoUi.partialView.clickCaretButtonForName(folderName); - await umbracoUi.partialView.isPartialViewTreeItemVisibile(childFolderName); + await umbracoUi.partialView.isPartialViewRootTreeItemVisibile(childFolderName); }); - test('can create a folder in a folder in a folder', async ({umbracoApi, umbracoUi}) => { + test('can create a folder in a folder in a folder @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const childFolderName = 'ChildFolderName'; const childOfChildFolderName = 'ChildOfChildFolderName'; @@ -98,7 +101,8 @@ test.describe('Partial View Folder tests', () => { await umbracoApi.partialView.createFolder(childFolderName, folderName); // Act - await umbracoUi.partialView.clickRootFolderCaretButton(); + await umbracoUi.partialView.goToSection(ConstantHelper.sections.settings); + await umbracoUi.partialView.reloadPartialViewTree(); await umbracoUi.partialView.clickCaretButtonForName(folderName); await umbracoUi.partialView.clickActionsMenuForPartialView(childFolderName); await umbracoUi.partialView.createFolder(childOfChildFolderName); @@ -109,6 +113,6 @@ test.describe('Partial View Folder tests', () => { const partialViewChildren = await umbracoApi.partialView.getChildren('/' + folderName + '/' + childFolderName); expect(partialViewChildren[0].path).toBe('/' + folderName + '/' + childFolderName + '/' + childOfChildFolderName); await umbracoUi.partialView.clickCaretButtonForName(childFolderName); - await umbracoUi.partialView.isPartialViewTreeItemVisibile(childOfChildFolderName); + await umbracoUi.partialView.isPartialViewRootTreeItemVisibile(childOfChildFolderName); }); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/Script.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/Script.spec.ts index 720a3e6637..be625e0dc2 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/Script.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/Script.spec.ts @@ -7,7 +7,6 @@ test.describe('Script tests', () => { test.beforeEach(async ({umbracoUi, umbracoApi}) => { await umbracoUi.goToBackOffice(); - await umbracoUi.script.goToSection(ConstantHelper.sections.settings); await umbracoApi.script.ensureNameNotExists(scriptName); }); @@ -15,8 +14,9 @@ test.describe('Script tests', () => { await umbracoApi.script.ensureNameNotExists(scriptName); }); - test.skip('can create a empty script', async ({umbracoApi, umbracoUi}) => { + test('can create a empty script @smoke', async ({umbracoApi, umbracoUi}) => { // Act + await umbracoUi.script.goToSection(ConstantHelper.sections.settings); await umbracoUi.script.clickActionsMenuAtRoot(); await umbracoUi.script.clickCreateButton(); await umbracoUi.script.clickNewJavascriptFileButton(); @@ -26,15 +26,15 @@ test.describe('Script tests', () => { // Assert await umbracoUi.script.isSuccessNotificationVisible(); expect(await umbracoApi.script.doesNameExist(scriptName)).toBeTruthy(); - await umbracoUi.script.clickRootFolderCaretButton(); - await umbracoUi.script.isScriptTreeItemVisible(scriptName); + await umbracoUi.script.isScriptRootTreeItemVisible(scriptName); }); - test.skip('can create a script with content', async ({umbracoApi, umbracoUi}) => { + test('can create a script with content', async ({umbracoApi, umbracoUi}) => { // Arrange const scriptContent = 'TestContent'; // Act + await umbracoUi.script.goToSection(ConstantHelper.sections.settings); await umbracoUi.script.clickActionsMenuAtRoot(); await umbracoUi.script.clickCreateButton(); await umbracoUi.script.clickNewJavascriptFileButton(); @@ -47,16 +47,16 @@ test.describe('Script tests', () => { expect(await umbracoApi.script.doesNameExist(scriptName)).toBeTruthy(); const scriptData = await umbracoApi.script.getByName(scriptName); expect(scriptData.content).toBe(scriptContent); - await umbracoUi.script.clickRootFolderCaretButton(); - await umbracoUi.script.isScriptTreeItemVisible(scriptName); + await umbracoUi.script.isScriptRootTreeItemVisible(scriptName); }); - test.skip('can update a script', async ({umbracoApi, umbracoUi}) => { + test('can update a script @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.script.create(scriptName, 'test'); const updatedScriptContent = 'const test = {\r\n script = \u0022Test\u0022,\r\n extension = \u0022.js\u0022,\r\n scriptPath: function() {\r\n return this.script \u002B this.extension;\r\n }\r\n};\r\n'; // Act + await umbracoUi.script.goToSection(ConstantHelper.sections.settings); await umbracoUi.script.openScriptAtRoot(scriptName); await umbracoUi.script.enterScriptContent(updatedScriptContent); await umbracoUi.script.clickSaveButton(); @@ -67,28 +67,30 @@ test.describe('Script tests', () => { expect(updatedScript.content).toBe(updatedScriptContent); }); - test.skip('can delete a script', async ({umbracoApi, umbracoUi}) => { + test('can delete a script @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.script.create(scriptName, ''); // Act - await umbracoUi.script.clickRootFolderCaretButton(); + await umbracoUi.script.goToSection(ConstantHelper.sections.settings); + await umbracoUi.script.reloadScriptTree(); await umbracoUi.script.clickActionsMenuForScript(scriptName); await umbracoUi.script.clickDeleteAndConfirmButton(); // Assert await umbracoUi.script.isSuccessNotificationVisible(); expect(await umbracoApi.script.doesNameExist(scriptName)).toBeFalsy(); - await umbracoUi.script.isScriptTreeItemVisible(scriptName, false); + await umbracoUi.script.isScriptRootTreeItemVisible(scriptName, false); }); - test.skip('can rename a script', async ({umbracoApi, umbracoUi}) => { + test('can rename a script', async ({umbracoApi, umbracoUi}) => { // Arrange const wrongScriptName = 'WrongTestScript.js'; + await umbracoApi.script.ensureNameNotExists(wrongScriptName); await umbracoApi.script.create(wrongScriptName, ''); // Act - await umbracoUi.script.clickRootFolderCaretButton(); + await umbracoUi.script.goToScript(wrongScriptName); await umbracoUi.script.clickActionsMenuForScript(wrongScriptName); await umbracoUi.script.rename(scriptName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/ScriptFolder.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/ScriptFolder.spec.ts index ca81e69465..9874baa05b 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/ScriptFolder.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Script/ScriptFolder.spec.ts @@ -7,7 +7,6 @@ test.describe('Script tests', () => { test.beforeEach(async ({umbracoUi, umbracoApi}) => { await umbracoUi.goToBackOffice(); - await umbracoUi.script.goToSection(ConstantHelper.sections.settings); await umbracoApi.script.ensureNameNotExists(scriptFolderName); }); @@ -15,40 +14,44 @@ test.describe('Script tests', () => { await umbracoApi.script.ensureNameNotExists(scriptFolderName); }); - test.skip('can create a folder', async ({umbracoApi, umbracoUi}) => { + test('can create a folder @smoke', async ({umbracoApi, umbracoUi}) => { // Act + await umbracoUi.script.goToSection(ConstantHelper.sections.settings); await umbracoUi.script.clickActionsMenuAtRoot(); await umbracoUi.script.createFolder(scriptFolderName); + // TODO: remove it later + await umbracoUi.waitForTimeout(1000); // Assert await umbracoUi.script.isSuccessNotificationVisible(); expect(await umbracoApi.script.doesFolderExist(scriptFolderName)).toBeTruthy(); - await umbracoUi.script.clickRootFolderCaretButton(); - await umbracoUi.script.isScriptTreeItemVisible(scriptFolderName); + await umbracoUi.script.isScriptRootTreeItemVisible(scriptFolderName); }); - test.skip('can delete a folder', async ({umbracoApi, umbracoUi}) => { + test('can delete a folder @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.script.createFolder(scriptFolderName); // Act - await umbracoUi.script.clickRootFolderCaretButton(); + await umbracoUi.script.goToSection(ConstantHelper.sections.settings); + await umbracoUi.script.reloadScriptTree(); await umbracoUi.script.clickActionsMenuForScript(scriptFolderName); await umbracoUi.script.deleteFolder(); // Assert await umbracoUi.script.isSuccessNotificationVisible(); expect(await umbracoApi.script.doesFolderExist(scriptFolderName)).toBeFalsy(); - await umbracoUi.script.isScriptTreeItemVisible(scriptFolderName, false); + await umbracoUi.script.isScriptRootTreeItemVisible(scriptFolderName, false); }); - test.skip('can create a script in a folder', async ({umbracoApi, umbracoUi}) => { + test('can create a script in a folder', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.script.createFolder(scriptFolderName); const scriptContent = 'const test = {\r\n script = \u0022Test\u0022,\r\n extension = \u0022.js\u0022,\r\n scriptPath: function() {\r\n return this.script \u002B this.extension;\r\n }\r\n};\r\n'; // Act - await umbracoUi.script.clickRootFolderCaretButton(); + await umbracoUi.script.goToSection(ConstantHelper.sections.settings); + await umbracoUi.script.reloadScriptTree(); await umbracoUi.script.clickActionsMenuForScript(scriptFolderName); await umbracoUi.script.clickCreateButton(); await umbracoUi.script.clickNewJavascriptFileButton(); @@ -64,16 +67,17 @@ test.describe('Script tests', () => { const scriptData = await umbracoApi.script.get(scriptChildren[0].path); expect(scriptData.content).toBe(scriptContent); await umbracoUi.stylesheet.clickCaretButtonForName(scriptFolderName); - await umbracoUi.script.isScriptTreeItemVisible(scriptName); + await umbracoUi.script.isScriptRootTreeItemVisible(scriptName); }); - test.skip('can create a folder in a folder', async ({umbracoApi, umbracoUi}) => { + test('can create a folder in a folder', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.script.createFolder(scriptFolderName); const childFolderName = 'childFolderName'; // Act - await umbracoUi.script.clickRootFolderCaretButton(); + await umbracoUi.script.goToSection(ConstantHelper.sections.settings); + await umbracoUi.script.reloadScriptTree(); await umbracoUi.script.clickActionsMenuForScript(scriptFolderName); await umbracoUi.script.createFolder(childFolderName); @@ -83,10 +87,10 @@ test.describe('Script tests', () => { const scriptChildren = await umbracoApi.script.getChildren('/' + scriptFolderName); expect(scriptChildren[0].path).toBe('/' + scriptFolderName + '/' + childFolderName); await umbracoUi.stylesheet.clickCaretButtonForName(scriptFolderName); - await umbracoUi.script.isScriptTreeItemVisible(childFolderName); + await umbracoUi.script.isScriptRootTreeItemVisible(childFolderName); }); - test.skip('can create a folder in a folder in a folder', async ({umbracoApi, umbracoUi}) => { + test('can create a folder in a folder in a folder @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const childFolderName = 'ChildFolderName'; const childOfChildFolderName = 'ChildOfChildFolderName'; @@ -94,7 +98,8 @@ test.describe('Script tests', () => { await umbracoApi.script.createFolder(childFolderName, scriptFolderName); // Act - await umbracoUi.script.clickRootFolderCaretButton(); + await umbracoUi.script.goToSection(ConstantHelper.sections.settings); + await umbracoUi.script.reloadScriptTree(); await umbracoUi.script.clickCaretButtonForName(scriptFolderName); await umbracoUi.script.clickActionsMenuForScript(childFolderName); await umbracoUi.script.createFolder(childOfChildFolderName); @@ -105,17 +110,18 @@ test.describe('Script tests', () => { const scriptChildren = await umbracoApi.script.getChildren('/' + scriptFolderName + '/' + childFolderName); expect(scriptChildren[0].path).toBe('/' + scriptFolderName + '/' + childFolderName + '/' + childOfChildFolderName); await umbracoUi.stylesheet.clickCaretButtonForName(childFolderName); - await umbracoUi.script.isScriptTreeItemVisible(childOfChildFolderName); + await umbracoUi.script.isScriptRootTreeItemVisible(childOfChildFolderName); }); - test.skip('can create a script in a folder in a folder', async ({umbracoApi, umbracoUi}) => { + test('can create a script in a folder in a folder', async ({umbracoApi, umbracoUi}) => { // Arrange const childFolderName = 'ChildFolderName'; await umbracoApi.script.createFolder(scriptFolderName); await umbracoApi.script.createFolder(childFolderName, scriptFolderName); // Act - await umbracoUi.script.clickRootFolderCaretButton(); + await umbracoUi.script.goToSection(ConstantHelper.sections.settings); + await umbracoUi.script.reloadScriptTree(); await umbracoUi.script.clickCaretButtonForName(scriptFolderName); await umbracoUi.script.clickActionsMenuForScript(childFolderName); await umbracoUi.script.clickCreateButton(); @@ -129,6 +135,6 @@ test.describe('Script tests', () => { const scriptChildren = await umbracoApi.script.getChildren('/' + scriptFolderName + '/' + childFolderName); expect(scriptChildren[0].path).toBe('/' + scriptFolderName + '/' + childFolderName + '/' + scriptName); await umbracoUi.stylesheet.clickCaretButtonForName(childFolderName); - await umbracoUi.script.isScriptTreeItemVisible(scriptName); + await umbracoUi.script.isScriptRootTreeItemVisible(scriptName); }); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/Stylesheet.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/Stylesheet.spec.ts index 166163608d..55f2e06aa5 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/Stylesheet.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/Stylesheet.spec.ts @@ -9,7 +9,6 @@ test.describe('Stylesheets tests', () => { test.beforeEach(async ({umbracoUi,umbracoApi}) => { await umbracoUi.goToBackOffice(); - await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); await umbracoApi.stylesheet.ensureNameNotExists(stylesheetName); }); @@ -17,8 +16,9 @@ test.describe('Stylesheets tests', () => { await umbracoApi.stylesheet.ensureNameNotExists(stylesheetName); }); - test.skip('can create a empty stylesheet', async ({umbracoApi, umbracoUi}) => { + test('can create a empty stylesheet @smoke', async ({umbracoApi, umbracoUi}) => { // Act + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); await umbracoUi.stylesheet.clickActionsMenuAtRoot(); await umbracoUi.stylesheet.clickCreateButton(); await umbracoUi.stylesheet.clickNewStylesheetButton(); @@ -28,15 +28,15 @@ test.describe('Stylesheets tests', () => { // Assert await umbracoUi.stylesheet.isSuccessNotificationVisible(); expect(await umbracoApi.stylesheet.doesNameExist(stylesheetName)).toBeTruthy(); - await umbracoUi.stylesheet.clickRootFolderCaretButton(); - await umbracoUi.stylesheet.isStylesheetTreeItemVisibile(stylesheetName); + await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(stylesheetName); }); - test.skip('can create a stylesheet with content', async ({umbracoApi, umbracoUi}) => { + test('can create a stylesheet with content', async ({umbracoApi, umbracoUi}) => { // Arrange const stylesheetContent = 'TestContent'; //Act + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); await umbracoUi.stylesheet.clickActionsMenuAtRoot(); await umbracoUi.stylesheet.clickCreateButton(); await umbracoUi.stylesheet.clickNewStylesheetButton(); @@ -49,15 +49,15 @@ test.describe('Stylesheets tests', () => { expect(await umbracoApi.stylesheet.doesNameExist(stylesheetName)).toBeTruthy(); const stylesheetData = await umbracoApi.stylesheet.getByName(stylesheetName); expect(stylesheetData.content).toEqual(stylesheetContent); - await umbracoUi.stylesheet.clickRootFolderCaretButton(); - await umbracoUi.stylesheet.isStylesheetTreeItemVisibile(stylesheetName); + await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(stylesheetName); }); - test.skip('can create a new Rich Text Editor stylesheet file', async ({umbracoApi, umbracoUi}) => { + test.skip('can create a new Rich Text Editor stylesheet file @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const stylesheetContent = '/**umb_name:' + styleName + '*/\n' + styleSelector + ' {\n\t' + styleStyles + '\n}'; //Act + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); await umbracoUi.stylesheet.clickActionsMenuAtRoot(); await umbracoUi.stylesheet.clickCreateButton(); await umbracoUi.stylesheet.clickNewRichTextEditorStylesheetButton(); @@ -70,17 +70,17 @@ test.describe('Stylesheets tests', () => { expect(await umbracoApi.stylesheet.doesExist(stylesheetName)).toBeTruthy(); const stylesheetData = await umbracoApi.stylesheet.getByName(stylesheetName); expect(stylesheetData.content).toEqual(stylesheetContent); - await umbracoUi.stylesheet.clickRootFolderCaretButton(); - await umbracoUi.stylesheet.isStylesheetTreeItemVisibile(stylesheetName); + await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(stylesheetName); }); - test.skip('can update a stylesheet', async ({umbracoApi, umbracoUi}) => { + test.skip('can update a stylesheet @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const stylesheetContent = '/**umb_name:' + styleName + '*/\n' + styleSelector + ' {\n\t' + styleStyles + '\n}'; await umbracoApi.stylesheet.create(stylesheetName, '', '/'); expect(await umbracoApi.stylesheet.doesExist(stylesheetName)).toBeTruthy(); //Act + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); await umbracoUi.stylesheet.openStylesheetByNameAtRoot(stylesheetName); await umbracoUi.stylesheet.addRTEStyle(styleName, styleSelector, styleStyles); await umbracoUi.stylesheet.clickSaveButton(); @@ -91,28 +91,31 @@ test.describe('Stylesheets tests', () => { expect(stylesheetData.content).toEqual(stylesheetContent); }); - test.skip('can delete a stylesheet', async ({umbracoApi, umbracoUi}) => { + test('can delete a stylesheet @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.stylesheet.create(stylesheetName, '', '/'); //Act - await umbracoUi.stylesheet.clickRootFolderCaretButton(); + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); + await umbracoUi.stylesheet.reloadStylesheetTree(); await umbracoUi.stylesheet.clickActionsMenuForStylesheet(stylesheetName); await umbracoUi.stylesheet.clickDeleteAndConfirmButton(); // Assert await umbracoUi.stylesheet.isSuccessNotificationVisible(); expect(await umbracoApi.stylesheet.doesNameExist(stylesheetName)).toBeFalsy(); - await umbracoUi.stylesheet.isStylesheetTreeItemVisibile(stylesheetName, false); + await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(stylesheetName, false); }); - test.skip('can rename a stylesheet', async ({umbracoApi, umbracoUi}) => { + test('can rename a stylesheet @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const wrongStylesheetName = 'WrongStylesheetName.css'; + await umbracoApi.stylesheet.ensureNameNotExists(wrongStylesheetName); await umbracoApi.stylesheet.create(wrongStylesheetName, '', '/'); //Act - await umbracoUi.stylesheet.clickRootFolderCaretButton(); + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); + await umbracoUi.stylesheet.reloadStylesheetTree(); await umbracoUi.stylesheet.clickActionsMenuForStylesheet(wrongStylesheetName); await umbracoUi.stylesheet.rename(stylesheetName); @@ -133,6 +136,7 @@ test.describe('Stylesheets tests', () => { expect(await umbracoApi.stylesheet.doesExist(stylesheetName)).toBeTruthy(); //Act + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); await umbracoUi.stylesheet.openStylesheetByNameAtRoot(stylesheetName); await umbracoUi.stylesheet.editRTEStyle(styleName, newStyleName, newStyleSelector, newStyleStyles); await umbracoUi.stylesheet.clickSaveButton(); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/StylesheetFolder.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/StylesheetFolder.spec.ts index c930bcd38f..a2451ecf60 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/StylesheetFolder.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Stylesheet/StylesheetFolder.spec.ts @@ -7,7 +7,6 @@ test.describe('Stylesheets tests', () => { test.beforeEach(async ({umbracoUi, umbracoApi}) => { await umbracoUi.goToBackOffice(); - await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); await umbracoApi.stylesheet.ensureNameNotExists(stylesheetFolderName); }); @@ -15,40 +14,44 @@ test.describe('Stylesheets tests', () => { await umbracoApi.stylesheet.ensureNameNotExists(stylesheetFolderName); }); - test.skip('can create a folder', async ({umbracoApi, umbracoUi}) => { + test('can create a folder', async ({umbracoApi, umbracoUi}) => { // Act + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); await umbracoUi.stylesheet.clickActionsMenuAtRoot(); await umbracoUi.stylesheet.createFolder(stylesheetFolderName); + // TODO: remove it later + await umbracoUi.waitForTimeout(1000); // Assert await umbracoUi.stylesheet.isSuccessNotificationVisible(); expect(await umbracoApi.stylesheet.doesFolderExist(stylesheetFolderName)).toBeTruthy(); - await umbracoUi.stylesheet.clickRootFolderCaretButton(); - await umbracoUi.stylesheet.isStylesheetTreeItemVisibile(stylesheetFolderName); + await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(stylesheetFolderName); }); - test.skip('can delete a folder', async ({umbracoApi, umbracoUi}) => { + test('can delete a folder @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.stylesheet.createFolder(stylesheetFolderName, ''); // Act - await umbracoUi.stylesheet.clickRootFolderCaretButton(); + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); + await umbracoUi.stylesheet.reloadStylesheetTree(); await umbracoUi.stylesheet.clickActionsMenuForStylesheet(stylesheetFolderName); await umbracoUi.stylesheet.deleteFolder(); // Assert await umbracoUi.stylesheet.isSuccessNotificationVisible(); expect(await umbracoApi.stylesheet.doesFolderExist(stylesheetFolderName)).toBeFalsy(); - await umbracoUi.stylesheet.isStylesheetTreeItemVisibile(stylesheetFolderName, false); + await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(stylesheetFolderName, false); }); - test.skip('can create a folder in a folder', async ({umbracoApi, umbracoUi}) => { + test('can create a folder in a folder', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.stylesheet.createFolder(stylesheetFolderName); const childFolderName = 'ChildFolderName'; // Act - await umbracoUi.stylesheet.clickRootFolderCaretButton(); + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); + await umbracoUi.stylesheet.reloadStylesheetTree(); await umbracoUi.stylesheet.clickActionsMenuForStylesheet(stylesheetFolderName); await umbracoUi.stylesheet.createFolder(childFolderName); @@ -58,10 +61,10 @@ test.describe('Stylesheets tests', () => { const styleChildren = await umbracoApi.stylesheet.getChildren('/' + stylesheetFolderName); expect(styleChildren[0].path).toBe('/' + stylesheetFolderName + '/' + childFolderName); await umbracoUi.stylesheet.clickCaretButtonForName(stylesheetFolderName); - await umbracoUi.stylesheet.isStylesheetTreeItemVisibile(childFolderName); + await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(childFolderName); }); - test.skip('can create a folder in a folder in a folder', async ({umbracoApi, umbracoUi}) => { + test('can create a folder in a folder in a folder @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const childFolderName = 'ChildFolderName'; const childOfChildFolderName = 'ChildOfChildFolderName'; @@ -69,7 +72,8 @@ test.describe('Stylesheets tests', () => { await umbracoApi.stylesheet.createFolder(childFolderName, stylesheetFolderName); // Act - await umbracoUi.stylesheet.clickRootFolderCaretButton(); + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); + await umbracoUi.stylesheet.reloadStylesheetTree(); await umbracoUi.stylesheet.clickCaretButtonForName(stylesheetFolderName); await umbracoUi.stylesheet.clickActionsMenuForStylesheet(childFolderName); await umbracoUi.stylesheet.createFolder(childOfChildFolderName); @@ -80,16 +84,17 @@ test.describe('Stylesheets tests', () => { const styleChildren = await umbracoApi.stylesheet.getChildren('/' + stylesheetFolderName + '/' + childFolderName); expect(styleChildren[0].path).toBe('/' + stylesheetFolderName + '/' + childFolderName + '/' + childOfChildFolderName); await umbracoUi.stylesheet.clickCaretButtonForName(childFolderName); - await umbracoUi.stylesheet.isStylesheetTreeItemVisibile(childOfChildFolderName); + await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(childOfChildFolderName); }); - test.skip('can create a stylesheet in a folder', async ({umbracoApi, umbracoUi}) => { + test('can create a stylesheet in a folder', async ({umbracoApi, umbracoUi}) => { // Arrange await umbracoApi.stylesheet.createFolder(stylesheetFolderName); const stylesheetContent = 'TestContent'; //Act - await umbracoUi.stylesheet.clickRootFolderCaretButton(); + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); + await umbracoUi.stylesheet.reloadStylesheetTree(); await umbracoUi.stylesheet.clickActionsMenuForStylesheet(stylesheetFolderName); await umbracoUi.stylesheet.clickCreateButton(); await umbracoUi.stylesheet.clickNewStylesheetButton(); @@ -105,10 +110,10 @@ test.describe('Stylesheets tests', () => { const stylesheetData = await umbracoApi.stylesheet.get(stylesheetChildren[0].path); expect(stylesheetData.content).toBe(stylesheetContent); await umbracoUi.stylesheet.clickCaretButtonForName(stylesheetFolderName); - await umbracoUi.stylesheet.isStylesheetTreeItemVisibile(stylesheetName); + await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(stylesheetName); }); - test.skip('can create a stylesheet in a folder in a folder', async ({umbracoApi, umbracoUi}) => { + test('can create a stylesheet in a folder in a folder', async ({umbracoApi, umbracoUi}) => { // Arrange const childFolderName = 'ChildFolderName'; await umbracoApi.stylesheet.createFolder(stylesheetFolderName); @@ -116,7 +121,8 @@ test.describe('Stylesheets tests', () => { const stylesheetContent = 'TestContent'; //Act - await umbracoUi.stylesheet.clickRootFolderCaretButton(); + await umbracoUi.stylesheet.goToSection(ConstantHelper.sections.settings); + await umbracoUi.stylesheet.reloadStylesheetTree(); await umbracoUi.stylesheet.clickCaretButtonForName(stylesheetFolderName); await umbracoUi.stylesheet.clickActionsMenuForStylesheet(childFolderName); await umbracoUi.stylesheet.clickCreateButton(); @@ -133,6 +139,6 @@ test.describe('Stylesheets tests', () => { const stylesheetData = await umbracoApi.stylesheet.get(stylesheetChildren[0].path); expect(stylesheetData.content).toBe(stylesheetContent); await umbracoUi.stylesheet.clickCaretButtonForName(childFolderName); - await umbracoUi.stylesheet.isStylesheetTreeItemVisibile(stylesheetName); + await umbracoUi.stylesheet.isStylesheetRootTreeItemVisible(stylesheetName); }); }); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Template/Templates.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Template/Templates.spec.ts index bff04f7bd2..e28b4da360 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Template/Templates.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Template/Templates.spec.ts @@ -14,7 +14,7 @@ test.describe('Template tests', () => { await umbracoApi.template.ensureNameNotExists(templateName); }); - test('can create a template', async ({page, umbracoApi, umbracoUi}) => { + test('can create a template @smoke', async ({page, umbracoApi, umbracoUi}) => { // Arrange await umbracoUi.template.goToSection(ConstantHelper.sections.settings); @@ -30,7 +30,7 @@ test.describe('Template tests', () => { await umbracoUi.template.isTemplateRootTreeItemVisible(templateName); }); - test('can update content of a template', async ({umbracoApi, umbracoUi}) => { + test('can update content of a template @smoke', async ({umbracoApi, umbracoUi}) => { // Arrange const updatedTemplateContent = defaultTemplateContent + '\r\n' + '
AcceptanceTests
'; diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/auth.setup.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/auth.setup.ts index 826181b637..6349efbd99 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/auth.setup.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/auth.setup.ts @@ -11,5 +11,5 @@ setup('authenticate', async ({page}) => { await umbracoUi.login.enterPassword(process.env.UMBRACO_USER_PASSWORD); await umbracoUi.login.clickLoginButton(); await umbracoUi.login.goToSection(ConstantHelper.sections.settings); - await page.context().storageState({path: STORAGE_STATE}); + await umbracoUi.page.context().storageState({path: STORAGE_STATE}); });