@jahia/cypress 3.32.0 → 3.34.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.
@@ -8,5 +8,7 @@ export declare class Menu extends BaseComponent {
8
8
  shouldNotHaveItem(item: string): void;
9
9
  select(item: string): Menu;
10
10
  selectByRole(item: string): Menu;
11
+ /** Can be used for choicelist dropdown menu */
12
+ selectByValue(value: string): Menu;
11
13
  close(): Chainable<unknown>;
12
14
  }
@@ -44,6 +44,12 @@ var Menu = /** @class */ (function (_super) {
44
44
  this.get().find(".moonstone-menuItem[data-sel-role=\"" + item + "\"]").trigger('click');
45
45
  return this;
46
46
  };
47
+ /** Can be used for choicelist dropdown menu */
48
+ Menu.prototype.selectByValue = function (value) {
49
+ this.get().find(".moonstone-menuItem[data-value=\"" + value + "\"]").scrollIntoView().should('be.visible');
50
+ this.get().find(".moonstone-menuItem[data-value=\"" + value + "\"]").trigger('click');
51
+ return this;
52
+ };
47
53
  Menu.prototype.close = function () {
48
54
  return cy.get(Menu.overlaySelector).click('topRight');
49
55
  };
@@ -1 +1,3 @@
1
1
  export declare const getJahiaVersion: () => Cypress.Chainable;
2
+ export declare const getStartedModulesVersion: () => Cypress.Chainable;
3
+ export declare const getStartedModuleVersion: (moduleId: string) => Cypress.Chainable;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.getJahiaVersion = void 0;
3
+ exports.getStartedModuleVersion = exports.getStartedModulesVersion = exports.getJahiaVersion = void 0;
4
4
  var getJahiaVersion = function () {
5
5
  return cy.apollo({
6
6
  fetchPolicy: 'no-cache',
@@ -11,3 +11,20 @@ var getJahiaVersion = function () {
11
11
  });
12
12
  };
13
13
  exports.getJahiaVersion = getJahiaVersion;
14
+ var getStartedModulesVersion = function () {
15
+ return cy.apollo({
16
+ fetchPolicy: 'no-cache',
17
+ queryFile: 'graphql/jcr/query/getStartedModulesVersion.graphql'
18
+ }).then(function (result) {
19
+ var _a;
20
+ return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.dashboard.modules;
21
+ });
22
+ };
23
+ exports.getStartedModulesVersion = getStartedModulesVersion;
24
+ var getStartedModuleVersion = function (moduleId) {
25
+ return exports.getStartedModulesVersion().then(function (modules) {
26
+ var _a;
27
+ return (_a = modules.find(function (module) { return module.id === moduleId; })) === null || _a === void 0 ? void 0 : _a.version;
28
+ });
29
+ };
30
+ exports.getStartedModuleVersion = getStartedModuleVersion;
@@ -55,7 +55,7 @@ var waitAllJobsFinished = function (errorMessage, timeout) {
55
55
  })
56
56
  .then(function (response) {
57
57
  var _a, _b, _c, _d;
58
- var jobs = (_d = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.admin) === null || _b === void 0 ? void 0 : _b.jahia) === null || _c === void 0 ? void 0 : _c.scheduler) === null || _d === void 0 ? void 0 : _d.jobs;
58
+ var jobs = (_d = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.admin) === null || _b === void 0 ? void 0 : _b.jahia) === null || _c === void 0 ? void 0 : _c.scheduler) === null || _d === void 0 ? void 0 : _d.jobs.nodes;
59
59
  var publicationJobs = jobs.filter(function (job) { return job.group === 'PublicationJob'; });
60
60
  var hasActivePublicationJobs = publicationJobs.some(function (job) { return job.jobStatus === 'EXECUTING'; });
61
61
  return !hasActivePublicationJobs;
