Skip to content

V16 Added acceptance tests for the regression issue #19529 #19713

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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 tests/Umbraco.Tests.AcceptanceTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"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/Settings/DocumentBlueprint",
"smokeTestSqlite": "npx playwright test DefaultConfig --grep \"@smoke\" --grep-invert \"Users\""
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import {expect} from "@playwright/test";

const documentBlueprintName = 'TestDocumentBlueprints';
const documentTypeName = 'DocumentTypeForBlueprint';
let documentTypeId = '';

test.beforeEach(async ({umbracoApi, umbracoUi}) => {
test.beforeEach(async ({umbracoApi}) => {
await umbracoApi.documentBlueprint.ensureNameNotExists(documentBlueprintName);
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
documentTypeId = await umbracoApi.documentType.createDefaultDocumentType(documentTypeName);
await umbracoUi.goToBackOffice();
});

test.afterEach(async ({umbracoApi}) => {
Expand All @@ -19,6 +16,8 @@ test.afterEach(async ({umbracoApi}) => {

test('can create a document blueprint from the settings menu', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
// Arrange
await umbracoApi.documentType.createDefaultDocumentType(documentTypeName);
await umbracoUi.goToBackOffice();
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);

// Act
Expand All @@ -29,17 +28,19 @@ test('can create a document blueprint from the settings menu', {tag: '@smoke'},
await umbracoUi.documentBlueprint.clickSaveButton();

// Assert
await umbracoUi.documentBlueprint.waitForDocumentBlueprintToBeCreated()
await umbracoUi.documentBlueprint.waitForDocumentBlueprintToBeCreated();
expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy();
await umbracoUi.documentBlueprint.isDocumentBlueprintRootTreeItemVisible(documentBlueprintName, true);
});

test('can rename a document blueprint', async ({umbracoApi, umbracoUi}) => {
// Arrange
const documentTypeId = await umbracoApi.documentType.createDefaultDocumentType(documentTypeName);
const wrongDocumentBlueprintName = 'Wrong Document Blueprint';
await umbracoApi.documentBlueprint.ensureNameNotExists(wrongDocumentBlueprintName);
await umbracoApi.documentBlueprint.createDefaultDocumentBlueprint(wrongDocumentBlueprintName, documentTypeId);
expect(await umbracoApi.documentBlueprint.doesNameExist(wrongDocumentBlueprintName)).toBeTruthy();
await umbracoUi.goToBackOffice();
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);

// Act
Expand All @@ -57,8 +58,10 @@ test('can rename a document blueprint', async ({umbracoApi, umbracoUi}) => {

test('can delete a document blueprint', async ({umbracoApi, umbracoUi}) => {
// Arrange
const documentTypeId = await umbracoApi.documentType.createDefaultDocumentType(documentTypeName);
await umbracoApi.documentBlueprint.createDefaultDocumentBlueprint(documentBlueprintName, documentTypeId);
expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy();
await umbracoUi.goToBackOffice();
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);

// Act
Expand All @@ -75,9 +78,9 @@ test('can delete a document blueprint', async ({umbracoApi, umbracoUi}) => {

test('can create a document blueprint from the content menu', async ({umbracoApi, umbracoUi}) => {
// Arrange
const documentTypeName = 'DocumentTypeForContent';
const documentTypeId = await umbracoApi.documentType.createDefaultDocumentTypeWithAllowAsRoot(documentTypeName);
await umbracoApi.document.createDefaultDocument(documentBlueprintName, documentTypeId);
await umbracoUi.goToBackOffice();
await umbracoUi.content.goToSection(ConstantHelper.sections.content);

// Act
Expand All @@ -94,3 +97,29 @@ test('can create a document blueprint from the content menu', async ({umbracoApi
// Clean
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
});

test('can create a variant document blueprint', {tag: '@release'}, async ({umbracoApi, umbracoUi}) => {
// Arrange
await umbracoApi.language.createDanishLanguage();
await umbracoApi.documentType.createDocumentTypeWithAllowVaryByCulture(documentTypeName);
await umbracoUi.goToBackOffice();
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);

// Act
await umbracoUi.documentBlueprint.clickActionsMenuAtRoot();
await umbracoUi.documentBlueprint.clickCreateActionMenuOption();
await umbracoUi.documentBlueprint.clickTextButtonWithName(documentTypeName);
await umbracoUi.documentBlueprint.enterDocumentBlueprintName(documentBlueprintName);
await umbracoUi.documentBlueprint.clickSaveButton();

// Assert
await umbracoUi.documentBlueprint.waitForDocumentBlueprintToBeCreated();
expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy();
await umbracoUi.documentBlueprint.isDocumentBlueprintRootTreeItemVisible(documentBlueprintName, true);
await umbracoUi.documentBlueprint.page.on('console', message => {
expect(message.type()).not.toBe('error');
});

// Clean
await umbracoApi.language.ensureIsoCodeNotExists('da');
});