@jahia/cypress 3.17.2 → 3.17.4
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.
- package/dist/page-object/moonstone/menu.d.ts +3 -0
- package/dist/page-object/moonstone/menu.js +15 -5
- package/dist/support/commands.d.ts +1 -0
- package/dist/support/commands.js +1 -0
- package/package.json +3 -2
- package/src/page-object/moonstone/menu.ts +18 -5
- package/src/support/commands.ts +1 -0
- package/tsconfig.json +6 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { BaseComponent } from '../baseComponent';
|
|
2
2
|
export declare class Menu extends BaseComponent {
|
|
3
3
|
static defaultSelector: string;
|
|
4
|
+
submenu(item: string, menu: string): Menu;
|
|
5
|
+
shouldHaveItem(item: string): void;
|
|
6
|
+
shouldNotHaveItem(item: string): void;
|
|
4
7
|
select(item: string): Menu;
|
|
5
8
|
selectByRole(item: string): Menu;
|
|
6
9
|
}
|
|
@@ -17,20 +17,30 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
exports.__esModule = true;
|
|
18
18
|
exports.Menu = void 0;
|
|
19
19
|
var baseComponent_1 = require("../baseComponent");
|
|
20
|
+
var utils_1 = require("../utils");
|
|
20
21
|
var Menu = /** @class */ (function (_super) {
|
|
21
22
|
__extends(Menu, _super);
|
|
22
23
|
function Menu() {
|
|
23
24
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
25
|
}
|
|
26
|
+
Menu.prototype.submenu = function (item, menu) {
|
|
27
|
+
this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible');
|
|
28
|
+
this.get().find('.moonstone-menuItem').contains(item).realHover();
|
|
29
|
+
return utils_1.getComponentByRole(Menu, menu);
|
|
30
|
+
};
|
|
31
|
+
Menu.prototype.shouldHaveItem = function (item) {
|
|
32
|
+
this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible');
|
|
33
|
+
};
|
|
34
|
+
Menu.prototype.shouldNotHaveItem = function (item) {
|
|
35
|
+
this.get().find('.moonstone-menuItem').contains(item).should('not.exist');
|
|
36
|
+
};
|
|
25
37
|
Menu.prototype.select = function (item) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.get().find('.moonstone-menuItem').should('contain', item).contains(item).trigger('click');
|
|
38
|
+
this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible');
|
|
39
|
+
this.get().find('.moonstone-menuItem').contains(item).trigger('click');
|
|
29
40
|
return this;
|
|
30
41
|
};
|
|
31
42
|
Menu.prototype.selectByRole = function (item) {
|
|
32
|
-
|
|
33
|
-
cy.wait(500);
|
|
43
|
+
this.get().find(".moonstone-menuItem[data-sel-role=\"" + item + "\"]").scrollIntoView().should('be.visible');
|
|
34
44
|
this.get().find(".moonstone-menuItem[data-sel-role=\"" + item + "\"]").trigger('click');
|
|
35
45
|
return this;
|
|
36
46
|
};
|
package/dist/support/commands.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jahia/cypress",
|
|
3
|
-
"version": "3.17.
|
|
3
|
+
"version": "3.17.4",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "tsc",
|
|
6
6
|
"lint": "eslint src -c .eslintrc.json --ext .ts"
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"@jahia/eslint-config": "^1.1.0",
|
|
19
19
|
"@typescript-eslint/eslint-plugin": "^4.29.3",
|
|
20
20
|
"@typescript-eslint/parser": "^4.29.3",
|
|
21
|
+
"cross-fetch": "^3.1.5",
|
|
21
22
|
"cypress": "^12.2.0",
|
|
22
23
|
"cypress-wait-until": "^1.7.2",
|
|
23
24
|
"eslint": "^7.32.0",
|
|
24
25
|
"eslint-plugin-cypress": "^2.11.3",
|
|
25
|
-
"cross-fetch": "^3.1.5",
|
|
26
26
|
"eslint-plugin-jest": "^27.2.1",
|
|
27
27
|
"eslint-plugin-react": "^7.32.2",
|
|
28
28
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@apollo/client": "^3.4.9",
|
|
33
|
+
"cypress-real-events": "^1.11.0",
|
|
33
34
|
"graphql": "^15.5.0",
|
|
34
35
|
"graphql-tag": "^2.11.0"
|
|
35
36
|
}
|
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
import {BaseComponent} from '../baseComponent';
|
|
2
|
+
import {getComponentByRole} from '../utils';
|
|
2
3
|
|
|
3
4
|
export class Menu extends BaseComponent {
|
|
4
5
|
static defaultSelector = '.moonstone-menu:not(.moonstone-hidden)'
|
|
5
6
|
|
|
7
|
+
submenu(item: string, menu: string): Menu {
|
|
8
|
+
this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible');
|
|
9
|
+
this.get().find('.moonstone-menuItem').contains(item).realHover();
|
|
10
|
+
return getComponentByRole(Menu, menu);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
shouldHaveItem(item: string):void {
|
|
14
|
+
this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
shouldNotHaveItem(item: string):void {
|
|
18
|
+
this.get().find('.moonstone-menuItem').contains(item).should('not.exist');
|
|
19
|
+
}
|
|
20
|
+
|
|
6
21
|
select(item: string): Menu {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this.get().find('.moonstone-menuItem').should('contain', item).contains(item).trigger('click');
|
|
22
|
+
this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible');
|
|
23
|
+
this.get().find('.moonstone-menuItem').contains(item).trigger('click');
|
|
10
24
|
return this;
|
|
11
25
|
}
|
|
12
26
|
|
|
13
27
|
selectByRole(item: string): Menu {
|
|
14
|
-
|
|
15
|
-
cy.wait(500);
|
|
28
|
+
this.get().find(`.moonstone-menuItem[data-sel-role="${item}"]`).scrollIntoView().should('be.visible');
|
|
16
29
|
this.get().find(`.moonstone-menuItem[data-sel-role="${item}"]`).trigger('click');
|
|
17
30
|
return this;
|
|
18
31
|
}
|
package/src/support/commands.ts
CHANGED
package/tsconfig.json
CHANGED