@@ -3,13 +3,10 @@ import {expect} from "@playwright/test";
3
3
4
4
const documentBlueprintName = 'TestDocumentBlueprints' ;
5
5
const documentTypeName = 'DocumentTypeForBlueprint' ;
6
- let documentTypeId = '' ;
7
6
8
- test . beforeEach ( async ( { umbracoApi, umbracoUi } ) => {
7
+ test . beforeEach ( async ( { umbracoApi} ) => {
9
8
await umbracoApi . documentBlueprint . ensureNameNotExists ( documentBlueprintName ) ;
10
9
await umbracoApi . documentType . ensureNameNotExists ( documentTypeName ) ;
11
- documentTypeId = await umbracoApi . documentType . createDefaultDocumentType ( documentTypeName ) ;
12
- await umbracoUi . goToBackOffice ( ) ;
13
10
} ) ;
14
11
15
12
test . afterEach ( async ( { umbracoApi} ) => {
@@ -19,6 +16,8 @@ test.afterEach(async ({umbracoApi}) => {
19
16
20
17
test ( 'can create a document blueprint from the settings menu' , { tag : '@smoke' } , async ( { umbracoApi, umbracoUi} ) => {
21
18
// Arrange
19
+ await umbracoApi . documentType . createDefaultDocumentType ( documentTypeName ) ;
20
+ await umbracoUi . goToBackOffice ( ) ;
22
21
await umbracoUi . documentBlueprint . goToSection ( ConstantHelper . sections . settings ) ;
23
22
24
23
// Act
@@ -29,17 +28,19 @@ test('can create a document blueprint from the settings menu', {tag: '@smoke'},
29
28
await umbracoUi . documentBlueprint . clickSaveButton ( ) ;
30
29
31
30
// Assert
32
- await umbracoUi . documentBlueprint . waitForDocumentBlueprintToBeCreated ( )
31
+ await umbracoUi . documentBlueprint . waitForDocumentBlueprintToBeCreated ( ) ;
33
32
expect ( await umbracoApi . documentBlueprint . doesNameExist ( documentBlueprintName ) ) . toBeTruthy ( ) ;
34
33
await umbracoUi . documentBlueprint . isDocumentBlueprintRootTreeItemVisible ( documentBlueprintName , true ) ;
35
34
} ) ;
36
35
37
36
test ( 'can rename a document blueprint' , async ( { umbracoApi, umbracoUi} ) => {
38
37
// Arrange
38
+ const documentTypeId = await umbracoApi . documentType . createDefaultDocumentType ( documentTypeName ) ;
39
39
const wrongDocumentBlueprintName = 'Wrong Document Blueprint' ;
40
40
await umbracoApi . documentBlueprint . ensureNameNotExists ( wrongDocumentBlueprintName ) ;
41
41
await umbracoApi . documentBlueprint . createDefaultDocumentBlueprint ( wrongDocumentBlueprintName , documentTypeId ) ;
42
42
expect ( await umbracoApi . documentBlueprint . doesNameExist ( wrongDocumentBlueprintName ) ) . toBeTruthy ( ) ;
43
+ await umbracoUi . goToBackOffice ( ) ;
43
44
await umbracoUi . documentBlueprint . goToSection ( ConstantHelper . sections . settings ) ;
44
45
45
46
// Act
@@ -57,8 +58,10 @@ test('can rename a document blueprint', async ({umbracoApi, umbracoUi}) => {
57
58
58
59
test ( 'can delete a document blueprint' , async ( { umbracoApi, umbracoUi} ) => {
59
60
// Arrange
61
+ const documentTypeId = await umbracoApi . documentType . createDefaultDocumentType ( documentTypeName ) ;
60
62
await umbracoApi . documentBlueprint . createDefaultDocumentBlueprint ( documentBlueprintName , documentTypeId ) ;
61
63
expect ( await umbracoApi . documentBlueprint . doesNameExist ( documentBlueprintName ) ) . toBeTruthy ( ) ;
64
+ await umbracoUi . goToBackOffice ( ) ;
62
65
await umbracoUi . documentBlueprint . goToSection ( ConstantHelper . sections . settings ) ;
63
66
64
67
// Act
@@ -75,9 +78,9 @@ test('can delete a document blueprint', async ({umbracoApi, umbracoUi}) => {
75
78
76
79
test ( 'can create a document blueprint from the content menu' , async ( { umbracoApi, umbracoUi} ) => {
77
80
// Arrange
78
- const documentTypeName = 'DocumentTypeForContent' ;
79
81
const documentTypeId = await umbracoApi . documentType . createDefaultDocumentTypeWithAllowAsRoot ( documentTypeName ) ;
80
82
await umbracoApi . document . createDefaultDocument ( documentBlueprintName , documentTypeId ) ;
83
+ await umbracoUi . goToBackOffice ( ) ;
81
84
await umbracoUi . content . goToSection ( ConstantHelper . sections . content ) ;
82
85
83
86
// Act
@@ -94,3 +97,29 @@ test('can create a document blueprint from the content menu', async ({umbracoApi
94
97
// Clean
95
98
await umbracoApi . documentType . ensureNameNotExists ( documentTypeName ) ;
96
99
} ) ;
100
+
101
+ test ( 'can create a variant document blueprint' , { tag : '@release' } , async ( { umbracoApi, umbracoUi} ) => {
102
+ // Arrange
103
+ await umbracoApi . language . createDanishLanguage ( ) ;
104
+ await umbracoApi . documentType . createDocumentTypeWithAllowVaryByCulture ( documentTypeName ) ;
105
+ await umbracoUi . goToBackOffice ( ) ;
106
+ await umbracoUi . documentBlueprint . goToSection ( ConstantHelper . sections . settings ) ;
107
+
108
+ // Act
109
+ await umbracoUi . documentBlueprint . clickActionsMenuAtRoot ( ) ;
110
+ await umbracoUi . documentBlueprint . clickCreateActionMenuOption ( ) ;
111
+ await umbracoUi . documentBlueprint . clickTextButtonWithName ( documentTypeName ) ;
112
+ await umbracoUi . documentBlueprint . enterDocumentBlueprintName ( documentBlueprintName ) ;
113
+ await umbracoUi . documentBlueprint . clickSaveButton ( ) ;
114
+
115
+ // Assert
116
+ await umbracoUi . documentBlueprint . waitForDocumentBlueprintToBeCreated ( ) ;
117
+ expect ( await umbracoApi . documentBlueprint . doesNameExist ( documentBlueprintName ) ) . toBeTruthy ( ) ;
118
+ await umbracoUi . documentBlueprint . isDocumentBlueprintRootTreeItemVisible ( documentBlueprintName , true ) ;
119
+ await umbracoUi . documentBlueprint . page . on ( 'console' , message => {
120
+ expect ( message . type ( ) ) . not . toBe ( 'error' ) ;
121
+ } ) ;
122
+
123
+ // Clean
124
+ await umbracoApi . language . ensureIsoCodeNotExists ( 'da' ) ;
125
+ } ) ;
0 commit comments