@jahia/cypress 1.1.2 → 1.1.3
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/collapsible.d.ts +6 -0
- package/dist/page-object/moonstone/{muiinput.js → collapsible.js} +21 -11
- package/dist/page-object/moonstone/index.d.ts +1 -0
- package/dist/page-object/moonstone/index.js +1 -0
- package/{.idea/jahia-cypress.iml → jahia-cypress.iml} +3 -1
- package/package.json +1 -1
- package/src/page-object/moonstone/collapsible.ts +24 -0
- package/src/page-object/moonstone/index.ts +1 -0
- package/.eslintignore +0 -1
- package/.eslintrc.json +0 -11
- package/.github/workflows/npm_publish.yml +0 -18
- package/.graphqlconfig +0 -16
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/runConfigurations.xml +0 -10
- package/.idea/sonarlint/issuestore/8/9/8995cd54601f633e8bca96b4e0b06ae4272afe02 +0 -3
- package/.idea/sonarlint/issuestore/index.pb +0 -3
- package/.idea/vcs.xml +0 -6
- package/dist/page-object/iframe.d.ts +0 -10
- package/dist/page-object/iframe.js +0 -46
- package/dist/page-object/moonstone/muiinput.d.ts +0 -8
- package/dist/page-object/moonstone/muiradio.d.ts +0 -5
- package/dist/page-object/moonstone/muiradio.js +0 -32
- package/dist/support/reloadUntil.d.ts +0 -15
- package/dist/support/reloadUntil.js +0 -50
- package/dist/support/waitUntil.d.ts +0 -15
- package/dist/support/waitUntil.js +0 -44
- package/jahia-cypress-v1.0.10.tgz +0 -0
- package/jahia-cypress-v1.1.0.tgz +0 -0
- package/yalc.lock +0 -9
|
@@ -15,22 +15,32 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
17
|
exports.__esModule = true;
|
|
18
|
-
exports.
|
|
18
|
+
exports.Collapsible = void 0;
|
|
19
19
|
var baseComponent_1 = require("../baseComponent");
|
|
20
|
-
var
|
|
21
|
-
__extends(
|
|
22
|
-
function
|
|
20
|
+
var Collapsible = /** @class */ (function (_super) {
|
|
21
|
+
__extends(Collapsible, _super);
|
|
22
|
+
function Collapsible() {
|
|
23
23
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
this
|
|
25
|
+
Collapsible.prototype.collapse = function () {
|
|
26
|
+
var _this = this;
|
|
27
|
+
this.get().children('div').then(function ($child) {
|
|
28
|
+
if ($child.hasClass('moonstone-collapsible_content_expanded')) {
|
|
29
|
+
_this.get().find('.moonstone-collapsible_button').click();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
27
32
|
return this;
|
|
28
33
|
};
|
|
29
|
-
|
|
30
|
-
this
|
|
34
|
+
Collapsible.prototype.expand = function () {
|
|
35
|
+
var _this = this;
|
|
36
|
+
this.get().children('div').then(function ($child) {
|
|
37
|
+
if ($child.hasClass('moonstone-collapsible_content_collapsed')) {
|
|
38
|
+
_this.get().find('.moonstone-collapsible_button').click().scrollIntoView();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
31
41
|
return this;
|
|
32
42
|
};
|
|
33
|
-
|
|
34
|
-
return
|
|
43
|
+
Collapsible.defaultSelector = '.moonstone-collapsible';
|
|
44
|
+
return Collapsible;
|
|
35
45
|
}(baseComponent_1.BaseComponent));
|
|
36
|
-
exports.
|
|
46
|
+
exports.Collapsible = Collapsible;
|
|
@@ -12,6 +12,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
12
|
exports.__esModule = true;
|
|
13
13
|
__exportStar(require("./accordion"), exports);
|
|
14
14
|
__exportStar(require("./button"), exports);
|
|
15
|
+
__exportStar(require("./collapsible"), exports);
|
|
15
16
|
__exportStar(require("./dropdown"), exports);
|
|
16
17
|
__exportStar(require("./menu"), exports);
|
|
17
18
|
__exportStar(require("./pagination"), exports);
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
<module type="JAVA_MODULE" version="4">
|
|
3
3
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
4
|
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$"
|
|
5
|
+
<content url="file://$MODULE_DIR$">
|
|
6
|
+
<sourceFolder url="file://$MODULE_DIR$/fixtures/groovy/admin" isTestSource="false" />
|
|
7
|
+
</content>
|
|
6
8
|
<orderEntry type="inheritedJdk" />
|
|
7
9
|
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
10
|
</component>
|
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {BaseComponent} from "../baseComponent"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export class Collapsible extends BaseComponent {
|
|
5
|
+
static defaultSelector = '.moonstone-collapsible'
|
|
6
|
+
|
|
7
|
+
collapse(): Collapsible {
|
|
8
|
+
this.get().children('div').then(($child) => {
|
|
9
|
+
if ($child.hasClass('moonstone-collapsible_content_expanded')) {
|
|
10
|
+
this.get().find('.moonstone-collapsible_button').click()
|
|
11
|
+
}
|
|
12
|
+
})
|
|
13
|
+
return this
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
expand(): Collapsible {
|
|
17
|
+
this.get().children('div').then(($child) => {
|
|
18
|
+
if ($child.hasClass('moonstone-collapsible_content_collapsed')) {
|
|
19
|
+
this.get().find('.moonstone-collapsible_button').click().scrollIntoView()
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
return this
|
|
23
|
+
}
|
|
24
|
+
}
|
package/.eslintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
node_modules
|
package/.eslintrc.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
name: Publish Package to npmjs
|
|
2
|
-
on:
|
|
3
|
-
release:
|
|
4
|
-
types: [created]
|
|
5
|
-
jobs:
|
|
6
|
-
build:
|
|
7
|
-
runs-on: ubuntu-latest
|
|
8
|
-
steps:
|
|
9
|
-
- uses: actions/checkout@v2
|
|
10
|
-
# Setup .npmrc file to publish to npm
|
|
11
|
-
- uses: actions/setup-node@v2
|
|
12
|
-
with:
|
|
13
|
-
node-version: '16.x'
|
|
14
|
-
registry-url: 'https://registry.npmjs.org'
|
|
15
|
-
- run: npm run build
|
|
16
|
-
- run: npm publish --access public
|
|
17
|
-
env:
|
|
18
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
|
package/.graphqlconfig
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Untitled GraphQL Schema",
|
|
3
|
-
"schemaPath": "schema.graphql",
|
|
4
|
-
"extensions": {
|
|
5
|
-
"endpoints": {
|
|
6
|
-
"Default GraphQL Endpoint": {
|
|
7
|
-
"url": "http://localhost:8080/modules/graphql",
|
|
8
|
-
"headers": {
|
|
9
|
-
"user-agent": "JS GraphQL",
|
|
10
|
-
"Authorization": "Basic cm9vdDpyb290MTIzNA=="
|
|
11
|
-
},
|
|
12
|
-
"introspect": true
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
package/.idea/misc.xml
DELETED
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/jahia-cypress.iml" filepath="$PROJECT_DIR$/.idea/jahia-cypress.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="RunConfigurationProducerService">
|
|
4
|
-
<option name="ignoredProducers">
|
|
5
|
-
<set>
|
|
6
|
-
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
|
7
|
-
</set>
|
|
8
|
-
</option>
|
|
9
|
-
</component>
|
|
10
|
-
</project>
|
package/.idea/vcs.xml
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
import { BaseComponent } from "./baseComponent";
|
|
3
|
-
import Chainable = Cypress.Chainable;
|
|
4
|
-
export declare class IFrame extends BaseComponent {
|
|
5
|
-
static defaultSelector: string;
|
|
6
|
-
private body;
|
|
7
|
-
constructor(element: Chainable<JQuery>, assertion?: (s: JQuery) => void);
|
|
8
|
-
getBody(): Chainable<JQuery>;
|
|
9
|
-
enter(): void;
|
|
10
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
exports.__esModule = true;
|
|
18
|
-
exports.IFrame = void 0;
|
|
19
|
-
var baseComponent_1 = require("./baseComponent");
|
|
20
|
-
var IFrame = /** @class */ (function (_super) {
|
|
21
|
-
__extends(IFrame, _super);
|
|
22
|
-
function IFrame(element, assertion) {
|
|
23
|
-
var _this = _super.call(this, element, assertion) || this;
|
|
24
|
-
_this.get()
|
|
25
|
-
.should(function (f) {
|
|
26
|
-
var fr = f[0];
|
|
27
|
-
expect(fr.contentWindow.location.href).not.equals('about:blank');
|
|
28
|
-
expect(fr.contentWindow.document.readyState).equals('complete');
|
|
29
|
-
expect(fr.contentDocument.body).not.be.empty;
|
|
30
|
-
})
|
|
31
|
-
.its('0.contentDocument.body').as('framebody' + _this.id);
|
|
32
|
-
return _this;
|
|
33
|
-
}
|
|
34
|
-
IFrame.prototype.getBody = function () {
|
|
35
|
-
return cy.get('@framebody' + this.id);
|
|
36
|
-
};
|
|
37
|
-
IFrame.prototype.enter = function () {
|
|
38
|
-
this.get().then(function (f) {
|
|
39
|
-
var fr = f[0];
|
|
40
|
-
cy.visit(fr.contentWindow.location.href);
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
IFrame.defaultSelector = 'iframe';
|
|
44
|
-
return IFrame;
|
|
45
|
-
}(baseComponent_1.BaseComponent));
|
|
46
|
-
exports.IFrame = IFrame;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
import { BaseComponent } from "../baseComponent";
|
|
3
|
-
import TypeOptions = Cypress.TypeOptions;
|
|
4
|
-
export declare class MUIInput extends BaseComponent {
|
|
5
|
-
static defaultSelector: string;
|
|
6
|
-
clear(): MUIInput;
|
|
7
|
-
type(text: string, options?: Partial<TypeOptions>): MUIInput;
|
|
8
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
exports.__esModule = true;
|
|
18
|
-
exports.MUIRadio = void 0;
|
|
19
|
-
var baseComponent_1 = require("../baseComponent");
|
|
20
|
-
var MUIRadio = /** @class */ (function (_super) {
|
|
21
|
-
__extends(MUIRadio, _super);
|
|
22
|
-
function MUIRadio() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
MUIRadio.prototype.click = function () {
|
|
26
|
-
this.get().click();
|
|
27
|
-
return this;
|
|
28
|
-
};
|
|
29
|
-
MUIRadio.defaultSelector = 'label';
|
|
30
|
-
return MUIRadio;
|
|
31
|
-
}(baseComponent_1.BaseComponent));
|
|
32
|
-
exports.MUIRadio = MUIRadio;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
declare type ReloadUntilOptions = {
|
|
3
|
-
attempts: number;
|
|
4
|
-
reloadCallback: () => void;
|
|
5
|
-
delay: number;
|
|
6
|
-
};
|
|
7
|
-
declare global {
|
|
8
|
-
namespace Cypress {
|
|
9
|
-
interface Chainable<Subject> {
|
|
10
|
-
reloadUntil(selector: string, options: Partial<ReloadUntilOptions>): Chainable<Cypress.Response<any>>;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export declare const reloadUntil: (selector: string, options: Partial<ReloadUntilOptions>) => void;
|
|
15
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */
|
|
3
|
-
var __assign = (this && this.__assign) || function () {
|
|
4
|
-
__assign = Object.assign || function(t) {
|
|
5
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
-
s = arguments[i];
|
|
7
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
-
t[p] = s[p];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
return __assign.apply(this, arguments);
|
|
13
|
-
};
|
|
14
|
-
exports.__esModule = true;
|
|
15
|
-
exports.reloadUntil = void 0;
|
|
16
|
-
var defaultOptions = {
|
|
17
|
-
attempts: 10,
|
|
18
|
-
reloadCallback: function () { return cy.reload({ log: false }); },
|
|
19
|
-
delay: 1000
|
|
20
|
-
};
|
|
21
|
-
var reloadUntil = function (selector, options) {
|
|
22
|
-
options = __assign(__assign({}, defaultOptions), options);
|
|
23
|
-
var log = Cypress.log({
|
|
24
|
-
name: 'reloadUntil',
|
|
25
|
-
message: "Reload until " + selector + ", remaining attempts : " + options.attempts,
|
|
26
|
-
consoleProps: function () {
|
|
27
|
-
return {
|
|
28
|
-
attempts: options.attempts
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
var items = Cypress.$(selector);
|
|
33
|
-
if (items.length) {
|
|
34
|
-
log.set({ $el: items });
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (options.attempts > 1) {
|
|
38
|
-
log.end();
|
|
39
|
-
options.reloadCallback();
|
|
40
|
-
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
41
|
-
cy.wait(options.delay);
|
|
42
|
-
cy.reloadUntil(selector, __assign(__assign({}, options), { attempts: options.attempts - 1 }));
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
var err = Error('Items not found.');
|
|
46
|
-
log.error(err);
|
|
47
|
-
throw err;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
exports.reloadUntil = reloadUntil;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
declare type ReloadUntilOptions = {
|
|
3
|
-
attempts: number;
|
|
4
|
-
reloadCallback: () => void;
|
|
5
|
-
delay: number;
|
|
6
|
-
};
|
|
7
|
-
declare global {
|
|
8
|
-
namespace Cypress {
|
|
9
|
-
interface Chainable<Subject> {
|
|
10
|
-
reloadUntil(selector: string, options: Partial<ReloadUntilOptions>): Chainable<Cypress.Response<any>>;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export declare const reloadUntil: (selector: string, options: Partial<ReloadUntilOptions>) => void;
|
|
15
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */
|
|
3
|
-
var __assign = (this && this.__assign) || function () {
|
|
4
|
-
__assign = Object.assign || function(t) {
|
|
5
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
-
s = arguments[i];
|
|
7
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
-
t[p] = s[p];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
return __assign.apply(this, arguments);
|
|
13
|
-
};
|
|
14
|
-
exports.__esModule = true;
|
|
15
|
-
exports.reloadUntil = void 0;
|
|
16
|
-
var defaultOptions = {
|
|
17
|
-
attempts: 10,
|
|
18
|
-
reloadCallback: function () { return cy.reload({ log: false }); },
|
|
19
|
-
delay: 1000
|
|
20
|
-
};
|
|
21
|
-
var reloadUntil = function (selector, options) {
|
|
22
|
-
options = __assign(__assign({}, defaultOptions), options);
|
|
23
|
-
var log = Cypress.log({
|
|
24
|
-
name: 'reloadUntil',
|
|
25
|
-
message: "Reload until " + selector + ", remaining attempts : " + options.attempts
|
|
26
|
-
});
|
|
27
|
-
var $items = Cypress.$(selector);
|
|
28
|
-
if ($items.length) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (options.attempts > 1) {
|
|
32
|
-
log.finish();
|
|
33
|
-
options.reloadCallback();
|
|
34
|
-
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
35
|
-
cy.wait(1000, { log: false });
|
|
36
|
-
cy.reloadUntil(selector, __assign(__assign({}, options), { attempts: options.attempts - 1 }));
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
var err = Error('Items not found.');
|
|
40
|
-
log.error(err);
|
|
41
|
-
throw err;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
exports.reloadUntil = reloadUntil;
|
|
Binary file
|
package/jahia-cypress-v1.1.0.tgz
DELETED
|
Binary file
|