@jahia/cypress 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/Utils.d.ts +5 -1
- package/dist/utils/Utils.js +47 -3
- package/fixtures/graphql/jcr/mutation/addVanityUrl.graphql +14 -0
- package/fixtures/graphql/jcr/mutation/deleteNodeProperty.graphql +9 -0
- package/fixtures/graphql/jcr/mutation/removeVanityUrl.graphql +9 -0
- package/fixtures/graphql/jcr/query/getNodeByPath.graphql +2 -2
- package/fixtures/graphql/jcr/query/getVanityUrls.graphql +9 -0
- package/package.json +1 -1
- package/src/utils/Utils.ts +46 -2
package/dist/utils/Utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const setNodeProperty: (pathOrId: string, property: string, value: string, language: string) => Cypress.Chainable;
|
|
2
|
+
export declare const deleteNodeProperty: (pathOrId: string, property: string, language: string) => Cypress.Chainable;
|
|
2
3
|
export declare const deleteNode: (pathOrId: string) => Cypress.Chainable;
|
|
3
4
|
export declare const grantRoles: (pathOrId: string, roleNames: Array<string>, principalName: string, principalType: string) => Cypress.Chainable;
|
|
4
5
|
export declare const publishAndWaitJobEnding: (path: string, languages?: string[]) => void;
|
|
@@ -10,7 +11,7 @@ export declare const addNode: (variables: {
|
|
|
10
11
|
properties?: any[];
|
|
11
12
|
children?: any[];
|
|
12
13
|
}) => Cypress.Chainable;
|
|
13
|
-
export declare const getNodeByPath: (path: string) => Cypress.Chainable;
|
|
14
|
+
export declare const getNodeByPath: (path: string, properties?: string[], language?: string) => Cypress.Chainable;
|
|
14
15
|
export declare const createSite: (siteKey: string, templateSet?: string, serverName?: string, locale?: string, languages?: string) => void;
|
|
15
16
|
export declare const deleteSite: (siteKey: string) => void;
|
|
16
17
|
export declare const createUser: (userName: string, password: string, properties?: {
|
|
@@ -18,3 +19,6 @@ export declare const createUser: (userName: string, password: string, properties
|
|
|
18
19
|
value: string;
|
|
19
20
|
}[]) => void;
|
|
20
21
|
export declare const deleteUser: (userName: string) => void;
|
|
22
|
+
export declare const addVanityUrl: (pathOrId: string, language: string, url: string) => Cypress.Chainable;
|
|
23
|
+
export declare const getVanityUrl: (path: string, languages: Array<string>) => Cypress.Chainable;
|
|
24
|
+
export declare const removeVanityUrl: (pathOrId: string, url: string) => Cypress.Chainable;
|
package/dist/utils/Utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.deleteUser = exports.createUser = exports.deleteSite = exports.createSite = exports.getNodeByPath = exports.addNode = exports.waitAllJobsFinished = exports.publishAndWaitJobEnding = exports.grantRoles = exports.deleteNode = exports.setNodeProperty = void 0;
|
|
3
|
+
exports.removeVanityUrl = exports.getVanityUrl = exports.addVanityUrl = exports.deleteUser = exports.createUser = exports.deleteSite = exports.createSite = exports.getNodeByPath = exports.addNode = exports.waitAllJobsFinished = exports.publishAndWaitJobEnding = exports.grantRoles = exports.deleteNode = exports.deleteNodeProperty = exports.setNodeProperty = void 0;
|
|
4
4
|
var setNodeProperty = function (pathOrId, property, value, language) {
|
|
5
5
|
return cy.apollo({
|
|
6
6
|
variables: {
|
|
@@ -13,6 +13,17 @@ var setNodeProperty = function (pathOrId, property, value, language) {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
exports.setNodeProperty = setNodeProperty;
|
|
16
|
+
var deleteNodeProperty = function (pathOrId, property, language) {
|
|
17
|
+
return cy.apollo({
|
|
18
|
+
variables: {
|
|
19
|
+
pathOrId: pathOrId,
|
|
20
|
+
property: property,
|
|
21
|
+
language: language
|
|
22
|
+
},
|
|
23
|
+
mutationFile: 'graphql/jcr/mutation/deleteNodeProperty.graphql'
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
exports.deleteNodeProperty = deleteNodeProperty;
|
|
16
27
|
var deleteNode = function (pathOrId) {
|
|
17
28
|
return cy.apollo({
|
|
18
29
|
variables: {
|
|
@@ -82,10 +93,12 @@ var addNode = function (variables) {
|
|
|
82
93
|
});
|
|
83
94
|
};
|
|
84
95
|
exports.addNode = addNode;
|
|
85
|
-
var getNodeByPath = function (path) {
|
|
96
|
+
var getNodeByPath = function (path, properties, language) {
|
|
86
97
|
return cy.apollo({
|
|
87
98
|
variables: {
|
|
88
|
-
path: path
|
|
99
|
+
path: path,
|
|
100
|
+
properties: properties,
|
|
101
|
+
language: language
|
|
89
102
|
},
|
|
90
103
|
queryFile: 'graphql/jcr/query/getNodeByPath.graphql'
|
|
91
104
|
});
|
|
@@ -126,3 +139,34 @@ var deleteUser = function (userName) {
|
|
|
126
139
|
});
|
|
127
140
|
};
|
|
128
141
|
exports.deleteUser = deleteUser;
|
|
142
|
+
var addVanityUrl = function (pathOrId, language, url) {
|
|
143
|
+
return cy.apollo({
|
|
144
|
+
variables: {
|
|
145
|
+
pathOrId: pathOrId,
|
|
146
|
+
language: language,
|
|
147
|
+
url: url
|
|
148
|
+
},
|
|
149
|
+
mutationFile: 'graphql/jcr/mutation/addVanityUrl.graphql'
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
exports.addVanityUrl = addVanityUrl;
|
|
153
|
+
var getVanityUrl = function (path, languages) {
|
|
154
|
+
return cy.apollo({
|
|
155
|
+
variables: {
|
|
156
|
+
path: path,
|
|
157
|
+
languages: languages
|
|
158
|
+
},
|
|
159
|
+
queryFile: 'graphql/jcr/query/getVanityUrls.graphql'
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
exports.getVanityUrl = getVanityUrl;
|
|
163
|
+
var removeVanityUrl = function (pathOrId, url) {
|
|
164
|
+
return cy.apollo({
|
|
165
|
+
variables: {
|
|
166
|
+
pathOrId: pathOrId,
|
|
167
|
+
url: url
|
|
168
|
+
},
|
|
169
|
+
mutationFile: 'graphql/jcr/mutation/removeVanityUrl.graphql'
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
exports.removeVanityUrl = removeVanityUrl;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
mutation($pathOrId: String!, $language: String!, $url: String!){
|
|
2
|
+
jcr{
|
|
3
|
+
mutateNode(pathOrId: $pathOrId){
|
|
4
|
+
addVanityUrl(vanityUrlInputList: [{
|
|
5
|
+
language: $language,
|
|
6
|
+
active: true,
|
|
7
|
+
defaultMapping: true,
|
|
8
|
+
url: $url
|
|
9
|
+
}]){
|
|
10
|
+
uuid
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
query getNodeByPath($path: String!, $properties: [String]=[]) {
|
|
1
|
+
query getNodeByPath($path: String!, $properties: [String]=[], $language: String="") {
|
|
2
2
|
jcr {
|
|
3
3
|
nodeByPath(path: $path) {
|
|
4
4
|
uuid
|
|
5
5
|
name
|
|
6
|
-
properties(names: $properties){
|
|
6
|
+
properties(names: $properties, language: $language){
|
|
7
7
|
name
|
|
8
8
|
value
|
|
9
9
|
}
|
package/package.json
CHANGED
package/src/utils/Utils.ts
CHANGED
|
@@ -10,6 +10,17 @@ export const setNodeProperty = (pathOrId: string, property: string, value: strin
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
export const deleteNodeProperty = (pathOrId: string, property: string, language: string): Cypress.Chainable => {
|
|
14
|
+
return cy.apollo({
|
|
15
|
+
variables: {
|
|
16
|
+
pathOrId: pathOrId,
|
|
17
|
+
property: property,
|
|
18
|
+
language: language
|
|
19
|
+
},
|
|
20
|
+
mutationFile: 'graphql/jcr/mutation/deleteNodeProperty.graphql'
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
13
24
|
export const deleteNode = (pathOrId: string): Cypress.Chainable => {
|
|
14
25
|
return cy.apollo({
|
|
15
26
|
variables: {
|
|
@@ -78,10 +89,12 @@ export const addNode = (variables: { parentPathOrId: string, primaryNodeType: st
|
|
|
78
89
|
});
|
|
79
90
|
};
|
|
80
91
|
|
|
81
|
-
export const getNodeByPath = (path: string): Cypress.Chainable => {
|
|
92
|
+
export const getNodeByPath = (path: string, properties?: string[], language?:string): Cypress.Chainable => {
|
|
82
93
|
return cy.apollo({
|
|
83
94
|
variables: {
|
|
84
|
-
path: path
|
|
95
|
+
path: path,
|
|
96
|
+
properties: properties,
|
|
97
|
+
language: language
|
|
85
98
|
},
|
|
86
99
|
queryFile: 'graphql/jcr/query/getNodeByPath.graphql'
|
|
87
100
|
});
|
|
@@ -120,3 +133,34 @@ export const deleteUser = (userName: string): void => {
|
|
|
120
133
|
USER_NAME: userName
|
|
121
134
|
});
|
|
122
135
|
};
|
|
136
|
+
|
|
137
|
+
export const addVanityUrl = (pathOrId: string, language: string, url: string): Cypress.Chainable => {
|
|
138
|
+
return cy.apollo({
|
|
139
|
+
variables: {
|
|
140
|
+
pathOrId: pathOrId,
|
|
141
|
+
language: language,
|
|
142
|
+
url: url
|
|
143
|
+
},
|
|
144
|
+
mutationFile: 'graphql/jcr/mutation/addVanityUrl.graphql'
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export const getVanityUrl = (path: string, languages: Array<string>): Cypress.Chainable => {
|
|
149
|
+
return cy.apollo({
|
|
150
|
+
variables: {
|
|
151
|
+
path: path,
|
|
152
|
+
languages: languages
|
|
153
|
+
},
|
|
154
|
+
queryFile: 'graphql/jcr/query/getVanityUrls.graphql'
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export const removeVanityUrl = (pathOrId: string, url: string): Cypress.Chainable => {
|
|
159
|
+
return cy.apollo({
|
|
160
|
+
variables: {
|
|
161
|
+
pathOrId: pathOrId,
|
|
162
|
+
url: url
|
|
163
|
+
},
|
|
164
|
+
mutationFile: 'graphql/jcr/mutation/removeVanityUrl.graphql'
|
|
165
|
+
});
|
|
166
|
+
};
|