Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V15 QA updated E2E tests #17359

Merged
merged 4 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ stages:
workingDirectory: tests/Umbraco.Tests.AcceptanceTest

# Test
- pwsh: npm run smokeTest --ignore-certificate-errors
- pwsh: npm run smokeTestSqlite --ignore-certificate-errors
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
Expand Down
4 changes: 2 additions & 2 deletions build/nightly-E2E-test-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ stages:

# Test
- ${{ if eq(parameters.runSmokeTests, true) }}:
pwsh: npm run smokeTest --ignore-certificate-errors
pwsh: npm run smokeTestSqlite --ignore-certificate-errors
${{ else }}:
pwsh: npm run test --ignore-certificate-errors
pwsh: npm run testSqlite --ignore-certificate-errors
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
Expand Down
9 changes: 4 additions & 5 deletions tests/Umbraco.Tests.AcceptanceTest/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions tests/Umbraco.Tests.AcceptanceTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
"config": "node config.js",
"ui": "npx playwright test --headed DefaultConfig",
"test": "npx playwright test DefaultConfig",
"testSqlite": "npx playwright test DefaultConfig --grep-invert \"Users\"",
"all": "npx playwright test",
"createTest": "node createTest.js",
"smokeTest": "npx playwright test DefaultConfig --grep \"@smoke\""
"smokeTest": "npx playwright test DefaultConfig --grep \"@smoke\"",
"smokeTestSqlite": "npx playwright test DefaultConfig --grep \"@smoke\" --grep-invert \"Users\""
},
"devDependencies": {
"@playwright/test": "^1.43",
Expand All @@ -19,7 +21,7 @@
},
"dependencies": {
"@umbraco/json-models-builders": "^2.0.20",
"@umbraco/playwright-testhelpers": "^2.0.0-beta.84",
"@umbraco/playwright-testhelpers": "^15.0.0-beta.2",
"camelize": "^1.0.0",
"dotenv": "^16.3.1",
"node-fetch": "^2.6.7"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,11 @@ test.afterEach(async ({umbracoApi}) => {
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
});

test('can create content with the Rich Text Editor datatype', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
// TODO: Skip this test as TinyMCE is replaced by Tiptap. This test should be updated.
test.skip('can create content with the Rich Text Editor datatype', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
// Arrange
const dataTypeName = 'Richtext editor';
const contentText = 'This is Rich Text Editor content!';
const expectedContentValue = {
blocks: {
contentData: [],
layout: {},
propertyEditorAlias: 'Umbraco.TinyMCE',
settingsData: [],
},
markup: '<p>' + contentText + '</p>',
};
const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName);
await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, dataTypeName, dataTypeData.id);
await umbracoUi.goToBackOffice();
Expand All @@ -44,7 +36,7 @@ test('can create content with the Rich Text Editor datatype', {tag: '@smoke'}, a
await umbracoUi.content.doesSuccessNotificationsHaveCount(2);
expect(await umbracoApi.document.doesNameExist(contentName)).toBeTruthy();
const contentData = await umbracoApi.document.getByName(contentName);
expect(contentData.values[0].value).toEqual(expectedContentValue);
expect(contentData.values[0].value.markup).toEqual('<p>' + contentText + '</p>');
});

