@jahia/cypress 4.0.0 → 4.1.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.
@@ -10,6 +10,7 @@ export declare const addNode: (variables: {
10
10
  children?: any[];
11
11
  mixins?: any[];
12
12
  }) => Cypress.Chainable;
13
+ export declare const addMixins: (pathOrId: string, mixins: string[]) => Cypress.Chainable;
13
14
  export declare const getNodeByPath: (path: string, properties?: string[], language?: string, childrenTypes?: string[], workspace?: Workspace) => Cypress.Chainable;
14
15
  export declare const getNodeAcl: (path: string) => Cypress.Chainable;
15
16
  export declare const moveNode: (pathOrId: string, destParentPathOrId: string, destName?: string) => Cypress.Chainable;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.uploadFile = exports.getNodeTypes = exports.moveNode = exports.getNodeAcl = exports.getNodeByPath = exports.addNode = exports.deleteNodeProperty = exports.deleteNode = exports.setNodeProperty = void 0;
3
+ exports.uploadFile = exports.getNodeTypes = exports.moveNode = exports.getNodeAcl = exports.getNodeByPath = exports.addMixins = exports.addNode = exports.deleteNodeProperty = exports.deleteNode = exports.setNodeProperty = void 0;
4
4
  var setNodeProperty = function (pathOrId, property, value, language) {
5
5
  var mutationFile = 'graphql/jcr/mutation/setProperty.graphql';
6
6
  if (value instanceof Array) {
@@ -47,6 +47,13 @@ var addNode = function (variables) {
47
47
  });
48
48
  };
49
49
  exports.addNode = addNode;
50
+ var addMixins = function (pathOrId, mixins) {
51
+ return cy.apollo({
52
+ variables: { pathOrId: pathOrId, mixins: mixins },
53
+ mutationFile: 'graphql/jcr/mutation/addMixins.graphql'
54
+ });
55
+ };
56
+ exports.addMixins = addMixins;
50
57
  var getNodeByPath = function (path, properties, language, childrenTypes, workspace) {
51
58
  if (childrenTypes === void 0) { childrenTypes = []; }
52
59
  if (workspace === void 0) { workspace = 'EDIT'; }
@@ -0,0 +1,8 @@
1
+ mutation addMixins($pathOrId: String!, $mixins: [String]! = []) {
2
+ jcr(workspace: EDIT) {
3
+ mutateNode(pathOrId: $pathOrId) {
4
+ addMixins(mixins: $mixins)
5
+ uuid
6
+ }
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jahia/cypress",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "lint": "eslint src -c .eslintrc.json --ext .ts"
@@ -39,13 +39,27 @@ export const deleteNodeProperty = (pathOrId: string, property: string, language:
39
39
  };
40
40
 
41
41
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
- export const addNode = (variables: { parentPathOrId: string, primaryNodeType: string, name: string, properties?: any[], children?: any[], mixins?: any[] }): Cypress.Chainable => {
42
+ export const addNode = (variables: {
43
+ parentPathOrId: string,
44
+ primaryNodeType: string,
45
+ name: string,
46
+ properties?: any[],
47
+ children?: any[],
48
+ mixins?: any[]
49
+ }): Cypress.Chainable => {
43
50
  return cy.apollo({
44
51
  variables: variables,
45
52
  mutationFile: 'graphql/jcr/mutation/addNode.graphql'
46
53
  });
47
54
  };
48
55
 
56
+ export const addMixins = (pathOrId: string, mixins: string[]): Cypress.Chainable => {
57
+ return cy.apollo({
58
+ variables: {pathOrId: pathOrId, mixins: mixins},
59
+ mutationFile: 'graphql/jcr/mutation/addMixins.graphql'
60
+ });
61
+ };
62
+
49
63
  export const getNodeByPath = (path: string, properties?: string[], language?: string, childrenTypes: string[] = [], workspace: Workspace = 'EDIT'): Cypress.Chainable => {
50
64
  return cy.apollo({
51
65
  variables: {