@jahia/cypress 3.32.0 → 3.33.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;
@@ -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.33.0",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "lint": "eslint src -c .eslintrc.json --ext .ts"
@@ -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
+ };