@jahia/cypress 3.10.0 → 3.12.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.
@@ -25,7 +25,7 @@ var fixture = function (originalCommand, fixtureParam) {
25
25
  encoding = args[0];
26
26
  }
27
27
  try {
28
- cy.readFile('./node_modules/@jahia/cypress/fixtures/' + fixtureParam, encoding, { log: false, timeout: 500 });
28
+ cy.readFile('./node_modules/@jahia/cypress/fixtures/' + fixtureParam, encoding, { log: false, timeout: 1000 });
29
29
  }
30
30
  catch (e) {
31
31
  console.log(e);
@@ -0,0 +1 @@
1
+ export declare const waitUntilJournalSync: (predicate?: (cluster: any) => boolean, timeout?: number, interval?: number) => void;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.waitUntilJournalSync = void 0;
4
+ var waitUntilJournalSync = function (predicate, timeout, interval) {
5
+ if (timeout === void 0) { timeout = 60000; }
6
+ if (interval === void 0) { interval = 1000; }
7
+ cy.waitUntil(function () {
8
+ return cy.apollo({
9
+ fetchPolicy: 'no-cache',
10
+ queryFile: 'graphql/jcr/query/adminCluster.graphql'
11
+ }).then(function (result) {
12
+ var _a;
13
+ var adminResult = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.admin;
14
+ if (adminResult) {
15
+ return adminResult.cluster.isActivated &&
16
+ adminResult.cluster.journal.isClusterSync &&
17
+ (!predicate || predicate(adminResult.cluster));
18
+ }
19
+ });
20
+ }, {
21
+ errorMsg: 'Timeout waiting for journal to be synced',
22
+ timeout: timeout,
23
+ verbose: true,
24
+ interval: interval
25
+ });
26
+ };
27
+ exports.waitUntilJournalSync = waitUntilJournalSync;
@@ -3,3 +3,4 @@ export * from './PublicationAndWorkflowHelper';
3
3
  export * from './SiteHelper';
4
4
  export * from './UsersHelper';
5
5
  export * from './VanityUrlHelper';
6
+ export * from './ClusterHelper';
@@ -15,3 +15,4 @@ __exportStar(require("./PublicationAndWorkflowHelper"), exports);
15
15
  __exportStar(require("./SiteHelper"), exports);
16
16
  __exportStar(require("./UsersHelper"), exports);
17
17
  __exportStar(require("./VanityUrlHelper"), exports);
18
+ __exportStar(require("./ClusterHelper"), exports);
@@ -0,0 +1,19 @@
1
+ query {
2
+ admin {
3
+ cluster {
4
+ journal {
5
+ globalRevision
6
+ localRevision {
7
+ revision
8
+ serverId
9
+ }
10
+ revisions {
11
+ revision
12
+ serverId
13
+ }
14
+ isClusterSync
15
+ }
16
+ isActivated
17
+ }
18
+ }
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jahia/cypress",
3
- "version": "3.10.0",
3
+ "version": "3.12.0",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "lint": "eslint src -c .eslintrc.json --ext .ts"
package/schema.graphql CHANGED
@@ -327,8 +327,6 @@ type AdminMutation {
327
327
  jahia: JahiaAdminMutation!
328
328
  "Personal API tokens mutations"
329
329
  personalApiTokens: PersonalApiTokensMutation
330
- "Sitemap API mutations"
331
- sitemap: GqlSitemapMutation
332
330
  }
333
331
 
334
332
  "Admin queries root"
@@ -343,8 +341,6 @@ type AdminQuery {
343
341
  personalApiTokens: PersonalApiTokensQuery
344
342
  "Get available ACL roles; does not include any hidden or privileged roles"
345
343
  roles: [AclRole]
346
- "Sitemap API queries"
347
- sitemap: GqlSitemapQueries
348
344
  "Get user administration endpoint"
349
345
  userAdmin: UserAdminQuery
350
346
  "Get user group endpoint"
@@ -377,6 +373,8 @@ type Category {
377
373
  type Cluster {
378
374
  "Is the cluster mode activated on this Jahia instance"
379
375
  isActivated: Boolean
376
+ "Query operation on Jahia's journal across all nodes of a cluster"
377
+ journal: Journal
380
378
  }
381
379
 
382
380
  "Mutation for configuration value object"
@@ -1069,6 +1067,13 @@ type GqlEditorForms {
1069
1067
  ): Int
1070
1068
  }
1071
1069
 
1070
+ "Server healthCheck"
1071
+ type GqlHealthCheck {
1072
+ probes: [GqlProbe]
1073
+ "Highest reported status across all probes"
1074
+ status: GqlProbeStatus
1075
+ }
1076
+
1072
1077
  type GqlJcrImageTransformMutation {
1073
1078
  "Crop an image under the current node"
1074
1079
  cropImage(
@@ -1132,6 +1137,25 @@ type GqlOperationsSupport {
1132
1137
  publication: Boolean!
1133
1138
  }
1134
1139
 
1140
+ type GqlProbe {
1141
+ "Description specified by the developer of the probe"
1142
+ description: String
1143
+ "Name of the probe"
1144
+ name: String
1145
+ "Severity of the probe (LOW to CRITICAL)"
1146
+ severity: GqlProbeSeverity
1147
+ "Status reported by the probe (GREEN to RED)"
1148
+ status: GqlProbeStatus
1149
+ }
1150
+
1151
+ "Probe status"
1152
+ type GqlProbeStatus {
1153
+ "Health of the probe"
1154
+ health: GqlProbeHealth
1155
+ "Message explaining probe status"
1156
+ message: String
1157
+ }
1158
+
1135
1159
  "Publication status information for a JCR node"
1136
1160
  type GqlPublicationInfo {
1137
1161
  "Whether current user is allowed to publish the node omitting any workflows"
@@ -1160,27 +1184,6 @@ type GqlScope {
1160
1184
  name: String
1161
1185
  }
1162
1186
 
1163
- type GqlSitemapMutation {
1164
- "Delete existing sitemap cache if exists before expiration time difference"
1165
- deleteSitemapCache(
1166
- "Site key"
1167
- siteKey: String
1168
- ): Boolean
1169
- "Sending sitemap(s) based on either sitemap index XML or sitemap XML URL to search engine URL(s) specified in CFG"
1170
- sendSitemapToSearchEngine(
1171
- "Sitemap index XML or sitemap XML URL"
1172
- sitemapURL: String!
1173
- ): Boolean
1174
- }
1175
-
1176
- type GqlSitemapQueries {
1177
- "Get site URL with only server domain appended from sitemap URL"
1178
- siteUrl(
1179
- "Sitemap index XML or sitemap XML URL"
1180
- siteKey: String!
1181
- ): String
1182
- }
1183
-
1184
1187
  type GqlWorkflowEvent {
1185
1188
  "Number of tasks for current user"
1186
1189
  activeWorkflowTaskCountForUser: Int
@@ -1510,6 +1513,8 @@ type JCRNodeMutation {
1510
1513
  ): [VanityUrlMappingMutation]
1511
1514
  "Unlock all nodes under the specified node"
1512
1515
  clearAllLocks: Boolean
1516
+ "Create new version for the node if the node supports versioning"
1517
+ createVersion: Boolean
1513
1518
  "Add wip information"
1514
1519
  createWipInfo(
1515
1520
  "Work in progress information to save"
@@ -2344,6 +2349,29 @@ type JahiaAdminMutation {
2344
2349
  "Configuration pid ot factory pid"
2345
2350
  pid: String!
2346
2351
  ): GqlConfigurationMutation
2352
+ "Create a task"
2353
+ createTask(
2354
+ "Task name"
2355
+ name: String!,
2356
+ "Service name"
2357
+ service: String!
2358
+ ): Boolean
2359
+ "Delete a task"
2360
+ deleteTask(
2361
+ "Task name"
2362
+ name: String!,
2363
+ "Service name"
2364
+ service: String!
2365
+ ): Boolean
2366
+ "Shutdown the server"
2367
+ shutdown(
2368
+ "Do not send the shutdown event"
2369
+ dryRun: Boolean,
2370
+ "Force immediate shutdown even if server is busy"
2371
+ force: Boolean,
2372
+ "In seconds, maximum time to wait for server to be ready to shutdown"
2373
+ timeout: Int
2374
+ ): Boolean
2347
2375
  }
2348
2376
 
2349
2377
  "Jahia admin queries root"
@@ -2357,10 +2385,16 @@ type JahiaAdminQuery {
2357
2385
  ): GqlConfigurationQuery
2358
2386
  "Details about the database Jahia is connected to"
2359
2387
  database: JahiaDatabase
2388
+ "HealthCheck node"
2389
+ healthCheck(severity: GqlProbeSeverity): GqlHealthCheck
2390
+ "Get server load"
2391
+ load: Load
2360
2392
  "Get jobs scheduler"
2361
2393
  scheduler: GqlScheduler
2362
2394
  "Details about the system hosting Jahia"
2363
2395
  system: JahiaSystem
2396
+ "Lists tasks running on the Jahia server. A server should not be stopped/restarted when any of these tasks are present. These tasks are specific to the server being queried and are not shared accorss a cluster"
2397
+ tasks: [task]
2364
2398
  "Version of the running Jahia instance"
2365
2399
  version: JahiaVersion
2366
2400
  }
@@ -2421,6 +2455,42 @@ type JahiaVersion {
2421
2455
  release: String
2422
2456
  }
2423
2457
 
2458
+ "Details about the Jahia cluster journal"
2459
+ type Journal {
2460
+ "The latest revision of the journal on the cluster"
2461
+ globalRevision: Long
2462
+ "Is the journal in sync across all nodes of a cluster"
2463
+ isClusterSync: Boolean
2464
+ "The latest revision of the journal on the current node"
2465
+ localRevision: JournalRevision
2466
+ "The latest revisions of the journal for all cluster nodes"
2467
+ revisions: [JournalRevision]
2468
+ }
2469
+
2470
+ "Details about one journal revision"
2471
+ type JournalRevision {
2472
+ "The revision"
2473
+ revision: Long
2474
+ "The cluster node server Id"
2475
+ serverId: String
2476
+ }
2477
+
2478
+ "Server load"
2479
+ type Load {
2480
+ "Get requests load"
2481
+ requests: LoadValue
2482
+ "Get JCR Sessions load"
2483
+ sessions: LoadValue
2484
+ }
2485
+
2486
+ "Load value"
2487
+ type LoadValue {
2488
+ "Exponential moving average"
2489
+ average(interval: LoadInterval): Float
2490
+ "Instantaneous count"
2491
+ count: Int
2492
+ }
2493
+
2424
2494
  "Information on node lock"
2425
2495
  type LockInfo {
2426
2496
  "Can the node be locked"
@@ -3239,6 +3309,16 @@ type ZipFileMutation {
3239
3309
  ): Boolean
3240
3310
  }
3241
3311
 
3312
+ "Task that prevents server from shutdown"
3313
+ type task {
3314
+ "The name of the task associated with the service"
3315
+ name: String
3316
+ "Service attached to the task being monitored"
3317
+ service: String
3318
+ "Datetime at which the task was started or registered"
3319
+ started: String
3320
+ }
3321
+
3242
3322
  "Work in progress information"
3243
3323
  type wipInfo {
3244
3324
  "The languages set for Work in progress"
@@ -3288,6 +3368,26 @@ enum GqlBackgroundJobStatus {
3288
3368
  SUCCESSFUL
3289
3369
  }
3290
3370
 
3371
+ enum GqlProbeHealth {
3372
+ "GREEN"
3373
+ GREEN
3374
+ "RED"
3375
+ RED
3376
+ "YELLOW"
3377
+ YELLOW
3378
+ }
3379
+
3380
+ enum GqlProbeSeverity {
3381
+ "CRITICAL"
3382
+ CRITICAL
3383
+ "HIGH"
3384
+ HIGH
3385
+ "LOW"
3386
+ LOW
3387
+ "MEDIUM"
3388
+ MEDIUM
3389
+ }
3390
+
3291
3391
  enum GroupingType {
3292
3392
  "Put grouped items at the end in the order groups appear in the 'groups' list"
3293
3393
  END
@@ -3331,6 +3431,15 @@ enum JCRPropertyType {
3331
3431
  WEAKREFERENCE
3332
3432
  }
3333
3433
 
3434
+ enum LoadInterval {
3435
+ "FIFTEEN"
3436
+ FIFTEEN
3437
+ "FIVE"
3438
+ FIVE
3439
+ "ONE"
3440
+ ONE
3441
+ }
3442
+
3334
3443
  enum MulticriteriaEvaluation {
3335
3444
  "The result criteria evaluates positive if all sub-criteria evaluate positive"
3336
3445
  ALL
@@ -16,7 +16,7 @@ export const fixture = function (originalCommand: ((...args: any[]) => any), fix
16
16
  }
17
17
 
18
18
  try {
19
- cy.readFile('./node_modules/@jahia/cypress/fixtures/' + fixtureParam, encoding, {log: false, timeout: 500});
19
+ cy.readFile('./node_modules/@jahia/cypress/fixtures/' + fixtureParam, encoding, {log: false, timeout: 1000});
20
20
  } catch (e) {
21
21
  console.log(e);
22
22
  }
@@ -0,0 +1,21 @@
1
+ export const waitUntilJournalSync = (predicate?: (cluster: any) => boolean, timeout = 60000,
2
+ interval = 1000) : void => {
3
+ cy.waitUntil(() =>
4
+ cy.apollo({
5
+ fetchPolicy: 'no-cache',
6
+ queryFile: 'graphql/jcr/query/adminCluster.graphql'
7
+ }).then(result => {
8
+ const adminResult = result?.data?.admin;
9
+ if (adminResult) {
10
+ return adminResult.cluster.isActivated &&
11
+ adminResult.cluster.journal.isClusterSync &&
12
+ (!predicate || predicate(adminResult.cluster));
13
+ }
14
+ }),
15
+ {
16
+ errorMsg: 'Timeout waiting for journal to be synced',
17
+ timeout: timeout,
18
+ verbose: true,
19
+ interval: interval
20
+ });
21
+ };
@@ -3,3 +3,4 @@ export * from './PublicationAndWorkflowHelper';
3
3
  export * from './SiteHelper';
4
4
  export * from './UsersHelper';
5
5
  export * from './VanityUrlHelper';
6
+ export * from './ClusterHelper';