@@ -3,9 +3,11 @@ query getJobsWithStatus{
3
3
  jahia {
4
4
  scheduler{
5
5
  jobs {
6
- siteKey
7
- group
8
- jobStatus
6
+ nodes {
7
+ siteKey
8
+ group
9
+ jobStatus
10
+ }
9
11
  }
10
12
  }
11
13
  }
@@ -0,0 +1,8 @@
1
+ query getStartedModulesVersion {
2
+ dashboard {
3
+ modules {
4
+ id
5
+ version
6
+ }
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jahia/cypress",
3
- "version": "3.32.0",
3
+ "version": "3.34.0",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "lint": "eslint src -c .eslintrc.json --ext .ts"
package/schema.graphql CHANGED
@@ -100,6 +100,8 @@ interface JCRNode {
100
100
  defaultWipInfo: wipInfo
101
101
  "Returns the node definition that applies to this node."
102
102
  definition: JCRNodeDefinition
103
+ "The depth in the JCR Tree of the JCR node this object represents"
104
+ depth: Int!
103
105
  "GraphQL representation of a descendant node, based on its relative path"
104
106
  descendant(
105
107
  "Name or relative path of the sub node"
@@ -123,6 +125,8 @@ interface JCRNode {
123
125
  last: Int,
124
126
  "fetching only the first certain number of nodes"
125
127
  limit: Int,
128
+ "Maximum depth in JCR tree for descendants from the current node, 0 (or less) for all sub nodes, 1 for one sub level, etc"
129
+ maxDepth: Int,
126
130
  "fetching only nodes after this node (inclusive)"
127
131
  offset: Int,
128
132
  "Filter of descendant nodes by their property values; null to avoid such filtering"
@@ -749,6 +753,8 @@ type GenericJCRNode implements JCRNode {
749
753
  defaultWipInfo: wipInfo
750
754
  "Returns the node definition that applies to this node."
751
755
  definition: JCRNodeDefinition
756
+ "The depth in the JCR Tree of the JCR node this object represents"
757
+ depth: Int!
752
758
  "GraphQL representation of a descendant node, based on its relative path"
753
759
  descendant(
754
760
  "Name or relative path of the sub node"
@@ -772,6 +778,8 @@ type GenericJCRNode implements JCRNode {
772
778
  last: Int,
773
779
  "fetching only the first certain number of nodes"
774
780
  limit: Int,
781
+ "Maximum depth in JCR tree for descendants from the current node, 0 (or less) for all sub nodes, 1 for one sub level, etc"
782
+ maxDepth: Int,
775
783
  "fetching only nodes after this node (inclusive)"
776
784
  offset: Int,
777
785
  "Filter of descendant nodes by their property values; null to avoid such filtering"
@@ -998,29 +1006,36 @@ type GqlBackgroundJob {
998
1006
  group: String
999
1007
  "The job (Boolean) property that correspond to the given name. The returned value will be null in case the job doesn't have the property"
1000
1008
  jobBooleanProperty(
1001
- "The job name"
1009
+ "The name of the property"
1002
1010
  name: String
1003
1011
  ): Boolean
1012
+ "Job description"
1013
+ jobDescription: String
1004
1014
  "The job (Int) property that correspond to the given name. The returned value will be null in case the job doesn't have the property"
1005
1015
  jobIntegerProperty(
1006
- "The job name"
1016
+ "The name of the property"
1007
1017
  name: String
1008
1018
  ): Int
1009
1019
  "The job (Long) property that correspond to the given name. The returned value will be null in case the job doesn't have the property"
1010
1020
  jobLongProperty(
1011
- "The job name"
1021
+ "The name of the property"
1012
1022
  name: String
1013
1023
  ): Long
1014
1024
  "The job state is different from the status, it reflect the last action done on the job instance (Started, Vetoed, Finished)"
1015
1025
  jobState: GqlBackgroundJobState
1016
1026
  "The job status"
1017
1027
  jobStatus: GqlBackgroundJobStatus
1028
+ "List of strings property from the job map (eg. publicationInfos, publicationPaths)"
1029
+ jobStringListProperty(
1030
+ "The name of the property"
1031
+ name: String
1032
+ ): [String]
1018
1033
  "The job (String) property that correspond to the given name. The returned value will be null in case the job doesn't have the property"
1019
1034
  jobStringProperty(
1020
- "The job name"
1035
+ "The name of the property"
1021
1036
  name: String
1022
1037
  ): String
1023
- "The job name"
1038
+ "The name of the property"
1024
1039
  name: String
1025
1040
  "GraphQL representation of publication job"
1026
1041
  publicationJob: GqlPublicationBackgroundJob
@@ -1030,6 +1045,26 @@ type GqlBackgroundJob {
1030
1045
  userKey: String
1031
1046
  }
1032
1047
 
1048
+ "A connection to a list of items."
1049
+ type GqlBackgroundJobConnection {
1050
+ "a list of edges"
1051
+ edges: [GqlBackgroundJobEdge]
1052
+ "a list of nodes"
1053
+ nodes: [GqlBackgroundJob]
1054
+ "details about this specific page"
1055
+ pageInfo: PageInfo!
1056
+ }
1057
+
1058
+ "An edge in a connection"
1059
+ type GqlBackgroundJobEdge {
1060
+ "cursor marks a unique position or index into the connection"
1061
+ cursor: String!
1062
+ "index in the connection"
1063
+ index: Int
1064
+ "The item at the end of the edge"
1065
+ node: GqlBackgroundJob
1066
+ }
1067
+
1033
1068
  "Condition for override item"
1034
1069
  type GqlCondition {
1035
1070
  "Item will apply only on this nodetype"
@@ -1109,58 +1144,6 @@ type GqlDashboard {
1109
1144
  toolsAccess: Boolean
1110
1145
  }
1111
1146
 
1112
- type GqlDistributedSessionsMutation {
1113
- "Delete a session"
1114
- removeSession(
1115
- "Session id"
1116
- id: String!
1117
- ): Boolean
1118
- }
1119
-
1120
- type GqlDistributedSessionsQuery {
1121
- localSessions(
1122
- "fetching only nodes after this node (exclusive)"
1123
- after: String,
1124
- "fetching only nodes before this node (exclusive)"
1125
- before: String,
1126
- "Filter by graphQL fields values"
1127
- fieldFilter: InputFieldFiltersInput,
1128
- "Group fields by criteria"
1129
- fieldGrouping: InputFieldGroupingInput,
1130
- "sort by GraphQL field values"
1131
- fieldSorter: InputFieldSorterInput,
1132
- "fetching only the first certain number of nodes"
1133
- first: Int,
1134
- "fetching only the last certain number of nodes"
1135
- last: Int,
1136
- "fetching only the first certain number of nodes"
1137
- limit: Int,
1138
- "fetching only nodes after this node (inclusive)"
1139
- offset: Int
1140
- ): GqlSessionConnection
1141
- sessions(
1142
- "fetching only nodes after this node (exclusive)"
1143
- after: String,
1144
- "fetching only nodes before this node (exclusive)"
1145
- before: String,
1146
- "Filter by graphQL fields values"
1147
- fieldFilter: InputFieldFiltersInput,
1148
- "Group fields by criteria"
1149
- fieldGrouping: InputFieldGroupingInput,
1150
- "sort by GraphQL field values"
1151
- fieldSorter: InputFieldSorterInput,
1152
- "fetching only the first certain number of nodes"
1153
- first: Int,
1154
- "fetching only the last certain number of nodes"
1155
- last: Int,
1156
- "fetching only the first certain number of nodes"
1157
- limit: Int,
1158
- "fetching only nodes after this node (inclusive)"
1159
- offset: Int
1160
- ): GqlSessionConnection
1161
- sessionsCount: Int
1162
- }
1163
-
1164
1147
  type GqlEditorForm {
1165
1148
  "Retrieve a description text for the form, might contain explanations on how to use the form"
1166
1149
  description: String
@@ -1380,9 +1363,29 @@ type GqlHealthCheck {
1380
1363
  status: GqlProbeStatus
1381
1364
  }
1382
1365
 
1383
- type GqlHzPartition {
1384
- id: Int
1385
- owner: String
1366
+ "jContent API"
1367
+ type GqlJContent {
1368
+ "Returns html with marked differences"
1369
+ diffHtml(
1370
+ "New html"
1371
+ newHtml: String,
1372
+ "Original html"
1373
+ originalHtml: String
1374
+ ): String
1375
+ }
1376
+
1377
+ "jContent API"
1378
+ type GqlJContentMutations {
1379
+ "Flushes cache for a page, checks adminCache permission and node type"
1380
+ flushPageCache(
1381
+ "Page path"
1382
+ pagePath: String!
1383
+ ): Boolean
1384
+ "Flushes cache for a site, will resolve site node if the path supplied is not a site, checks adminCache permission"
1385
+ flushSiteCache(
1386
+ "Site path"
1387
+ sitePath: String!
1388
+ ): Boolean
1386
1389
  }
1387
1390
 
1388
1391
  type GqlJcrImageTransformMutation {
@@ -1582,31 +1585,38 @@ type GqlPublicationBackgroundJob {
1582
1585
  group: String
1583
1586
  "The job (Boolean) property that correspond to the given name. The returned value will be null in case the job doesn't have the property"
1584
1587
  jobBooleanProperty(
1585
- "The job name"
1588
+ "The name of the property"
1586
1589
  name: String
1587
1590
  ): Boolean
1591
+ "Job description"
1592
+ jobDescription: String
1588
1593
  "The job (Int) property that correspond to the given name. The returned value will be null in case the job doesn't have the property"
1589
1594
  jobIntegerProperty(
1590
- "The job name"
1595
+ "The name of the property"
1591
1596
  name: String
1592
1597
  ): Int
1593
1598
  "The job (Long) property that correspond to the given name. The returned value will be null in case the job doesn't have the property"
1594
1599
  jobLongProperty(
1595
- "The job name"
1600
+ "The name of the property"
1596
1601
  name: String
1597
1602
  ): Long
1598
1603
  "The job state is different from the status, it reflect the last action done on the job instance (Started, Vetoed, Finished)"
1599
1604
  jobState: GqlBackgroundJobState
1600
1605
  "The job status"
1601
1606
  jobStatus: GqlBackgroundJobStatus
1607
+ "List of strings property from the job map (eg. publicationInfos, publicationPaths)"
1608
+ jobStringListProperty(
1609
+ "The name of the property"
1610
+ name: String
1611
+ ): [String]
1602
1612
  "The job (String) property that correspond to the given name. The returned value will be null in case the job doesn't have the property"
1603
1613
  jobStringProperty(
1604
- "The job name"
1614
+ "The name of the property"
1605
1615
  name: String
1606
1616
  ): String
1607
1617
  "Publication language"
1608
1618
  language: String
1609
- "The job name"
1619
+ "The name of the property"
1610
1620
  name: String
1611
1621
  "The site key. The returned value will be null in case the job doesn't have associated site key"
1612
1622
  siteKey: String
@@ -1645,7 +1655,26 @@ type GqlPublicationInfo {
1645
1655
  "Scheduler object which allows to access to background jobs"
1646
1656
  type GqlScheduler {
1647
1657
  "List of active jobs"
1648
- jobs: [GqlBackgroundJob]
1658
+ jobs(
1659
+ "fetching only nodes after this node (exclusive)"
1660
+ after: String,
1661
+ "fetching only nodes before this node (exclusive)"
1662
+ before: String,
1663
+ "Exclude jobs with these statuses"
1664
+ excludeStatuses: [GqlBackgroundJobStatus],
1665
+ "fetching only the first certain number of nodes"
1666
+ first: Int,
1667
+ "The group jobs belong to"
1668
+ group: String,
1669
+ "Include jobs with these statuses"
1670
+ includeStatuses: [GqlBackgroundJobStatus],
1671
+ "fetching only the last certain number of nodes"
1672
+ last: Int,
1673
+ "fetching only the first certain number of nodes"
1674
+ limit: Int,
1675
+ "fetching only nodes after this node (inclusive)"
1676
+ offset: Int
1677
+ ): GqlBackgroundJobConnection
1649
1678
  }
1650
1679
 
1651
1680
  "API Scope"
@@ -1656,36 +1685,6 @@ type GqlScope {
1656
1685
  name: String
1657
1686
  }
1658
1687
 
1659
- type GqlSession {
1660
- cost: Long
1661
- creationTime: String
1662
- id: String
1663
- lastAccessedTime: String
1664
- maxInactiveIntervalInSeconds: Int
1665
- partition: GqlHzPartition
1666
- user: User
1667
- }
1668
-
1669
- "A connection to a list of items."
1670
- type GqlSessionConnection {
1671
- "a list of edges"
1672
- edges: [GqlSessionEdge]
1673
- "a list of nodes"
1674
- nodes: [GqlSession]
1675
- "details about this specific page"
1676
- pageInfo: PageInfo!
1677
- }
1678
-
1679
- "An edge in a connection"
1680
- type GqlSessionEdge {
1681
- "cursor marks a unique position or index into the connection"
1682
- cursor: String!
1683
- "index in the connection"
1684
- index: Int
1685
- "The item at the end of the edge"
1686
- node: GqlSession
1687
- }
1688
-
1689
1688
  type GqlWorkflowEvent {
1690
1689
  "Number of tasks for current user"
1691
1690
  activeWorkflowTaskCountForUser: Int
@@ -2630,6 +2629,8 @@ type JCRSite implements JCRNode {
2630
2629
  defaultWipInfo: wipInfo
2631
2630
  "Returns the node definition that applies to this node."
2632
2631
  definition: JCRNodeDefinition
2632
+ "The depth in the JCR Tree of the JCR node this object represents"
2633
+ depth: Int!
2633
2634
  "GraphQL representation of a descendant node, based on its relative path"
2634
2635
  descendant(
2635
2636
  "Name or relative path of the sub node"
@@ -2653,6 +2654,8 @@ type JCRSite implements JCRNode {
2653
2654
  last: Int,
2654
2655
  "fetching only the first certain number of nodes"
2655
2656
  limit: Int,
2657
+ "Maximum depth in JCR tree for descendants from the current node, 0 (or less) for all sub nodes, 1 for one sub level, etc"
2658
+ maxDepth: Int,
2656
2659
  "fetching only nodes after this node (inclusive)"
2657
2660
  offset: Int,
2658
2661
  "Filter of descendant nodes by their property values; null to avoid such filtering"
@@ -2682,7 +2685,7 @@ type JCRSite implements JCRNode {
2682
2685
  "The name of the permission"
2683
2686
  permissionName: String!
2684
2687
  ): Boolean
2685
- "Returns the node of the home page"
2688
+ "Returns the node of the home page or null if no home page is defined or is not accessible"
2686
2689
  homePage: JCRNode
2687
2690
  "Retrieves a collection of module IDs, which are installed on the site, the node belongs to"
2688
2691
  installedModules: [String]
@@ -2929,8 +2932,6 @@ type JahiaAdminMutation {
2929
2932
  "Service name"
2930
2933
  service: String!
2931
2934
  ): Boolean
2932
- "Distributed sessions admin"
2933
- distributedSessions: GqlDistributedSessionsMutation
2934
2935
  "Shutdown the server"
2935
2936
  shutdown(
2936
2937
  "Do not send the shutdown event"
@@ -2953,8 +2954,6 @@ type JahiaAdminQuery {
2953
2954
  ): GqlConfigurationQuery
2954
2955
  "Details about the database Jahia is connected to"
2955
2956
  database: JahiaDatabase
2956
- "Distributed sessions admin"
2957
- distributedSessions: GqlDistributedSessionsQuery
2958
2957
  "HealthCheck node"
2959
2958
  healthCheck(
2960
2959
  "Returns only SAM probes with probe names included in this list"
@@ -3112,6 +3111,8 @@ type Mutation {
3112
3111
  admin: AdminMutation!
3113
3112
  "Main access field to the DX GraphQL Form mutation API"
3114
3113
  forms: GqlEditorFormMutations
3114
+ "Main access field to the jContent mutation API"
3115
+ jcontent: GqlJContentMutations
3115
3116
  "JCR Mutation"
3116
3117
  jcr(
3117
3118
  "Should save"
@@ -3328,6 +3329,8 @@ type Query {
3328
3329
  dashboard: GqlDashboard
3329
3330
  "Main access field to the DX GraphQL Form API"
3330
3331
  forms: GqlEditorForms
3332
+ "Main access field to the jContent API"
3333
+ jcontent: GqlJContent
3331
3334
  "JCR Queries"
3332
3335
  jcr(
3333
3336
  "The name of the workspace to fetch the node from; either EDIT, LIVE, or null to use EDIT by default"
@@ -3686,6 +3689,8 @@ type VanityUrl implements JCRNode {
3686
3689
  defaultWipInfo: wipInfo
3687
3690
  "Returns the node definition that applies to this node."
3688
3691
  definition: JCRNodeDefinition
3692
+ "The depth in the JCR Tree of the JCR node this object represents"
3693
+ depth: Int!
3689
3694
  "GraphQL representation of a descendant node, based on its relative path"
3690
3695
  descendant(
3691
3696
  "Name or relative path of the sub node"
@@ -3709,6 +3714,8 @@ type VanityUrl implements JCRNode {
3709
3714
  last: Int,
3710
3715
  "fetching only the first certain number of nodes"
3711
3716
  limit: Int,
3717
+ "Maximum depth in JCR tree for descendants from the current node, 0 (or less) for all sub nodes, 1 for one sub level, etc"
3718
+ maxDepth: Int,
3712
3719
  "fetching only nodes after this node (inclusive)"
3713
3720
  offset: Int,
3714
3721
  "Filter of descendant nodes by their property values; null to avoid such filtering"
@@ -32,6 +32,13 @@ export class Menu extends BaseComponent {
32
32
  return this;
33
33
  }
34
34
 
35
+ /** Can be used for choicelist dropdown menu */
36
+ selectByValue(value: string): Menu {
37
+ this.get().find(`.moonstone-menuItem[data-value="${value}"]`).scrollIntoView().should('be.visible');
38
+ this.get().find(`.moonstone-menuItem[data-value="${value}"]`).trigger('click');
39
+ return this;
40
+ }
41
+
35
42
  close(): Chainable<unknown> {
36
43
  return cy.get(Menu.overlaySelector).click('topRight');
37
44
  }
@@ -6,3 +6,18 @@ export const getJahiaVersion = (): Cypress.Chainable => {
6
6
  return result?.data?.admin.jahia.version;
7
7
  });
8
8
  };
9
+
10
+ export const getStartedModulesVersion = (): Cypress.Chainable => {
11
+ return cy.apollo({
12
+ fetchPolicy: 'no-cache',
13
+ queryFile: 'graphql/jcr/query/getStartedModulesVersion.graphql'
14
+ }).then(result => {
15
+ return result?.data?.dashboard.modules;
16
+ });
17
+ };
18
+
19
+ export const getStartedModuleVersion = (moduleId: string): Cypress.Chainable => {
20
+ return getStartedModulesVersion().then(modules => {
21
+ return modules.find(module => module.id === moduleId)?.version;
22
+ });
23
+ };
@@ -51,7 +51,7 @@ export const waitAllJobsFinished = (errorMessage?: string, timeout = 60000): voi
51
51
  queryFile: 'graphql/jcr/query/getJobsWithStatus.graphql'
52
52
  })
53
53
  .then(response => {
54
- const jobs = response?.data?.admin?.jahia?.scheduler?.jobs;
54
+ const jobs = response?.data?.admin?.jahia?.scheduler?.jobs.nodes;
55
55
  const publicationJobs = jobs.filter(job => job.group === 'PublicationJob');
56
56
  const hasActivePublicationJobs = publicationJobs.some(job => job.jobStatus === 'EXECUTING');
57
57
  return !hasActivePublicationJobs;