@jahia/cypress 3.17.3 → 3.17.5

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.
@@ -24,21 +24,24 @@ var Menu = /** @class */ (function (_super) {
24
24
  return _super !== null && _super.apply(this, arguments) || this;
25
25
  }
26
26
  Menu.prototype.submenu = function (item, menu) {
27
- this.get().find('.moonstone-menuItem').contains(item).should('be.visible').realHover();
27
+ this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible');
28
+ this.get().find('.moonstone-menuItem').contains(item).realHover();
28
29
  return utils_1.getComponentByRole(Menu, menu);
29
30
  };
30
31
  Menu.prototype.shouldHaveItem = function (item) {
31
- this.get().find('.moonstone-menuItem').contains(item).should('be.visible');
32
+ this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible');
32
33
  };
33
34
  Menu.prototype.shouldNotHaveItem = function (item) {
34
35
  this.get().find('.moonstone-menuItem').contains(item).should('not.exist');
35
36
  };
36
37
  Menu.prototype.select = function (item) {
37
- this.get().find('.moonstone-menuItem').contains(item).should('be.visible').trigger('click');
38
+ this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible');
39
+ this.get().find('.moonstone-menuItem').contains(item).trigger('click');
38
40
  return this;
39
41
  };
40
42
  Menu.prototype.selectByRole = function (item) {
41
- this.get().find(".moonstone-menuItem[data-sel-role=\"" + item + "\"]").should('be.visible').trigger('click');
43
+ this.get().find(".moonstone-menuItem[data-sel-role=\"" + item + "\"]").scrollIntoView().should('be.visible');
44
+ this.get().find(".moonstone-menuItem[data-sel-role=\"" + item + "\"]").trigger('click');
42
45
  return this;
43
46
  };
44
47
  Menu.defaultSelector = '.moonstone-menu:not(.moonstone-hidden)';
@@ -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: 1000 });
28
+ cy.readFile('./node_modules/@jahia/cypress/fixtures/' + fixtureParam, encoding, { log: false, timeout: 2000 });
29
29
  }
30
30
  catch (e) {
31
31
  console.log(e);
@@ -0,0 +1 @@
1
+ export declare const getJahiaVersion: () => Cypress.Chainable;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.getJahiaVersion = void 0;
4
+ var getJahiaVersion = function () {
5
+ return cy.apollo({
6
+ fetchPolicy: 'no-cache',
7
+ queryFile: 'graphql/jcr/query/getJahiaVersion.graphql'
8
+ }).then(function (result) {
9
+ var _a;
10
+ return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.admin.jahia.version;
11
+ });
12
+ };
13
+ exports.getJahiaVersion = getJahiaVersion;
@@ -4,3 +4,4 @@ export * from './SiteHelper';
4
4
  export * from './UsersHelper';
5
5
  export * from './VanityUrlHelper';
6
6
  export * from './ClusterHelper';
7
+ export * from './JahiaPlatformHelper';
@@ -16,3 +16,4 @@ __exportStar(require("./SiteHelper"), exports);
16
16
  __exportStar(require("./UsersHelper"), exports);
17
17
  __exportStar(require("./VanityUrlHelper"), exports);
18
18
  __exportStar(require("./ClusterHelper"), exports);
19
+ __exportStar(require("./JahiaPlatformHelper"), exports);
@@ -0,0 +1,12 @@
1
+ query {
2
+ admin {
3
+ jahia {
4
+ version {
5
+ release
6
+ build
7
+ buildDate
8
+ isSnapshot
9
+ }
10
+ }
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jahia/cypress",
3
- "version": "3.17.3",
3
+ "version": "3.17.5",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "lint": "eslint src -c .eslintrc.json --ext .ts"
@@ -5,12 +5,13 @@ export class Menu extends BaseComponent {
5
5
  static defaultSelector = '.moonstone-menu:not(.moonstone-hidden)'
6
6
 
7
7
  submenu(item: string, menu: string): Menu {
8
- this.get().find('.moonstone-menuItem').contains(item).should('be.visible').realHover();
8
+ this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible');
9
+ this.get().find('.moonstone-menuItem').contains(item).realHover();
9
10
  return getComponentByRole(Menu, menu);
10
11
  }
11
12
 
12
13
  shouldHaveItem(item: string):void {
13
- this.get().find('.moonstone-menuItem').contains(item).should('be.visible');
14
+ this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible');
14
15
  }
15
16
 
16
17
  shouldNotHaveItem(item: string):void {
@@ -18,12 +19,14 @@ export class Menu extends BaseComponent {
18
19
  }
19
20
 
20
21
  select(item: string): Menu {
21
- this.get().find('.moonstone-menuItem').contains(item).should('be.visible').trigger('click');
22
+ this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible');
23
+ this.get().find('.moonstone-menuItem').contains(item).trigger('click');
22
24
  return this;
23
25
  }
24
26
 
25
27
  selectByRole(item: string): Menu {
26
- this.get().find(`.moonstone-menuItem[data-sel-role="${item}"]`).should('be.visible').trigger('click');
28
+ this.get().find(`.moonstone-menuItem[data-sel-role="${item}"]`).scrollIntoView().should('be.visible');
29
+ this.get().find(`.moonstone-menuItem[data-sel-role="${item}"]`).trigger('click');
27
30
  return this;
28
31
  }
29
32
  }
@@ -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: 1000});
19
+ cy.readFile('./node_modules/@jahia/cypress/fixtures/' + fixtureParam, encoding, {log: false, timeout: 2000});
20
20
  } catch (e) {
21
21
  console.log(e);
22
22
  }
@@ -0,0 +1,8 @@
1
+ export const getJahiaVersion = (): Cypress.Chainable => {
2
+ return cy.apollo({
3
+ fetchPolicy: 'no-cache',
4
+ queryFile: 'graphql/jcr/query/getJahiaVersion.graphql'
5
+ }).then(result => {
6
+ return result?.data?.admin.jahia.version;
7
+ });
8
+ };
@@ -4,3 +4,4 @@ export * from './SiteHelper';
4
4
  export * from './UsersHelper';
5
5
  export * from './VanityUrlHelper';
6
6
  export * from './ClusterHelper';
7
+ export * from './JahiaPlatformHelper';