@jahia/cypress 3.16.0 → 3.17.1

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.
@@ -26,7 +26,7 @@ var Dropdown = /** @class */ (function (_super) {
26
26
  }
27
27
  Dropdown.prototype.select = function (item) {
28
28
  this.get().click();
29
- utils_1.getComponent(menu_1.Menu).select(item);
29
+ utils_1.getComponent(menu_1.Menu, null, function ($el) { return expect($el).to.be.visible; }).select(item);
30
30
  return this;
31
31
  };
32
32
  Dropdown.defaultSelector = '.moonstone-dropdown_container';
@@ -53,8 +53,8 @@ var getNodeByPath = function (path, properties, language, childrenTypes, workspa
53
53
  path: path,
54
54
  properties: properties,
55
55
  language: language,
56
- childrenTypes: childrenTypes,
57
- workspace: workspace
56
+ childrenTypes: childrenTypes || [],
57
+ workspace: workspace || 'EDIT'
58
58
  },
59
59
  queryFile: 'graphql/jcr/query/getNodeByPath.graphql'
60
60
  });
@@ -1,4 +1,5 @@
1
1
  export declare const grantRoles: (pathOrId: string, roleNames: Array<string>, principalName: string, principalType: string) => Cypress.Chainable;
2
+ export declare const revokeRoles: (pathOrId: string, roleNames: Array<string>, principalName: string, principalType: string) => Cypress.Chainable;
2
3
  export declare const createUser: (userName: string, password: string, properties?: {
3
4
  name: string;
4
5
  value: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.addUserToGroup = exports.deleteUser = exports.createUser = exports.grantRoles = void 0;
3
+ exports.addUserToGroup = exports.deleteUser = exports.createUser = exports.revokeRoles = exports.grantRoles = void 0;
4
4
  var grantRoles = function (pathOrId, roleNames, principalName, principalType) {
5
5
  cy.log('Grant role(s) ' + roleNames + ' with principal type ' + principalType + ' to ' + principalName + ' on node ' + pathOrId);
6
6
  return cy.apollo({
@@ -14,6 +14,19 @@ var grantRoles = function (pathOrId, roleNames, principalName, principalType) {
14
14
  });
15
15
  };
16
16
  exports.grantRoles = grantRoles;
17
+ var revokeRoles = function (pathOrId, roleNames, principalName, principalType) {
18
+ cy.log('Revoke role(s) ' + roleNames + ' with principal type ' + principalType + ' to ' + principalName + ' on node ' + pathOrId);
19
+ return cy.apollo({
20
+ variables: {
21
+ pathOrId: pathOrId,
22
+ roleNames: roleNames,
23
+ principalName: principalName,
24
+ principalType: principalType
25
+ },
26
+ mutationFile: 'graphql/jcr/mutation/revokeRoles.graphql'
27
+ });
28
+ };
29
+ exports.revokeRoles = revokeRoles;
17
30
  var createUser = function (userName, password, properties) {
18
31
  if (properties === void 0) { properties = []; }
19
32
  var userProperties = properties.map(function (property) {
@@ -0,0 +1,16 @@
1
+ mutation revokeRoles(
2
+ $pathOrId: String!
3
+ $roleNames: [String]!
4
+ $principalName: String!
5
+ $principalType: PrincipalType!
6
+ ) {
7
+ jcr {
8
+ mutateNode(pathOrId: $pathOrId) {
9
+ revokeRoles(
10
+ roleNames: $roleNames
11
+ principalType: $principalType
12
+ principalName: $principalName
13
+ )
14
+ }
15
+ }
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jahia/cypress",
3
- "version": "3.16.0",
3
+ "version": "3.17.1",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "lint": "eslint src -c .eslintrc.json --ext .ts"
@@ -7,7 +7,7 @@ export class Dropdown extends BaseComponent {
7
7
 
8
8
  select(item: string): Dropdown {
9
9
  this.get().click();
10
- getComponent(Menu).select(item);
10
+ getComponent(Menu, null, $el => expect($el).to.be.visible).select(item);
11
11
  return this;
12
12
  }
13
13
  }
@@ -49,8 +49,8 @@ export const getNodeByPath = (path: string, properties?: string[], language?: st
49
49
  path: path,
50
50
  properties: properties,
51
51
  language: language,
52
- childrenTypes: childrenTypes,
53
- workspace: workspace
52
+ childrenTypes: childrenTypes || [],
53
+ workspace: workspace || 'EDIT'
54
54
  },
55
55
  queryFile: 'graphql/jcr/query/getNodeByPath.graphql'
56
56
  });
@@ -12,6 +12,19 @@ export const grantRoles = (pathOrId: string, roleNames: Array<string>, principal
12
12
  });
13
13
  };
14
14
 
15
+ export const revokeRoles = (pathOrId: string, roleNames: Array<string>, principalName: string, principalType: string): Cypress.Chainable => {
16
+ cy.log('Revoke role(s) ' + roleNames + ' with principal type ' + principalType + ' to ' + principalName + ' on node ' + pathOrId);
17
+ return cy.apollo({
18
+ variables: {
19
+ pathOrId: pathOrId,
20
+ roleNames: roleNames,
21
+ principalName: principalName,
22
+ principalType: principalType
23
+ },
24
+ mutationFile: 'graphql/jcr/mutation/revokeRoles.graphql'
25
+ });
26
+ };
27
+
15
28
  export const createUser = (userName: string, password: string, properties: { name: string, value: string }[] = []): void => {
16
29
  const userProperties = properties.map(property => {
17
30
  return 'properties.setProperty("' + property.name + '", "' + property.value + '")';