@jahia/cypress 3.28.0 → 3.30.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/SAMHelper.d.ts +1 -1
- package/dist/utils/SAMHelper.js +2 -2
- package/dist/utils/index.d.ts +4 -5
- package/dist/utils/index.js +4 -5
- package/package.json +2 -3
- package/src/utils/SAMHelper.ts +2 -2
- package/src/utils/index.ts +4 -5
- package/dist/utils/SSHHelper.d.ts +0 -15
- package/dist/utils/SSHHelper.js +0 -44
- package/src/utils/SSHHelper.ts +0 -49
|
@@ -12,7 +12,7 @@ export declare const healthCheck: (severity?: string, probeHealthFilter?: string
|
|
|
12
12
|
* @param probeHealthFilter the filter for the health check probes, default is GREEN
|
|
13
13
|
* @param timeout the timeout in milliseconds, default is 60000
|
|
14
14
|
* @param interval the interval in milliseconds, default is 500
|
|
15
|
-
* @param statusMatchCount the number of consecutive status matches before the waitUntil resolves, default is
|
|
15
|
+
* @param statusMatchCount the number of consecutive status matches before the waitUntil resolves, default is 3
|
|
16
16
|
*/
|
|
17
17
|
export declare const waitUntilSAMStatus: ({ expectedHealth, severity, probeHealthFilter, timeout, interval, statusMatchCount }: {
|
|
18
18
|
expectedHealth: any;
|
package/dist/utils/SAMHelper.js
CHANGED
|
@@ -31,10 +31,10 @@ exports.healthCheck = healthCheck;
|
|
|
31
31
|
* @param probeHealthFilter the filter for the health check probes, default is GREEN
|
|
32
32
|
* @param timeout the timeout in milliseconds, default is 60000
|
|
33
33
|
* @param interval the interval in milliseconds, default is 500
|
|
34
|
-
* @param statusMatchCount the number of consecutive status matches before the waitUntil resolves, default is
|
|
34
|
+
* @param statusMatchCount the number of consecutive status matches before the waitUntil resolves, default is 3
|
|
35
35
|
*/
|
|
36
36
|
var waitUntilSAMStatus = function (_a) {
|
|
37
|
-
var expectedHealth = _a.expectedHealth, _b = _a.severity, severity = _b === void 0 ? 'MEDIUM' : _b, _c = _a.probeHealthFilter, probeHealthFilter = _c === void 0 ? 'GREEN' : _c, _d = _a.timeout, timeout = _d === void 0 ? 60000 : _d, _e = _a.interval, interval = _e === void 0 ? 500 : _e, _f = _a.statusMatchCount, statusMatchCount = _f === void 0 ?
|
|
37
|
+
var expectedHealth = _a.expectedHealth, _b = _a.severity, severity = _b === void 0 ? 'MEDIUM' : _b, _c = _a.probeHealthFilter, probeHealthFilter = _c === void 0 ? 'GREEN' : _c, _d = _a.timeout, timeout = _d === void 0 ? 60000 : _d, _e = _a.interval, interval = _e === void 0 ? 500 : _e, _f = _a.statusMatchCount, statusMatchCount = _f === void 0 ? 3 : _f;
|
|
38
38
|
var statusCount = 0;
|
|
39
39
|
var lastGraphqlResponse = {};
|
|
40
40
|
cy.waitUntil(function () {
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export * from './ClusterHelper';
|
|
2
|
-
export * from './GraphQLHelper';
|
|
3
|
-
export * from './JahiaPlatformHelper';
|
|
4
1
|
export * from './JCRHelper';
|
|
5
2
|
export * from './PublicationAndWorkflowHelper';
|
|
6
|
-
export * from './SAMHelper';
|
|
7
3
|
export * from './SiteHelper';
|
|
8
|
-
export * from './SSHHelper';
|
|
9
4
|
export * from './UsersHelper';
|
|
10
5
|
export * from './VanityUrlHelper';
|
|
6
|
+
export * from './ClusterHelper';
|
|
7
|
+
export * from './JahiaPlatformHelper';
|
|
8
|
+
export * from './GraphQLHelper';
|
|
9
|
+
export * from './SAMHelper';
|
package/dist/utils/index.js
CHANGED
|
@@ -10,13 +10,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
exports.__esModule = true;
|
|
13
|
-
__exportStar(require("./ClusterHelper"), exports);
|
|
14
|
-
__exportStar(require("./GraphQLHelper"), exports);
|
|
15
|
-
__exportStar(require("./JahiaPlatformHelper"), exports);
|
|
16
13
|
__exportStar(require("./JCRHelper"), exports);
|
|
17
14
|
__exportStar(require("./PublicationAndWorkflowHelper"), exports);
|
|
18
|
-
__exportStar(require("./SAMHelper"), exports);
|
|
19
15
|
__exportStar(require("./SiteHelper"), exports);
|
|
20
|
-
__exportStar(require("./SSHHelper"), exports);
|
|
21
16
|
__exportStar(require("./UsersHelper"), exports);
|
|
22
17
|
__exportStar(require("./VanityUrlHelper"), exports);
|
|
18
|
+
__exportStar(require("./ClusterHelper"), exports);
|
|
19
|
+
__exportStar(require("./JahiaPlatformHelper"), exports);
|
|
20
|
+
__exportStar(require("./GraphQLHelper"), exports);
|
|
21
|
+
__exportStar(require("./SAMHelper"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jahia/cypress",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.30.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "tsc",
|
|
6
6
|
"lint": "eslint src -c .eslintrc.json --ext .ts"
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
"@apollo/client": "^3.4.9",
|
|
33
33
|
"cypress-real-events": "^1.11.0",
|
|
34
34
|
"graphql": "^15.5.0",
|
|
35
|
-
"graphql-tag": "^2.11.0"
|
|
36
|
-
"node-ssh": "^13.2.0"
|
|
35
|
+
"graphql-tag": "^2.11.0"
|
|
37
36
|
},
|
|
38
37
|
"packageManager": "yarn@4.5.0"
|
|
39
38
|
}
|
package/src/utils/SAMHelper.ts
CHANGED
|
@@ -28,9 +28,9 @@ export const healthCheck = (severity = 'MEDIUM', probeHealthFilter = 'GREEN'): C
|
|
|
28
28
|
* @param probeHealthFilter the filter for the health check probes, default is GREEN
|
|
29
29
|
* @param timeout the timeout in milliseconds, default is 60000
|
|
30
30
|
* @param interval the interval in milliseconds, default is 500
|
|
31
|
-
* @param statusMatchCount the number of consecutive status matches before the waitUntil resolves, default is
|
|
31
|
+
* @param statusMatchCount the number of consecutive status matches before the waitUntil resolves, default is 3
|
|
32
32
|
*/
|
|
33
|
-
export const waitUntilSAMStatus = ({expectedHealth, severity = 'MEDIUM', probeHealthFilter = 'GREEN', timeout = 60000, interval = 500, statusMatchCount =
|
|
33
|
+
export const waitUntilSAMStatus = ({expectedHealth, severity = 'MEDIUM', probeHealthFilter = 'GREEN', timeout = 60000, interval = 500, statusMatchCount = 3}) : void => {
|
|
34
34
|
let statusCount = 0;
|
|
35
35
|
let lastGraphqlResponse = {};
|
|
36
36
|
cy.waitUntil(() =>
|
package/src/utils/index.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export * from './ClusterHelper';
|
|
2
|
-
export * from './GraphQLHelper';
|
|
3
|
-
export * from './JahiaPlatformHelper';
|
|
4
1
|
export * from './JCRHelper';
|
|
5
2
|
export * from './PublicationAndWorkflowHelper';
|
|
6
|
-
export * from './SAMHelper';
|
|
7
3
|
export * from './SiteHelper';
|
|
8
|
-
export * from './SSHHelper';
|
|
9
4
|
export * from './UsersHelper';
|
|
10
5
|
export * from './VanityUrlHelper';
|
|
6
|
+
export * from './ClusterHelper';
|
|
7
|
+
export * from './JahiaPlatformHelper';
|
|
8
|
+
export * from './GraphQLHelper';
|
|
9
|
+
export * from './SAMHelper';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SSHExecCommandResponse } from 'node-ssh';
|
|
2
|
-
interface connection {
|
|
3
|
-
hostname: string;
|
|
4
|
-
port: string;
|
|
5
|
-
username: string;
|
|
6
|
-
password: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Execute SSH commands on a specific host. Returns a promise that resolves to the command result.
|
|
10
|
-
* Rejects if the commands fail (exit code is not 0).
|
|
11
|
-
* @param commands Array of SSH commands to execute
|
|
12
|
-
* @param connection Connection details
|
|
13
|
-
*/
|
|
14
|
-
export declare const sshCommands: (commands: Array<string>, connection: connection) => Promise<SSHExecCommandResponse>;
|
|
15
|
-
export {};
|
package/dist/utils/SSHHelper.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.sshCommands = void 0;
|
|
4
|
-
var node_ssh_1 = require("node-ssh");
|
|
5
|
-
/**
|
|
6
|
-
* Execute SSH commands on a specific host. Returns a promise that resolves to the command result.
|
|
7
|
-
* Rejects if the commands fail (exit code is not 0).
|
|
8
|
-
* @param commands Array of SSH commands to execute
|
|
9
|
-
* @param connection Connection details
|
|
10
|
-
*/
|
|
11
|
-
var sshCommands = function (commands, connection) {
|
|
12
|
-
return new Promise(function (resolve, reject) {
|
|
13
|
-
var ssh = new node_ssh_1.NodeSSH();
|
|
14
|
-
console.info('[SSH] connection to:', connection.hostname, ' (port: ', connection.port, ')');
|
|
15
|
-
console.info('[SSH] commands:', commands);
|
|
16
|
-
console.info('[SSH] ', connection);
|
|
17
|
-
ssh.connect({
|
|
18
|
-
host: connection.hostname,
|
|
19
|
-
port: parseInt(connection.port, 10),
|
|
20
|
-
username: connection.username,
|
|
21
|
-
password: connection.password
|
|
22
|
-
})
|
|
23
|
-
.then(function () {
|
|
24
|
-
ssh.exec(commands.join(';'), [], { stream: 'both' })
|
|
25
|
-
.then(function (result) {
|
|
26
|
-
console.info('[SSH] Successfully executed commands: ', commands);
|
|
27
|
-
console.info('[SSH] Result: ', result);
|
|
28
|
-
if (result.code === 0) {
|
|
29
|
-
resolve(result); // Resolve to command result
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
reject(new Error("Commands \"" + commands + "\" failed with exit code " + result.code + " on host " + connection.hostname + ". Stdout:" + result.stdout + ", Stderr: " + result.stderr));
|
|
33
|
-
}
|
|
34
|
-
})["catch"](function (reason) {
|
|
35
|
-
console.error('[SSH] Failed to execute commands: ', commands);
|
|
36
|
-
reject(reason);
|
|
37
|
-
});
|
|
38
|
-
})["catch"](function (reason) {
|
|
39
|
-
console.error('[SSH] Failed to connect to: ', connection.hostname);
|
|
40
|
-
reject(reason);
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
exports.sshCommands = sshCommands;
|
package/src/utils/SSHHelper.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import {NodeSSH, SSHExecCommandResponse} from 'node-ssh';
|
|
2
|
-
|
|
3
|
-
interface connection {
|
|
4
|
-
hostname: string
|
|
5
|
-
port: string
|
|
6
|
-
username: string
|
|
7
|
-
password: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Execute SSH commands on a specific host. Returns a promise that resolves to the command result.
|
|
12
|
-
* Rejects if the commands fail (exit code is not 0).
|
|
13
|
-
* @param commands Array of SSH commands to execute
|
|
14
|
-
* @param connection Connection details
|
|
15
|
-
*/
|
|
16
|
-
export const sshCommands = (commands: Array<string>, connection: connection): Promise<SSHExecCommandResponse> => {
|
|
17
|
-
return new Promise((resolve, reject) => {
|
|
18
|
-
const ssh = new NodeSSH();
|
|
19
|
-
console.info('[SSH] connection to:', connection.hostname, ' (port: ', connection.port, ')');
|
|
20
|
-
console.info('[SSH] commands:', commands);
|
|
21
|
-
console.info('[SSH] ', connection);
|
|
22
|
-
ssh.connect({
|
|
23
|
-
host: connection.hostname,
|
|
24
|
-
port: parseInt(connection.port, 10),
|
|
25
|
-
username: connection.username,
|
|
26
|
-
password: connection.password
|
|
27
|
-
})
|
|
28
|
-
.then(() => {
|
|
29
|
-
ssh.exec(commands.join(';'), [], {stream: 'both'})
|
|
30
|
-
.then(function (result) {
|
|
31
|
-
console.info('[SSH] Successfully executed commands: ', commands);
|
|
32
|
-
console.info('[SSH] Result: ', result);
|
|
33
|
-
if (result.code === 0) {
|
|
34
|
-
resolve(result); // Resolve to command result
|
|
35
|
-
} else {
|
|
36
|
-
reject(new Error(`Commands "${commands}" failed with exit code ${result.code} on host ${connection.hostname}. Stdout:${result.stdout}, Stderr: ${result.stderr}`));
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
.catch(reason => {
|
|
40
|
-
console.error('[SSH] Failed to execute commands: ', commands);
|
|
41
|
-
reject(reason);
|
|
42
|
-
});
|
|
43
|
-
})
|
|
44
|
-
.catch(reason => {
|
|
45
|
-
console.error('[SSH] Failed to connect to: ', connection.hostname);
|
|
46
|
-
reject(reason);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
};
|