@jahia/cypress 6.4.5 → 7.0.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/ci.startup.sh CHANGED
@@ -32,7 +32,7 @@ if [[ "${JAHIA_CLUSTER_ENABLED}" == "true" || ${JAHIA_CLUSTER_ENABLED} == true
32
32
  fi
33
33
 
34
34
  echo "$(date +'%d %B %Y - %k:%M') == Starting environment =="
35
- docker-compose ${CLUSTER_PROFILE} up -d --renew-anon-volumes
35
+ docker-compose ${CLUSTER_PROFILE} up -d --renew-anon-volumes $(docker-compose config --services | grep -v "cypress")
36
36
  if [[ "$1" != "notests" ]]; then
37
37
  docker ps -a
38
38
  docker stats --no-stream
@@ -17,4 +17,6 @@ export declare const moveNode: (pathOrId: string, destParentPathOrId: string, de
17
17
  export declare const getNodeTypes: (filter?: {}) => Cypress.Chainable;
18
18
  export declare const markForDeletion: (pathOrId: string) => Cypress.Chainable;
19
19
  export declare const uploadFile: (fixturePath: string, parentPathOrId: string, name: string, mimeType: string) => Cypress.Chainable;
20
+ export declare const lockNode: (pathOrId: string) => Cypress.Chainable;
21
+ export declare const unlockNode: (pathOrId: string) => Cypress.Chainable;
20
22
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.uploadFile = exports.markForDeletion = exports.getNodeTypes = exports.moveNode = exports.getNodeAcl = exports.getNodeByPath = exports.addMixins = exports.addNode = exports.deleteNodeProperty = exports.deleteNode = exports.setNodeProperty = void 0;
3
+ exports.unlockNode = exports.lockNode = exports.uploadFile = exports.markForDeletion = 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) {
@@ -125,3 +125,21 @@ var uploadFile = function (fixturePath, parentPathOrId, name, mimeType) {
125
125
  });
126
126
  };
127
127
  exports.uploadFile = uploadFile;
128
+ var lockNode = function (pathOrId) {
129
+ return cy.apollo({
130
+ mutationFile: 'graphql/jcr/mutation/lockNode.graphql',
131
+ variables: {
132
+ pathOrId: pathOrId
133
+ }
134
+ });
135
+ };
136
+ exports.lockNode = lockNode;
137
+ var unlockNode = function (pathOrId) {
138
+ return cy.apollo({
139
+ mutationFile: 'graphql/jcr/mutation/unlockNode.graphql',
140
+ variables: {
141
+ pathOrId: pathOrId
142
+ }
143
+ });
144
+ };
145
+ exports.unlockNode = unlockNode;
package/env.Dockerfile CHANGED
@@ -1,10 +1,11 @@
1
- FROM cypress/browsers:node-22.13.1-chrome-132.0.6834.159-1-ff-134.0.2-edge-132.0.2957.127-1
1
+ FROM cypress/browsers:node-22.21.0-chrome-141.0.7390.107-1-ff-144.0-edge-141.0.3537.92-1
2
2
 
3
3
  ARG MAVEN_VER="3.8.1"
4
4
  ARG MAVEN_BASE_URL="https://archive.apache.org/dist/maven/maven-3"
5
5
  ARG YARN_VERSION="1.22.19"
6
6
 
7
- RUN apt-get update && apt-get install -y jq curl ; \
7
+ RUN apt-get update
8
+ RUN apt-get install -y jq curl ; \
8
9
  npm -g install corepack ; \
9
10
  corepack enable
10
11
 
@@ -0,0 +1,7 @@
1
+ mutation lockNode($pathOrId: String!){
2
+ jcr{
3
+ mutateNode(pathOrId: $pathOrId){
4
+ lock
5
+ }
6
+ }
7
+ }
@@ -0,0 +1,7 @@
1
+ mutation unlockNode($pathOrId: String!){
2
+ jcr{
3
+ mutateNode(pathOrId: $pathOrId){
4
+ unlock
5
+ }
6
+ }
7
+ }
@@ -10,8 +10,13 @@ JCRTemplate.getInstance().doExecuteWithSystemSession(new JCRCallback() {
10
10
  log.info("Delete user : USER_NAME" );
11
11
 
12
12
  JahiaUserManagerService userManagerService = JahiaUserManagerService.getInstance();
13
- userManagerService.deleteUser(userManagerService.getUserPath("USER_NAME"), session);
14
- session.save();
13
+ def user = userManagerService.getUserPath("USER_NAME");
14
+ if (user) {
15
+ userManagerService.deleteUser(user, session);
16
+ session.save();
17
+ } else {
18
+ log.warn("User USER_NAME cannot be deleted. User not found");
19
+ }
15
20
  return null;
16
21
  }
17
22
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jahia/cypress",
3
- "version": "6.4.5",
3
+ "version": "7.0.0",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "lint": "eslint src -c .eslintrc.json --ext .ts --max-warnings=0"
@@ -131,3 +131,21 @@ export const uploadFile = (fixturePath: string, parentPathOrId: string, name: st
131
131
  });
132
132
  });
133
133
  };
134
+
135
+ export const lockNode = (pathOrId: string): Cypress.Chainable => {
136
+ return cy.apollo({
137
+ mutationFile: 'graphql/jcr/mutation/lockNode.graphql',
138
+ variables: {
139
+ pathOrId: pathOrId
140
+ }
141
+ });
142
+ };
143
+
144
+ export const unlockNode = (pathOrId: string): Cypress.Chainable => {
145
+ return cy.apollo({
146
+ mutationFile: 'graphql/jcr/mutation/unlockNode.graphql',
147
+ variables: {
148
+ pathOrId: pathOrId
149
+ }
150
+ });
151
+ };