* Added tests for regression issue that cannot create a variant document blueprint * Make tests run in the pipeline * Reverted npm command
This commit is contained in:
@@ -3,13 +3,10 @@ import {expect} from "@playwright/test";
|
|||||||
|
|
||||||
const documentBlueprintName = 'TestDocumentBlueprints';
|
const documentBlueprintName = 'TestDocumentBlueprints';
|
||||||
const documentTypeName = 'DocumentTypeForBlueprint';
|
const documentTypeName = 'DocumentTypeForBlueprint';
|
||||||
let documentTypeId = '';
|
|
||||||
|
|
||||||
test.beforeEach(async ({umbracoApi, umbracoUi}) => {
|
test.beforeEach(async ({umbracoApi}) => {
|
||||||
await umbracoApi.documentBlueprint.ensureNameNotExists(documentBlueprintName);
|
await umbracoApi.documentBlueprint.ensureNameNotExists(documentBlueprintName);
|
||||||
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
|
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
|
||||||
documentTypeId = await umbracoApi.documentType.createDefaultDocumentType(documentTypeName);
|
|
||||||
await umbracoUi.goToBackOffice();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterEach(async ({umbracoApi}) => {
|
test.afterEach(async ({umbracoApi}) => {
|
||||||
@@ -19,6 +16,8 @@ test.afterEach(async ({umbracoApi}) => {
|
|||||||
|
|
||||||
test('can create a document blueprint from the settings menu', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
|
test('can create a document blueprint from the settings menu', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
await umbracoApi.documentType.createDefaultDocumentType(documentTypeName);
|
||||||
|
await umbracoUi.goToBackOffice();
|
||||||
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);
|
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
@@ -29,17 +28,19 @@ test('can create a document blueprint from the settings menu', {tag: '@smoke'},
|
|||||||
await umbracoUi.documentBlueprint.clickSaveButton();
|
await umbracoUi.documentBlueprint.clickSaveButton();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await umbracoUi.documentBlueprint.waitForDocumentBlueprintToBeCreated()
|
await umbracoUi.documentBlueprint.waitForDocumentBlueprintToBeCreated();
|
||||||
expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy();
|
expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy();
|
||||||
await umbracoUi.documentBlueprint.isDocumentBlueprintRootTreeItemVisible(documentBlueprintName, true);
|
await umbracoUi.documentBlueprint.isDocumentBlueprintRootTreeItemVisible(documentBlueprintName, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('can rename a document blueprint', async ({umbracoApi, umbracoUi}) => {
|
test('can rename a document blueprint', async ({umbracoApi, umbracoUi}) => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
const documentTypeId = await umbracoApi.documentType.createDefaultDocumentType(documentTypeName);
|
||||||
const wrongDocumentBlueprintName = 'Wrong Document Blueprint';
|
const wrongDocumentBlueprintName = 'Wrong Document Blueprint';
|
||||||
await umbracoApi.documentBlueprint.ensureNameNotExists(wrongDocumentBlueprintName);
|
await umbracoApi.documentBlueprint.ensureNameNotExists(wrongDocumentBlueprintName);
|
||||||
await umbracoApi.documentBlueprint.createDefaultDocumentBlueprint(wrongDocumentBlueprintName, documentTypeId);
|
await umbracoApi.documentBlueprint.createDefaultDocumentBlueprint(wrongDocumentBlueprintName, documentTypeId);
|
||||||
expect(await umbracoApi.documentBlueprint.doesNameExist(wrongDocumentBlueprintName)).toBeTruthy();
|
expect(await umbracoApi.documentBlueprint.doesNameExist(wrongDocumentBlueprintName)).toBeTruthy();
|
||||||
|
await umbracoUi.goToBackOffice();
|
||||||
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);
|
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
@@ -57,8 +58,10 @@ test('can rename a document blueprint', async ({umbracoApi, umbracoUi}) => {
|
|||||||
|
|
||||||
test('can delete a document blueprint', async ({umbracoApi, umbracoUi}) => {
|
test('can delete a document blueprint', async ({umbracoApi, umbracoUi}) => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
const documentTypeId = await umbracoApi.documentType.createDefaultDocumentType(documentTypeName);
|
||||||
await umbracoApi.documentBlueprint.createDefaultDocumentBlueprint(documentBlueprintName, documentTypeId);
|
await umbracoApi.documentBlueprint.createDefaultDocumentBlueprint(documentBlueprintName, documentTypeId);
|
||||||
expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy();
|
expect(await umbracoApi.documentBlueprint.doesNameExist(documentBlueprintName)).toBeTruthy();
|
||||||
|
await umbracoUi.goToBackOffice();
|
||||||
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);
|
await umbracoUi.documentBlueprint.goToSection(ConstantHelper.sections.settings);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
@@ -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}) => {
|
test('can create a document blueprint from the content menu', async ({umbracoApi, umbracoUi}) => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const documentTypeName = 'DocumentTypeForContent';
|
|
||||||
const documentTypeId = await umbracoApi.documentType.createDefaultDocumentTypeWithAllowAsRoot(documentTypeName);
|
const documentTypeId = await umbracoApi.documentType.createDefaultDocumentTypeWithAllowAsRoot(documentTypeName);
|
||||||
await umbracoApi.document.createDefaultDocument(documentBlueprintName, documentTypeId);
|
await umbracoApi.document.createDefaultDocument(documentBlueprintName, documentTypeId);
|
||||||
|
await umbracoUi.goToBackOffice();
|
||||||
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
|
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
@@ -94,3 +97,29 @@ test('can create a document blueprint from the content menu', async ({umbracoApi
|
|||||||
// Clean
|
// Clean
|
||||||
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
|
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');
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user