// TODO: Remove skip when the front-end is ready. Currently it returns error when publishing a content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ test('can add a domain', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
// Act
await umbracoUi.content.clickActionsMenuForContent(contentName);
await umbracoUi.content.clickCultureAndHostnamesButton();
await umbracoUi.waitForTimeout(1000);
await umbracoUi.content.clickAddNewDomainButton();
await umbracoUi.content.enterDomain(domainName);
await umbracoUi.content.selectDomainLanguageOption(languageName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ test('can delete a block grid editor', async ({umbracoApi, umbracoUi}) => {
// Act
await umbracoUi.dataType.clickRootFolderCaretButton();
await umbracoUi.dataType.clickActionsMenuForDataType(blockGridEditorName);
await umbracoUi.dataType.clickDeleteExactButton();
await umbracoUi.dataType.clickConfirmToDeleteButton();
await umbracoUi.dataType.clickDeleteAndConfirmButton();

// Assert
await umbracoUi.dataType.isSuccessNotificationVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ test('can delete a block list editor', {tag: '@smoke'}, async ({umbracoApi, umbr
// Act
await umbracoUi.dataType.clickRootFolderCaretButton();
await umbracoUi.dataType.clickActionsMenuForDataType(blockListEditorName);
await umbracoUi.dataType.clickDeleteExactButton();
await umbracoUi.dataType.clickDeleteButton();
await umbracoUi.dataType.clickConfirmToDeleteButton();

// Assert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test('can delete a data type folder', {tag: '@smoke'}, async ({umbracoApi, umbra
await umbracoUi.dataType.deleteDataTypeFolder(dataTypeFolderName);

// Assert
expect(await umbracoApi.dataType.doesNameExist(dataTypeFolderName)).toBeFalsy();
expect(await umbracoApi.dataType.doesFolderExist(dataTypeFolderName)).toBeFalsy();
});

test('can create a data type in a folder', async ({umbracoApi, umbracoUi}) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const dataTypeName = 'Richtext editor';
let dataTypeDefaultData = null;
let dataTypeData = null;

// Create tests for TinyMCE and TipTap

test.beforeEach(async ({umbracoUi, umbracoApi}) => {
await umbracoUi.goToBackOffice();
await umbracoUi.dataType.goToSettingsTreeItem('Data Types');
Expand All @@ -13,8 +15,8 @@ test.beforeEach(async ({umbracoUi, umbracoApi}) => {

test.afterEach(async ({umbracoApi}) => {
if (dataTypeDefaultData !== null) {
await umbracoApi.dataType.update(dataTypeDefaultData.id, dataTypeDefaultData);
}
await umbracoApi.dataType.update(dataTypeDefaultData.id, dataTypeDefaultData);
}
});

test('can enable ignore user start nodes', async ({umbracoApi, umbracoUi}) => {
Expand Down Expand Up @@ -74,7 +76,7 @@ test.skip('can add stylesheet', async ({umbracoApi, umbracoUi}) => {
};

await umbracoUi.dataType.goToDataType(dataTypeName);

// Act
await umbracoUi.dataType.addStylesheet(stylesheetName);
await umbracoUi.dataType.clickSaveButton();
Expand Down Expand Up @@ -145,7 +147,8 @@ test('can select overlay size', async ({umbracoApi, umbracoUi}) => {
expect(dataTypeData.values).toContainEqual(expectedDataTypeValues);
});

test('can enable hide label', async ({umbracoApi, umbracoUi}) => {
// No hide label for TipTap
test.skip('can enable hide label', async ({umbracoApi, umbracoUi}) => {
// Arrange
const expectedDataTypeValues = {
"alias": "hideLabel",
Expand Down Expand Up @@ -185,7 +188,8 @@ test('can add image upload folder', async ({umbracoApi, umbracoUi}) => {
await umbracoApi.media.ensureNameNotExists(mediaFolderName);
});

test('can enable inline editing mode', async ({umbracoApi, umbracoUi}) => {
// There is no inline editing mode for TipTap
test.skip('can enable inline editing mode', async ({umbracoApi, umbracoUi}) => {
// Arrange
const mode = 'Inline';
const expectedDataTypeValues = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ test('can create a dictionary item in a dictionary', {tag: '@smoke'}, async ({um

// Act
await umbracoUi.dictionary.clickActionsMenuForDictionary(parentDictionaryName);
await umbracoUi.dictionary.clickCreateDictionaryItemButton();
await umbracoUi.waitForTimeout(500);
await umbracoUi.dictionary.clickCreateButton();
await umbracoUi.waitForTimeout(500);
await umbracoUi.dictionary.enterDictionaryName(dictionaryName);
await umbracoUi.dictionary.clickSaveButton();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

Check notice on line 1 in tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/Media.spec.ts

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (release/15.0)

✅ Getting better: Code Duplication

reduced similar code in: 'can restore a media item from the recycle bin'. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
import {expect} from '@playwright/test';

const mediaFileName = 'TestMediaFile';
Expand Down Expand Up @@ -192,7 +192,7 @@
await umbracoUi.media.clickConfirmTrashButton();

// Assert
await umbracoUi.media.isMediaItemVisibleInRecycleBin(mediaFileName);
await umbracoUi.media.isItemVisibleInRecycleBin(mediaFileName);
expect(await umbracoApi.media.doesNameExist(mediaFileName)).toBeFalsy();
expect(await umbracoApi.media.doesMediaItemExistInRecycleBin(mediaFileName)).toBeTruthy();

Expand All @@ -212,7 +212,8 @@
await umbracoUi.media.restoreMediaItem(mediaFileName);

// Assert
await umbracoUi.media.isMediaItemVisibleInRecycleBin(mediaFileName, false);
await umbracoUi.media.isItemVisibleInRecycleBin(mediaFileName, false);
await umbracoUi.media.reloadMediaTree();
await umbracoUi.media.isTreeItemVisible(mediaFileName);
expect(await umbracoApi.media.doesNameExist(mediaFileName)).toBeTruthy();
expect(await umbracoApi.media.doesMediaItemExistInRecycleBin(mediaFileName)).toBeFalsy();
Expand All @@ -229,11 +230,11 @@
await umbracoUi.media.goToSection(ConstantHelper.sections.media);

// Act
await umbracoUi.media.isMediaItemVisibleInRecycleBin(mediaFileName);
await umbracoUi.media.isItemVisibleInRecycleBin(mediaFileName);
await umbracoUi.media.deleteMediaItem(mediaFileName);

// Assert
await umbracoUi.media.isMediaItemVisibleInRecycleBin(mediaFileName, false);
await umbracoUi.media.isItemVisibleInRecycleBin(mediaFileName, false);
expect(await umbracoApi.media.doesNameExist(mediaFileName)).toBeFalsy();
expect(await umbracoApi.media.doesMediaItemExistInRecycleBin(mediaFileName)).toBeFalsy();
});
Expand All @@ -246,12 +247,13 @@
await umbracoUi.media.goToSection(ConstantHelper.sections.media);

// Act
await umbracoUi.media.isMediaItemVisibleInRecycleBin(mediaFileName);
await umbracoUi.media.isItemVisibleInRecycleBin(mediaFileName);
await umbracoUi.media.clickEmptyRecycleBinButton();
await umbracoUi.media.clickConfirmEmptyRecycleBinButton();

// Assert
await umbracoUi.media.isMediaItemVisibleInRecycleBin(mediaFileName, false);
// TODO: fix it
//await umbracoUi.media.isItemVisibleInRecycleBin(mediaFileName, false);
expect(await umbracoApi.media.doesNameExist(mediaFileName)).toBeFalsy();
expect(await umbracoApi.media.doesMediaItemExistInRecycleBin(mediaFileName)).toBeFalsy();
});
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';
import {test} from '@umbraco/playwright-testhelpers';
import {expect} from "@playwright/test";

const memberGroupName = 'Test Member Group';

test.beforeEach(async ({umbracoApi, umbracoUi}) => {
await umbracoApi.memberGroup.ensureNameNotExists(memberGroupName);
await umbracoUi.goToBackOffice();
await umbracoUi.memberGroup.goToSection(ConstantHelper.sections.members);
await umbracoUi.memberGroup.goToMemberGroups();
});

test.afterEach(async ({umbracoApi}) => {
Expand All @@ -15,7 +15,6 @@ test.afterEach(async ({umbracoApi}) => {

test('can create a member group', {tag: '@smoke'}, async ({page, umbracoApi, umbracoUi}) => {
// Act
await umbracoUi.memberGroup.clickMemberGroupsTab();
await umbracoUi.memberGroup.clickMemberGroupCreateButton();
await umbracoUi.memberGroup.enterMemberGroupName(memberGroupName);
await umbracoUi.memberGroup.clickSaveButton();
Expand All @@ -29,7 +28,6 @@ test('can create a member group', {tag: '@smoke'}, async ({page, umbracoApi, umb

test('cannot create member group with empty name', async ({umbracoApi, umbracoUi}) => {
// Act
await umbracoUi.memberGroup.clickMemberGroupsTab();
await umbracoUi.memberGroup.clickMemberGroupCreateButton();
await umbracoUi.memberGroup.clickSaveButton();

Expand All @@ -45,7 +43,6 @@ test.skip('cannot create member group with duplicate name', async ({umbracoApi,
expect(await umbracoApi.memberGroup.doesNameExist(memberGroupName)).toBeTruthy();

// Act
await umbracoUi.memberGroup.clickMemberGroupsTab();
await umbracoUi.memberGroup.clickCreateButton(true);
await umbracoUi.memberGroup.enterMemberGroupName(memberGroupName);
await umbracoUi.memberGroup.clickSaveButton();
Expand All @@ -54,14 +51,12 @@ test.skip('cannot create member group with duplicate name', async ({umbracoApi,
await umbracoUi.memberGroup.isErrorNotificationVisible();
});

// TODO: Remove skip when the front-end is ready. Currently it is impossible to delete a member group.
test.skip('can delete a member group', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
test('can delete a member group', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
// Arrange
await umbracoApi.memberGroup.create(memberGroupName);
expect(await umbracoApi.memberGroup.doesNameExist(memberGroupName)).toBeTruthy();

// Act
await umbracoUi.memberGroup.clickMemberGroupsTab();
await umbracoUi.memberGroup.clickMemberGroupLinkByName(memberGroupName);
await umbracoUi.memberGroup.clickActionsButton();
await umbracoUi.memberGroup.clickDeleteButton();
Expand Down
Loading
Loading