@jahia/cypress 3.19.4 → 3.20.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/JCRHelper.d.ts +4 -2
- package/dist/utils/JCRHelper.js +4 -2
- package/dist/utils/SAMHelper.d.ts +1 -0
- package/dist/utils/SAMHelper.js +29 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/fixtures/graphql/jcr/mutation/deleteNode.graphql +2 -2
- package/fixtures/graphql/sam/healthStatus.graphql +12 -0
- package/package.json +1 -1
- package/src/utils/JCRHelper.ts +6 -3
- package/src/utils/SAMHelper.ts +22 -0
- package/src/utils/index.ts +1 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
declare type Workspace = 'EDIT' | 'LIVE';
|
|
1
2
|
export declare const setNodeProperty: (pathOrId: string, property: string, value: string | Array<string>, language: string) => Cypress.Chainable;
|
|
2
|
-
export declare const deleteNode: (pathOrId: string) => Cypress.Chainable;
|
|
3
|
+
export declare const deleteNode: (pathOrId: string, workspace?: Workspace) => Cypress.Chainable;
|
|
3
4
|
export declare const deleteNodeProperty: (pathOrId: string, property: string, language: string) => Cypress.Chainable;
|
|
4
5
|
export declare const addNode: (variables: {
|
|
5
6
|
parentPathOrId: string;
|
|
@@ -9,7 +10,8 @@ export declare const addNode: (variables: {
|
|
|
9
10
|
children?: any[];
|
|
10
11
|
mixins?: any[];
|
|
11
12
|
}) => Cypress.Chainable;
|
|
12
|
-
export declare const getNodeByPath: (path: string, properties?: string[], language?: string, childrenTypes?: string[], workspace?:
|
|
13
|
+
export declare const getNodeByPath: (path: string, properties?: string[], language?: string, childrenTypes?: string[], workspace?: Workspace) => Cypress.Chainable;
|
|
13
14
|
export declare const getNodeAcl: (path: string) => Cypress.Chainable;
|
|
14
15
|
export declare const moveNode: (pathOrId: string, destParentPathOrId: string, destName?: string) => Cypress.Chainable;
|
|
15
16
|
export declare const getNodeTypes: (filter?: {}) => Cypress.Chainable;
|
|
17
|
+
export {};
|
package/dist/utils/JCRHelper.js
CHANGED
|
@@ -17,10 +17,12 @@ var setNodeProperty = function (pathOrId, property, value, language) {
|
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
exports.setNodeProperty = setNodeProperty;
|
|
20
|
-
var deleteNode = function (pathOrId) {
|
|
20
|
+
var deleteNode = function (pathOrId, workspace) {
|
|
21
|
+
if (workspace === void 0) { workspace = 'EDIT'; }
|
|
21
22
|
return cy.apollo({
|
|
22
23
|
variables: {
|
|
23
|
-
pathOrId: pathOrId
|
|
24
|
+
pathOrId: pathOrId,
|
|
25
|
+
workspace: workspace
|
|
24
26
|
},
|
|
25
27
|
mutationFile: 'graphql/jcr/mutation/deleteNode.graphql'
|
|
26
28
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const waitUntilSAMStatusGreen: (severity?: string, timeout?: number, interval?: number) => void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.waitUntilSAMStatusGreen = void 0;
|
|
4
|
+
var waitUntilSAMStatusGreen = function (severity, timeout, interval) {
|
|
5
|
+
if (severity === void 0) { severity = 'MEDIUM'; }
|
|
6
|
+
if (timeout === void 0) { timeout = 60000; }
|
|
7
|
+
if (interval === void 0) { interval = 1000; }
|
|
8
|
+
cy.waitUntil(function () {
|
|
9
|
+
return cy.apollo({
|
|
10
|
+
fetchPolicy: 'no-cache',
|
|
11
|
+
queryFile: 'graphql/sam/healthStatus.graphql',
|
|
12
|
+
variables: {
|
|
13
|
+
severity: severity
|
|
14
|
+
}
|
|
15
|
+
}).then(function (result) {
|
|
16
|
+
var _a, _b, _c, _d;
|
|
17
|
+
var healthStatus = (_d = (_c = (_b = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.admin) === null || _b === void 0 ? void 0 : _b.jahia) === null || _c === void 0 ? void 0 : _c.healthCheck) === null || _d === void 0 ? void 0 : _d.status;
|
|
18
|
+
if (healthStatus) {
|
|
19
|
+
return healthStatus.health === 'GREEN';
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}, {
|
|
23
|
+
errorMsg: "Timeout waiting for SAM to be green for severity: " + severity,
|
|
24
|
+
timeout: timeout,
|
|
25
|
+
verbose: true,
|
|
26
|
+
interval: interval
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
exports.waitUntilSAMStatusGreen = waitUntilSAMStatusGreen;
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
package/src/utils/JCRHelper.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
type Workspace = 'EDIT' | 'LIVE';
|
|
2
|
+
|
|
1
3
|
export const setNodeProperty = (pathOrId: string, property: string, value: string | Array<string>, language: string): Cypress.Chainable => {
|
|
2
4
|
let mutationFile = 'graphql/jcr/mutation/setProperty.graphql';
|
|
3
5
|
if (value instanceof Array) {
|
|
@@ -15,10 +17,11 @@ export const setNodeProperty = (pathOrId: string, property: string, value: strin
|
|
|
15
17
|
});
|
|
16
18
|
};
|
|
17
19
|
|
|
18
|
-
export const deleteNode = (pathOrId: string): Cypress.Chainable => {
|
|
20
|
+
export const deleteNode = (pathOrId: string, workspace: Workspace = 'EDIT'): Cypress.Chainable => {
|
|
19
21
|
return cy.apollo({
|
|
20
22
|
variables: {
|
|
21
|
-
pathOrId: pathOrId
|
|
23
|
+
pathOrId: pathOrId,
|
|
24
|
+
workspace
|
|
22
25
|
},
|
|
23
26
|
mutationFile: 'graphql/jcr/mutation/deleteNode.graphql'
|
|
24
27
|
});
|
|
@@ -43,7 +46,7 @@ export const addNode = (variables: { parentPathOrId: string, primaryNodeType: st
|
|
|
43
46
|
});
|
|
44
47
|
};
|
|
45
48
|
|
|
46
|
-
export const getNodeByPath = (path: string, properties?: string[], language?: string, childrenTypes: string[] = [], workspace:
|
|
49
|
+
export const getNodeByPath = (path: string, properties?: string[], language?: string, childrenTypes: string[] = [], workspace: Workspace = 'EDIT'): Cypress.Chainable => {
|
|
47
50
|
return cy.apollo({
|
|
48
51
|
variables: {
|
|
49
52
|
path: path,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const waitUntilSAMStatusGreen = (severity = 'MEDIUM', timeout = 60000, interval = 1000) : void => {
|
|
2
|
+
cy.waitUntil(() =>
|
|
3
|
+
cy.apollo({
|
|
4
|
+
fetchPolicy: 'no-cache',
|
|
5
|
+
queryFile: 'graphql/sam/healthStatus.graphql',
|
|
6
|
+
variables: {
|
|
7
|
+
severity: severity
|
|
8
|
+
}
|
|
9
|
+
}).then(result => {
|
|
10
|
+
const healthStatus = result?.data?.admin?.jahia?.healthCheck?.status;
|
|
11
|
+
if (healthStatus) {
|
|
12
|
+
return healthStatus.health === 'GREEN';
|
|
13
|
+
}
|
|
14
|
+
}),
|
|
15
|
+
{
|
|
16
|
+
errorMsg: `Timeout waiting for SAM to be green for severity: ${severity}`,
|
|
17
|
+
timeout: timeout,
|
|
18
|
+
verbose: true,
|
|
19
|
+
interval: interval
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
package/src/utils/index.ts
CHANGED