From 10cb822ba3edc5ce94c21b99e75c76238072b41f Mon Sep 17 00:00:00 2001 From: "david.griffon" Date: Mon, 8 Jul 2024 10:41:47 +0200 Subject: [PATCH] TECH-1852 : remove dist directory --- dist/index.d.ts | 4 - dist/index.js | 16 -- dist/page-object/baseComponent.d.ts | 17 -- dist/page-object/baseComponent.js | 34 ---- dist/page-object/basePage.d.ts | 2 - dist/page-object/basePage.js | 9 - dist/page-object/html/iframe.d.ts | 10 -- dist/page-object/html/iframe.js | 47 ----- dist/page-object/html/index.d.ts | 1 - dist/page-object/html/index.js | 13 -- dist/page-object/index.d.ts | 6 - dist/page-object/index.js | 18 -- dist/page-object/material/index.d.ts | 2 - dist/page-object/material/index.js | 14 -- dist/page-object/material/muiinput.d.ts | 8 - dist/page-object/material/muiinput.js | 36 ---- dist/page-object/material/muiradio.d.ts | 5 - dist/page-object/material/muiradio.js | 32 ---- dist/page-object/moonstone/accordion.d.ts | 9 - dist/page-object/moonstone/accordion.js | 40 ----- dist/page-object/moonstone/button.d.ts | 5 - dist/page-object/moonstone/button.js | 32 ---- dist/page-object/moonstone/collapsible.d.ts | 8 - dist/page-object/moonstone/collapsible.js | 52 ------ dist/page-object/moonstone/dropdown.d.ts | 5 - dist/page-object/moonstone/dropdown.js | 37 ---- dist/page-object/moonstone/index.d.ts | 9 - dist/page-object/moonstone/index.js | 21 --- dist/page-object/moonstone/menu.d.ts | 9 - dist/page-object/moonstone/menu.js | 50 ------ dist/page-object/moonstone/pagination.d.ts | 8 - dist/page-object/moonstone/pagination.js | 42 ----- dist/page-object/moonstone/primaryNav.d.ts | 7 - dist/page-object/moonstone/primaryNav.js | 36 ---- dist/page-object/moonstone/secondaryNav.d.ts | 4 - dist/page-object/moonstone/secondaryNav.js | 28 --- dist/page-object/moonstone/table.d.ts | 13 -- dist/page-object/moonstone/table.js | 52 ------ dist/page-object/utils.d.ts | 11 -- dist/page-object/utils.js | 40 ----- dist/plugins/env.d.ts | 2 - dist/plugins/env.js | 20 --- dist/plugins/index.d.ts | 1 - dist/plugins/index.js | 13 -- dist/plugins/registerPlugins.d.ts | 1 - dist/plugins/registerPlugins.js | 11 -- dist/support/apollo/apollo.d.ts | 17 -- dist/support/apollo/apollo.js | 92 ---------- dist/support/apollo/apolloClient.d.ts | 20 --- dist/support/apollo/apolloClient.js | 52 ------ dist/support/apollo/index.d.ts | 2 - dist/support/apollo/index.js | 14 -- dist/support/apollo/links.d.ts | 3 - dist/support/apollo/links.js | 71 -------- dist/support/commands.d.ts | 2 - dist/support/commands.js | 4 - dist/support/fixture.d.ts | 2 - dist/support/fixture.js | 36 ---- dist/support/index.d.ts | 5 - dist/support/index.js | 17 -- dist/support/login.d.ts | 11 -- dist/support/login.js | 41 ----- dist/support/logout.d.ts | 9 - dist/support/logout.js | 23 --- dist/support/provisioning/executeGroovy.d.ts | 18 -- dist/support/provisioning/executeGroovy.js | 22 --- dist/support/provisioning/index.d.ts | 4 - dist/support/provisioning/index.js | 16 -- dist/support/provisioning/installBundle.d.ts | 9 - dist/support/provisioning/installBundle.js | 12 -- .../provisioning/runProvisioningScript.d.ts | 24 --- .../provisioning/runProvisioningScript.js | 106 ------------ .../support/provisioning/uninstallBundle.d.ts | 9 - dist/support/provisioning/uninstallBundle.js | 12 -- dist/support/registerSupport.d.ts | 1 - dist/support/registerSupport.js | 22 --- dist/support/repeatUntil.d.ts | 14 -- dist/support/repeatUntil.js | 51 ------ dist/utils/ClusterHelper.d.ts | 1 - dist/utils/ClusterHelper.js | 27 --- dist/utils/GraphQLHelper.d.ts | 1 - dist/utils/GraphQLHelper.js | 163 ------------------ dist/utils/JCRHelper.d.ts | 17 -- dist/utils/JCRHelper.js | 94 ---------- dist/utils/JahiaPlatformHelper.d.ts | 1 - dist/utils/JahiaPlatformHelper.js | 13 -- dist/utils/PublicationAndWorkflowHelper.d.ts | 6 - dist/utils/PublicationAndWorkflowHelper.js | 73 -------- dist/utils/SAMHelper.d.ts | 1 - dist/utils/SAMHelper.js | 42 ----- dist/utils/SiteHelper.d.ts | 13 -- dist/utils/SiteHelper.js | 43 ----- dist/utils/UsersHelper.d.ts | 8 - dist/utils/UsersHelper.js | 55 ------ dist/utils/VanityUrlHelper.d.ts | 3 - dist/utils/VanityUrlHelper.js | 34 ---- dist/utils/index.d.ts | 9 - dist/utils/index.js | 21 --- 98 files changed, 2206 deletions(-) delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/page-object/baseComponent.d.ts delete mode 100644 dist/page-object/baseComponent.js delete mode 100644 dist/page-object/basePage.d.ts delete mode 100644 dist/page-object/basePage.js delete mode 100644 dist/page-object/html/iframe.d.ts delete mode 100644 dist/page-object/html/iframe.js delete mode 100644 dist/page-object/html/index.d.ts delete mode 100644 dist/page-object/html/index.js delete mode 100644 dist/page-object/index.d.ts delete mode 100644 dist/page-object/index.js delete mode 100644 dist/page-object/material/index.d.ts delete mode 100644 dist/page-object/material/index.js delete mode 100644 dist/page-object/material/muiinput.d.ts delete mode 100644 dist/page-object/material/muiinput.js delete mode 100644 dist/page-object/material/muiradio.d.ts delete mode 100644 dist/page-object/material/muiradio.js delete mode 100644 dist/page-object/moonstone/accordion.d.ts delete mode 100644 dist/page-object/moonstone/accordion.js delete mode 100644 dist/page-object/moonstone/button.d.ts delete mode 100644 dist/page-object/moonstone/button.js delete mode 100644 dist/page-object/moonstone/collapsible.d.ts delete mode 100644 dist/page-object/moonstone/collapsible.js delete mode 100644 dist/page-object/moonstone/dropdown.d.ts delete mode 100644 dist/page-object/moonstone/dropdown.js delete mode 100644 dist/page-object/moonstone/index.d.ts delete mode 100644 dist/page-object/moonstone/index.js delete mode 100644 dist/page-object/moonstone/menu.d.ts delete mode 100644 dist/page-object/moonstone/menu.js delete mode 100644 dist/page-object/moonstone/pagination.d.ts delete mode 100644 dist/page-object/moonstone/pagination.js delete mode 100644 dist/page-object/moonstone/primaryNav.d.ts delete mode 100644 dist/page-object/moonstone/primaryNav.js delete mode 100644 dist/page-object/moonstone/secondaryNav.d.ts delete mode 100644 dist/page-object/moonstone/secondaryNav.js delete mode 100644 dist/page-object/moonstone/table.d.ts delete mode 100644 dist/page-object/moonstone/table.js delete mode 100644 dist/page-object/utils.d.ts delete mode 100644 dist/page-object/utils.js delete mode 100644 dist/plugins/env.d.ts delete mode 100644 dist/plugins/env.js delete mode 100644 dist/plugins/index.d.ts delete mode 100644 dist/plugins/index.js delete mode 100644 dist/plugins/registerPlugins.d.ts delete mode 100644 dist/plugins/registerPlugins.js delete mode 100644 dist/support/apollo/apollo.d.ts delete mode 100644 dist/support/apollo/apollo.js delete mode 100644 dist/support/apollo/apolloClient.d.ts delete mode 100644 dist/support/apollo/apolloClient.js delete mode 100644 dist/support/apollo/index.d.ts delete mode 100644 dist/support/apollo/index.js delete mode 100644 dist/support/apollo/links.d.ts delete mode 100644 dist/support/apollo/links.js delete mode 100644 dist/support/commands.d.ts delete mode 100644 dist/support/commands.js delete mode 100644 dist/support/fixture.d.ts delete mode 100644 dist/support/fixture.js delete mode 100644 dist/support/index.d.ts delete mode 100644 dist/support/index.js delete mode 100644 dist/support/login.d.ts delete mode 100644 dist/support/login.js delete mode 100644 dist/support/logout.d.ts delete mode 100644 dist/support/logout.js delete mode 100644 dist/support/provisioning/executeGroovy.d.ts delete mode 100644 dist/support/provisioning/executeGroovy.js delete mode 100644 dist/support/provisioning/index.d.ts delete mode 100644 dist/support/provisioning/index.js delete mode 100644 dist/support/provisioning/installBundle.d.ts delete mode 100644 dist/support/provisioning/installBundle.js delete mode 100644 dist/support/provisioning/runProvisioningScript.d.ts delete mode 100644 dist/support/provisioning/runProvisioningScript.js delete mode 100644 dist/support/provisioning/uninstallBundle.d.ts delete mode 100644 dist/support/provisioning/uninstallBundle.js delete mode 100644 dist/support/registerSupport.d.ts delete mode 100644 dist/support/registerSupport.js delete mode 100644 dist/support/repeatUntil.d.ts delete mode 100644 dist/support/repeatUntil.js delete mode 100644 dist/utils/ClusterHelper.d.ts delete mode 100644 dist/utils/ClusterHelper.js delete mode 100644 dist/utils/GraphQLHelper.d.ts delete mode 100644 dist/utils/GraphQLHelper.js delete mode 100644 dist/utils/JCRHelper.d.ts delete mode 100644 dist/utils/JCRHelper.js delete mode 100644 dist/utils/JahiaPlatformHelper.d.ts delete mode 100644 dist/utils/JahiaPlatformHelper.js delete mode 100644 dist/utils/PublicationAndWorkflowHelper.d.ts delete mode 100644 dist/utils/PublicationAndWorkflowHelper.js delete mode 100644 dist/utils/SAMHelper.d.ts delete mode 100644 dist/utils/SAMHelper.js delete mode 100644 dist/utils/SiteHelper.d.ts delete mode 100644 dist/utils/SiteHelper.js delete mode 100644 dist/utils/UsersHelper.d.ts delete mode 100644 dist/utils/UsersHelper.js delete mode 100644 dist/utils/VanityUrlHelper.d.ts delete mode 100644 dist/utils/VanityUrlHelper.js delete mode 100644 dist/utils/index.d.ts delete mode 100644 dist/utils/index.js diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index ff6418e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './page-object'; -export * from './plugins'; -export * from './support'; -export * from './utils'; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d1f4016..0000000 --- a/dist/index.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./page-object"), exports); -__exportStar(require("./plugins"), exports); -__exportStar(require("./support"), exports); -__exportStar(require("./utils"), exports); diff --git a/dist/page-object/baseComponent.d.ts b/dist/page-object/baseComponent.d.ts deleted file mode 100644 index c165ba3..0000000 --- a/dist/page-object/baseComponent.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// -import Chainable = Cypress.Chainable; -import Chainer = Cypress.Chainer; -export declare type ComponentType = { - new (p: Chainable, assertion?: (s: JQuery) => void): Component; - defaultSelector: string; -}; -export declare class BaseComponent { - static defaultSelector: string; - static count: number; - element: Chainable; - id: number; - assertion?: (s: JQuery) => void; - constructor(element: Chainable, assertion?: (s: JQuery) => void); - get(): Chainable; - should: Chainer; -} diff --git a/dist/page-object/baseComponent.js b/dist/page-object/baseComponent.js deleted file mode 100644 index 05045af..0000000 --- a/dist/page-object/baseComponent.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -var __spreadArray = (this && this.__spreadArray) || function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; -}; -exports.__esModule = true; -exports.BaseComponent = void 0; -var BaseComponent = /** @class */ (function () { - function BaseComponent(element, assertion) { - var _this = this; - this.should = function (arg) { - var _a; - var others = []; - for (var _i = 1; _i < arguments.length; _i++) { - others[_i - 1] = arguments[_i]; - } - return (_a = cy.get('@component' + _this.id, { log: false })).should.apply(_a, __spreadArray([arg], others)); - }; - this.id = BaseComponent.count++; - this.element = element.as('component' + this.id); - this.assertion = assertion; - } - BaseComponent.prototype.get = function () { - if (this.assertion) { - return cy.get('@component' + this.id, { log: false }).should(this.assertion); - } - return cy.get('@component' + this.id, { log: false }); - }; - BaseComponent.defaultSelector = ''; - BaseComponent.count = 0; - return BaseComponent; -}()); -exports.BaseComponent = BaseComponent; diff --git a/dist/page-object/basePage.d.ts b/dist/page-object/basePage.d.ts deleted file mode 100644 index 008a88b..0000000 --- a/dist/page-object/basePage.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class BasePage { -} diff --git a/dist/page-object/basePage.js b/dist/page-object/basePage.js deleted file mode 100644 index 9e65e5e..0000000 --- a/dist/page-object/basePage.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.BasePage = void 0; -var BasePage = /** @class */ (function () { - function BasePage() { - } - return BasePage; -}()); -exports.BasePage = BasePage; diff --git a/dist/page-object/html/iframe.d.ts b/dist/page-object/html/iframe.d.ts deleted file mode 100644 index c828727..0000000 --- a/dist/page-object/html/iframe.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// -import { BaseComponent } from '../baseComponent'; -import Chainable = Cypress.Chainable; -export declare class IFrame extends BaseComponent { - static defaultSelector: string; - private body; - constructor(element: Chainable, assertion?: (s: JQuery) => void); - getBody(): Chainable; - enter(): void; -} diff --git a/dist/page-object/html/iframe.js b/dist/page-object/html/iframe.js deleted file mode 100644 index 9111130..0000000 --- a/dist/page-object/html/iframe.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -exports.IFrame = void 0; -var baseComponent_1 = require("../baseComponent"); -var IFrame = /** @class */ (function (_super) { - __extends(IFrame, _super); - function IFrame(element, assertion) { - var _this = _super.call(this, element, assertion) || this; - _this.get() - .should(function (f) { - var fr = f[0]; - expect(fr.contentWindow.location.href).not.equals('about:blank'); - expect(fr.contentWindow.document.readyState).equals('complete'); - // eslint-disable-next-line no-unused-expressions - expect(fr.contentDocument.body).not.be.empty; - }) - .its('0.contentDocument.body').as('framebody' + _this.id); - return _this; - } - IFrame.prototype.getBody = function () { - return cy.get('@framebody' + this.id); - }; - IFrame.prototype.enter = function () { - this.get().then(function (f) { - var fr = f[0]; - cy.visit(fr.contentWindow.location.href); - }); - }; - IFrame.defaultSelector = 'iframe'; - return IFrame; -}(baseComponent_1.BaseComponent)); -exports.IFrame = IFrame; diff --git a/dist/page-object/html/index.d.ts b/dist/page-object/html/index.d.ts deleted file mode 100644 index fc66659..0000000 --- a/dist/page-object/html/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './iframe'; diff --git a/dist/page-object/html/index.js b/dist/page-object/html/index.js deleted file mode 100644 index 64680ce..0000000 --- a/dist/page-object/html/index.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./iframe"), exports); diff --git a/dist/page-object/index.d.ts b/dist/page-object/index.d.ts deleted file mode 100644 index c8d9872..0000000 --- a/dist/page-object/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './baseComponent'; -export * from './basePage'; -export * from './html'; -export * from './material'; -export * from './moonstone'; -export * from './utils'; diff --git a/dist/page-object/index.js b/dist/page-object/index.js deleted file mode 100644 index 955753d..0000000 --- a/dist/page-object/index.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./baseComponent"), exports); -__exportStar(require("./basePage"), exports); -__exportStar(require("./html"), exports); -__exportStar(require("./material"), exports); -__exportStar(require("./moonstone"), exports); -__exportStar(require("./utils"), exports); diff --git a/dist/page-object/material/index.d.ts b/dist/page-object/material/index.d.ts deleted file mode 100644 index a2ea4cb..0000000 --- a/dist/page-object/material/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './muiinput'; -export * from './muiradio'; diff --git a/dist/page-object/material/index.js b/dist/page-object/material/index.js deleted file mode 100644 index c85f176..0000000 --- a/dist/page-object/material/index.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./muiinput"), exports); -__exportStar(require("./muiradio"), exports); diff --git a/dist/page-object/material/muiinput.d.ts b/dist/page-object/material/muiinput.d.ts deleted file mode 100644 index 9493995..0000000 --- a/dist/page-object/material/muiinput.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// -import { BaseComponent } from '../baseComponent'; -import TypeOptions = Cypress.TypeOptions; -export declare class MUIInput extends BaseComponent { - static defaultSelector: string; - clear(): MUIInput; - type(text: string, options?: Partial): MUIInput; -} diff --git a/dist/page-object/material/muiinput.js b/dist/page-object/material/muiinput.js deleted file mode 100644 index d997a5f..0000000 --- a/dist/page-object/material/muiinput.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -exports.MUIInput = void 0; -var baseComponent_1 = require("../baseComponent"); -var MUIInput = /** @class */ (function (_super) { - __extends(MUIInput, _super); - function MUIInput() { - return _super !== null && _super.apply(this, arguments) || this; - } - MUIInput.prototype.clear = function () { - this.get().clear(); - return this; - }; - MUIInput.prototype.type = function (text, options) { - this.get().type(text, options); - return this; - }; - MUIInput.defaultSelector = 'div'; - return MUIInput; -}(baseComponent_1.BaseComponent)); -exports.MUIInput = MUIInput; diff --git a/dist/page-object/material/muiradio.d.ts b/dist/page-object/material/muiradio.d.ts deleted file mode 100644 index e69aa3d..0000000 --- a/dist/page-object/material/muiradio.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { BaseComponent } from '../baseComponent'; -export declare class MUIRadio extends BaseComponent { - static defaultSelector: string; - click(): MUIRadio; -} diff --git a/dist/page-object/material/muiradio.js b/dist/page-object/material/muiradio.js deleted file mode 100644 index 547ebc0..0000000 --- a/dist/page-object/material/muiradio.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -exports.MUIRadio = void 0; -var baseComponent_1 = require("../baseComponent"); -var MUIRadio = /** @class */ (function (_super) { - __extends(MUIRadio, _super); - function MUIRadio() { - return _super !== null && _super.apply(this, arguments) || this; - } - MUIRadio.prototype.click = function () { - this.get().click(); - return this; - }; - MUIRadio.defaultSelector = 'label'; - return MUIRadio; -}(baseComponent_1.BaseComponent)); -exports.MUIRadio = MUIRadio; diff --git a/dist/page-object/moonstone/accordion.d.ts b/dist/page-object/moonstone/accordion.d.ts deleted file mode 100644 index ed6424f..0000000 --- a/dist/page-object/moonstone/accordion.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// -import { BaseComponent } from '../baseComponent'; -import Chainable = Cypress.Chainable; -export declare class Accordion extends BaseComponent { - static defaultSelector: string; - click(itemName: string): Accordion; - listItems(): Chainable; - getContent(): Chainable; -} diff --git a/dist/page-object/moonstone/accordion.js b/dist/page-object/moonstone/accordion.js deleted file mode 100644 index fd1bfb9..0000000 --- a/dist/page-object/moonstone/accordion.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -exports.Accordion = void 0; -var baseComponent_1 = require("../baseComponent"); -var Accordion = /** @class */ (function (_super) { - __extends(Accordion, _super); - function Accordion() { - return _super !== null && _super.apply(this, arguments) || this; - } - Accordion.prototype.click = function (itemName) { - this.get().find("section.moonstone-accordionItem header[aria-controls=\"" + itemName + "\"]").click(); - return this; - }; - Accordion.prototype.listItems = function () { - return this.get().find('section.moonstone-accordionItem header').then(function (items) { - return Array.prototype.slice.call(items, 0).map(function (i) { return i.attributes['aria-controls'] ? i.attributes['aria-controls'].value : null; }).filter(function (i) { return i !== null; }); - }); - }; - Accordion.prototype.getContent = function () { - return this.get().find('section.moonstone-accordionItem .moonstone-accordionItem_content'); - }; - Accordion.defaultSelector = '.moonstone-accordion'; - return Accordion; -}(baseComponent_1.BaseComponent)); -exports.Accordion = Accordion; diff --git a/dist/page-object/moonstone/button.d.ts b/dist/page-object/moonstone/button.d.ts deleted file mode 100644 index 944c9e5..0000000 --- a/dist/page-object/moonstone/button.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { BaseComponent } from '../baseComponent'; -export declare class Button extends BaseComponent { - static defaultSelector: string; - click(): Button; -} diff --git a/dist/page-object/moonstone/button.js b/dist/page-object/moonstone/button.js deleted file mode 100644 index 612c818..0000000 --- a/dist/page-object/moonstone/button.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -exports.Button = void 0; -var baseComponent_1 = require("../baseComponent"); -var Button = /** @class */ (function (_super) { - __extends(Button, _super); - function Button() { - return _super !== null && _super.apply(this, arguments) || this; - } - Button.prototype.click = function () { - this.get().click(); - return this; - }; - Button.defaultSelector = '.moonstone-button'; - return Button; -}(baseComponent_1.BaseComponent)); -exports.Button = Button; diff --git a/dist/page-object/moonstone/collapsible.d.ts b/dist/page-object/moonstone/collapsible.d.ts deleted file mode 100644 index f7aa853..0000000 --- a/dist/page-object/moonstone/collapsible.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { BaseComponent } from '../baseComponent'; -export declare class Collapsible extends BaseComponent { - static defaultSelector: string; - collapse(): Collapsible; - expand(): Collapsible; - shouldBeCollapsed(): void; - shouldBeExpanded(): void; -} diff --git a/dist/page-object/moonstone/collapsible.js b/dist/page-object/moonstone/collapsible.js deleted file mode 100644 index 20c7deb..0000000 --- a/dist/page-object/moonstone/collapsible.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -exports.Collapsible = void 0; -var baseComponent_1 = require("../baseComponent"); -var Collapsible = /** @class */ (function (_super) { - __extends(Collapsible, _super); - function Collapsible() { - return _super !== null && _super.apply(this, arguments) || this; - } - Collapsible.prototype.collapse = function () { - var _this = this; - this.get().children('div').then(function ($child) { - if ($child.hasClass('moonstone-collapsible_content_expanded')) { - _this.get().find('.moonstone-collapsible_button').click(); - } - }); - return this; - }; - Collapsible.prototype.expand = function () { - var _this = this; - this.get().children('div').then(function ($child) { - if ($child.hasClass('moonstone-collapsible_content_collapsed')) { - _this.get().find('.moonstone-collapsible_button').click().scrollIntoView(); - } - }); - return this; - }; - Collapsible.prototype.shouldBeCollapsed = function () { - this.get().find('.moonstone-collapsible_content_collapsed').should('exist'); - }; - Collapsible.prototype.shouldBeExpanded = function () { - this.get().find('.moonstone-collapsible_content_expanded').should('exist'); - }; - Collapsible.defaultSelector = '.moonstone-collapsible'; - return Collapsible; -}(baseComponent_1.BaseComponent)); -exports.Collapsible = Collapsible; diff --git a/dist/page-object/moonstone/dropdown.d.ts b/dist/page-object/moonstone/dropdown.d.ts deleted file mode 100644 index c7525ca..0000000 --- a/dist/page-object/moonstone/dropdown.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { BaseComponent } from '../baseComponent'; -export declare class Dropdown extends BaseComponent { - static defaultSelector: string; - select(item: string): Dropdown; -} diff --git a/dist/page-object/moonstone/dropdown.js b/dist/page-object/moonstone/dropdown.js deleted file mode 100644 index da390b7..0000000 --- a/dist/page-object/moonstone/dropdown.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -exports.Dropdown = void 0; -var baseComponent_1 = require("../baseComponent"); -var menu_1 = require("./menu"); -var utils_1 = require("../utils"); -var Dropdown = /** @class */ (function (_super) { - __extends(Dropdown, _super); - function Dropdown() { - return _super !== null && _super.apply(this, arguments) || this; - } - Dropdown.prototype.select = function (item) { - this.get().click(); - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(500); - utils_1.getComponent(menu_1.Menu, this).select(item); - return this; - }; - Dropdown.defaultSelector = '.moonstone-dropdown_container'; - return Dropdown; -}(baseComponent_1.BaseComponent)); -exports.Dropdown = Dropdown; diff --git a/dist/page-object/moonstone/index.d.ts b/dist/page-object/moonstone/index.d.ts deleted file mode 100644 index 7292b30..0000000 --- a/dist/page-object/moonstone/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from './accordion'; -export * from './button'; -export * from './collapsible'; -export * from './dropdown'; -export * from './menu'; -export * from './pagination'; -export * from './primaryNav'; -export * from './secondaryNav'; -export * from './table'; diff --git a/dist/page-object/moonstone/index.js b/dist/page-object/moonstone/index.js deleted file mode 100644 index e4ba106..0000000 --- a/dist/page-object/moonstone/index.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./accordion"), exports); -__exportStar(require("./button"), exports); -__exportStar(require("./collapsible"), exports); -__exportStar(require("./dropdown"), exports); -__exportStar(require("./menu"), exports); -__exportStar(require("./pagination"), exports); -__exportStar(require("./primaryNav"), exports); -__exportStar(require("./secondaryNav"), exports); -__exportStar(require("./table"), exports); diff --git a/dist/page-object/moonstone/menu.d.ts b/dist/page-object/moonstone/menu.d.ts deleted file mode 100644 index 223c381..0000000 --- a/dist/page-object/moonstone/menu.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { BaseComponent } from '../baseComponent'; -export declare class Menu extends BaseComponent { - static defaultSelector: string; - submenu(item: string, menu: string): Menu; - shouldHaveItem(item: string): void; - shouldNotHaveItem(item: string): void; - select(item: string): Menu; - selectByRole(item: string): Menu; -} diff --git a/dist/page-object/moonstone/menu.js b/dist/page-object/moonstone/menu.js deleted file mode 100644 index de8bcfc..0000000 --- a/dist/page-object/moonstone/menu.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -exports.Menu = void 0; -var baseComponent_1 = require("../baseComponent"); -var utils_1 = require("../utils"); -var Menu = /** @class */ (function (_super) { - __extends(Menu, _super); - function Menu() { - return _super !== null && _super.apply(this, arguments) || this; - } - Menu.prototype.submenu = function (item, menu) { - this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible'); - this.get().find('.moonstone-menuItem').contains(item).realHover(); - return utils_1.getComponentByRole(Menu, menu); - }; - Menu.prototype.shouldHaveItem = function (item) { - this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible'); - }; - Menu.prototype.shouldNotHaveItem = function (item) { - this.get().find('.moonstone-menuItem').contains(item).should('not.exist'); - }; - Menu.prototype.select = function (item) { - this.get().find('.moonstone-menuItem').contains(item).scrollIntoView().should('be.visible'); - this.get().find('.moonstone-menuItem').contains(item).trigger('click'); - return this; - }; - Menu.prototype.selectByRole = function (item) { - this.get().find(".moonstone-menuItem[data-sel-role=\"" + item + "\"]").scrollIntoView().should('be.visible'); - this.get().find(".moonstone-menuItem[data-sel-role=\"" + item + "\"]").trigger('click'); - return this; - }; - Menu.defaultSelector = '.moonstone-menu:not(.moonstone-hidden)'; - return Menu; -}(baseComponent_1.BaseComponent)); -exports.Menu = Menu; diff --git a/dist/page-object/moonstone/pagination.d.ts b/dist/page-object/moonstone/pagination.d.ts deleted file mode 100644 index 6a695e8..0000000 --- a/dist/page-object/moonstone/pagination.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { BaseComponent } from '../baseComponent'; -import Chainable = Cypress.Chainable; -export declare class Pagination extends BaseComponent { - static defaultSelector: string; - clickNextPage(): Pagination; - clickPreviousPage(): Pagination; - getTotalRows(): Chainable; -} diff --git a/dist/page-object/moonstone/pagination.js b/dist/page-object/moonstone/pagination.js deleted file mode 100644 index dddd9d3..0000000 --- a/dist/page-object/moonstone/pagination.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -exports.Pagination = void 0; -var baseComponent_1 = require("../baseComponent"); -var button_1 = require("./button"); -var utils_1 = require("../utils"); -var Pagination = /** @class */ (function (_super) { - __extends(Pagination, _super); - function Pagination() { - return _super !== null && _super.apply(this, arguments) || this; - } - Pagination.prototype.clickNextPage = function () { - utils_1.getComponentByRole(button_1.Button, 'table-pagination-button-next-page', this).click(); - return this; - }; - Pagination.prototype.clickPreviousPage = function () { - utils_1.getComponentByRole(button_1.Button, 'table-pagination-button-previous-page', this).click(); - return this; - }; - Pagination.prototype.getTotalRows = function () { - // eslint-disable-next-line radix - return this.get().contains('of').then(function (el) { return Number.parseInt(el.text().substr(el.text().indexOf('of') + 3)); }); - }; - Pagination.defaultSelector = '.moonstone-tablePagination'; - return Pagination; -}(baseComponent_1.BaseComponent)); -exports.Pagination = Pagination; diff --git a/dist/page-object/moonstone/primaryNav.d.ts b/dist/page-object/moonstone/primaryNav.d.ts deleted file mode 100644 index 0e22651..0000000 --- a/dist/page-object/moonstone/primaryNav.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { BaseComponent } from '../baseComponent'; -import Chainable = Cypress.Chainable; -export declare class PrimaryNav extends BaseComponent { - static defaultSelector: string; - click(itemName: string): void; - listItems(): Chainable; -} diff --git a/dist/page-object/moonstone/primaryNav.js b/dist/page-object/moonstone/primaryNav.js deleted file mode 100644 index 4f1d19e..0000000 --- a/dist/page-object/moonstone/primaryNav.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -exports.PrimaryNav = void 0; -var baseComponent_1 = require("../baseComponent"); -var PrimaryNav = /** @class */ (function (_super) { - __extends(PrimaryNav, _super); - function PrimaryNav() { - return _super !== null && _super.apply(this, arguments) || this; - } - PrimaryNav.prototype.click = function (itemName) { - this.get().find(".moonstone-primaryNavItem[role=\"" + itemName + "\"]").click(); - }; - PrimaryNav.prototype.listItems = function () { - return this.get().find('.moonstone-primaryNavItem').then(function (items) { - return Array.prototype.slice.call(items, 0).map(function (i) { return i.attributes.role ? i.attributes.role.value : null; }).filter(function (i) { return i !== null; }); - }); - }; - PrimaryNav.defaultSelector = '.moonstone-primaryNav'; - return PrimaryNav; -}(baseComponent_1.BaseComponent)); -exports.PrimaryNav = PrimaryNav; diff --git a/dist/page-object/moonstone/secondaryNav.d.ts b/dist/page-object/moonstone/secondaryNav.d.ts deleted file mode 100644 index 7df68e1..0000000 --- a/dist/page-object/moonstone/secondaryNav.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { BaseComponent } from '../baseComponent'; -export declare class SecondaryNav extends BaseComponent { - static defaultSelector: string; -} diff --git a/dist/page-object/moonstone/secondaryNav.js b/dist/page-object/moonstone/secondaryNav.js deleted file mode 100644 index 7246c5b..0000000 --- a/dist/page-object/moonstone/secondaryNav.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -exports.SecondaryNav = void 0; -var baseComponent_1 = require("../baseComponent"); -var SecondaryNav = /** @class */ (function (_super) { - __extends(SecondaryNav, _super); - function SecondaryNav() { - return _super !== null && _super.apply(this, arguments) || this; - } - SecondaryNav.defaultSelector = '.moonstone-secondaryNav_wrapper'; - return SecondaryNav; -}(baseComponent_1.BaseComponent)); -exports.SecondaryNav = SecondaryNav; diff --git a/dist/page-object/moonstone/table.d.ts b/dist/page-object/moonstone/table.d.ts deleted file mode 100644 index dde8f98..0000000 --- a/dist/page-object/moonstone/table.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// -import { BaseComponent } from '../baseComponent'; -import { Menu } from './menu'; -export declare class Table extends BaseComponent { - static defaultSelector: string; - getRows(assertion?: (s: JQuery) => void): TableRow; - getRowByIndex(i: number, assertion?: (s: JQuery) => void): TableRow; - getRowByContent(content: string, assertion?: (s: JQuery) => void): TableRow; -} -export declare class TableRow extends BaseComponent { - static defaultSelector: string; - contextMenu(): Menu; -} diff --git a/dist/page-object/moonstone/table.js b/dist/page-object/moonstone/table.js deleted file mode 100644 index 1508b3c..0000000 --- a/dist/page-object/moonstone/table.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -exports.__esModule = true; -exports.TableRow = exports.Table = void 0; -var baseComponent_1 = require("../baseComponent"); -var menu_1 = require("./menu"); -var utils_1 = require("../utils"); -var Table = /** @class */ (function (_super) { - __extends(Table, _super); - function Table() { - return _super !== null && _super.apply(this, arguments) || this; - } - Table.prototype.getRows = function (assertion) { - return utils_1.getComponent(TableRow, this, assertion); - }; - Table.prototype.getRowByIndex = function (i, assertion) { - return utils_1.getComponentByIndex(TableRow, i, this, assertion); - }; - Table.prototype.getRowByContent = function (content, assertion) { - return utils_1.getComponentByContent(TableRow, content, this, assertion); - }; - Table.defaultSelector = '.moonstone-Table'; - return Table; -}(baseComponent_1.BaseComponent)); -exports.Table = Table; -var TableRow = /** @class */ (function (_super) { - __extends(TableRow, _super); - function TableRow() { - return _super !== null && _super.apply(this, arguments) || this; - } - TableRow.prototype.contextMenu = function () { - this.get().rightclick(); - return utils_1.getComponentBySelector(menu_1.Menu, '#menuHolder .moonstone-menu:not(.moonstone-hidden)'); - }; - TableRow.defaultSelector = '.moonstone-TableBody .moonstone-TableRow'; - return TableRow; -}(baseComponent_1.BaseComponent)); -exports.TableRow = TableRow; diff --git a/dist/page-object/utils.d.ts b/dist/page-object/utils.d.ts deleted file mode 100644 index c1fb194..0000000 --- a/dist/page-object/utils.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// -import { Table } from './moonstone'; -import { BaseComponent, ComponentType } from './baseComponent'; -import Chainable = Cypress.Chainable; -export declare function getElement(selector: string, parent?: BaseComponent, assertion?: (s: JQuery) => void): Chainable; -export declare function getComponentBySelector(C: ComponentType, selector: string, parent?: BaseComponent, assertion?: (s: JQuery) => void): Component; -export declare function getComponent(C: ComponentType, parent?: BaseComponent, assertion?: (s: JQuery) => void): Component; -export declare function getComponentByIndex(C: ComponentType, i: number, parent: Table, assertion?: (s: JQuery) => void): Component; -export declare function getComponentByRole(C: ComponentType, role: string, parent?: BaseComponent, assertion?: (s: JQuery) => void): Component; -export declare function getComponentByAttr(C: ComponentType, attr: string, value: string, parent?: BaseComponent, assertion?: (s: JQuery) => void): Component; -export declare function getComponentByContent(C: ComponentType, content: string, parent?: BaseComponent, assertion?: (s: JQuery) => void): Component; diff --git a/dist/page-object/utils.js b/dist/page-object/utils.js deleted file mode 100644 index 92192ec..0000000 --- a/dist/page-object/utils.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.getComponentByContent = exports.getComponentByAttr = exports.getComponentByRole = exports.getComponentByIndex = exports.getComponent = exports.getComponentBySelector = exports.getElement = void 0; -function getElement(selector, parent, assertion) { - var chainable = parent ? parent.get().find(selector) : cy.get(selector); - if (assertion) { - return chainable.should(assertion); - } - return chainable; -} -exports.getElement = getElement; -function getComponentBySelector(C, selector, parent, assertion) { - return new C(getElement(selector, parent, assertion), assertion); -} -exports.getComponentBySelector = getComponentBySelector; -function getComponent(C, parent, assertion) { - return getComponentBySelector(C, C.defaultSelector, parent, assertion); -} -exports.getComponent = getComponent; -function getComponentByIndex(C, i, parent, assertion) { - return getComponentBySelector(C, C.defaultSelector + ":nth-child(" + i + ")", parent, assertion); -} -exports.getComponentByIndex = getComponentByIndex; -function getComponentByRole(C, role, parent, assertion) { - return getComponentBySelector(C, C.defaultSelector + "[data-sel-role=\"" + role + "\"]", parent, assertion); -} -exports.getComponentByRole = getComponentByRole; -// eslint-disable-next-line max-params -function getComponentByAttr(C, attr, value, parent, assertion) { - return getComponentBySelector(C, C.defaultSelector + "[" + attr + "=\"" + value + "\"]", parent, assertion); -} -exports.getComponentByAttr = getComponentByAttr; -function getComponentByContent(C, content, parent, assertion) { - var chainable = getElement(C.defaultSelector, parent).should('contains', content).contains(content); - if (assertion) { - chainable = chainable.should(assertion); - } - return new C(chainable, assertion); -} -exports.getComponentByContent = getComponentByContent; diff --git a/dist/plugins/env.d.ts b/dist/plugins/env.d.ts deleted file mode 100644 index ddfed8c..0000000 --- a/dist/plugins/env.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const env: (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => Cypress.PluginConfigOptions; -export default env; diff --git a/dist/plugins/env.js b/dist/plugins/env.js deleted file mode 100644 index 52cd984..0000000 --- a/dist/plugins/env.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -exports.__esModule = true; -var env = function (on, config) { - if (!process.env.JAHIA_URL && !process.env.SUPER_USER_PASSWORD) { - console.warn('No environment set, will use default values'); - config.baseUrl = 'http://localhost:8080'; - config.env.JAHIA_URL = 'http://localhost:8080'; - config.env.SUPER_USER_PASSWORD = 'root1234'; - } - else { - console.log('Setting environment'); - config.baseUrl = process.env.JAHIA_URL; - config.env.JAHIA_URL = process.env.JAHIA_URL; - config.env.SUPER_USER_PASSWORD = process.env.SUPER_USER_PASSWORD; - } - console.log('JAHIA_URL =', config.env.JAHIA_URL); - console.log('SUPER_USER_PASSWORD =', config.env.SUPER_USER_PASSWORD); - return config; -}; -exports["default"] = env; diff --git a/dist/plugins/index.d.ts b/dist/plugins/index.d.ts deleted file mode 100644 index c1532d6..0000000 --- a/dist/plugins/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './env'; diff --git a/dist/plugins/index.js b/dist/plugins/index.js deleted file mode 100644 index bfb3553..0000000 --- a/dist/plugins/index.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./env"), exports); diff --git a/dist/plugins/registerPlugins.d.ts b/dist/plugins/registerPlugins.d.ts deleted file mode 100644 index ac1de77..0000000 --- a/dist/plugins/registerPlugins.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const registerPlugins: (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => void; diff --git a/dist/plugins/registerPlugins.js b/dist/plugins/registerPlugins.js deleted file mode 100644 index c07ed16..0000000 --- a/dist/plugins/registerPlugins.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -exports.__esModule = true; -exports.registerPlugins = void 0; -var env_1 = __importDefault(require("./env")); -var registerPlugins = function (on, config) { - env_1["default"](on, config); -}; -exports.registerPlugins = registerPlugins; diff --git a/dist/support/apollo/apollo.d.ts b/dist/support/apollo/apollo.d.ts deleted file mode 100644 index 8a56b43..0000000 --- a/dist/support/apollo/apollo.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// -import { ApolloClient, ApolloQueryResult, FetchResult, MutationOptions, QueryOptions } from '@apollo/client/core'; -declare global { - namespace Cypress { - interface Chainable { - apollo(options: ApolloOptions): Chainable | FetchResult>; - } - } -} -export declare type FileQueryOptions = Partial & { - queryFile?: string; -}; -export declare type FileMutationOptions = Partial & { - mutationFile?: string; -}; -export declare type ApolloOptions = (QueryOptions | MutationOptions | FileQueryOptions | FileMutationOptions) & Partial; -export declare const apollo: (apollo: ApolloClient, options: ApolloOptions) => void; diff --git a/dist/support/apollo/apollo.js b/dist/support/apollo/apollo.js deleted file mode 100644 index 4ee44d5..0000000 --- a/dist/support/apollo/apollo.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */ -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -exports.__esModule = true; -exports.apollo = void 0; -var graphql_tag_1 = __importDefault(require("graphql-tag")); -function isQuery(options) { - return options.query !== undefined; -} -function isQueryFile(options) { - return options.queryFile !== undefined; -} -function isMutationFile(options) { - return options.mutationFile !== undefined; -} -// eslint-disable-next-line default-param-last, @typescript-eslint/no-shadow -var apollo = function (apollo, options) { - if (apollo === void 0) { apollo = this.currentApolloClient; } - var result; - var logger; - var optionsWithDefaultCache = __assign({ fetchPolicy: 'no-cache' }, options); - if (!apollo) { - cy.apolloClient().apollo(optionsWithDefaultCache); - } - else if (isQueryFile(optionsWithDefaultCache)) { - var queryFile = optionsWithDefaultCache.queryFile, apolloOptions_1 = __rest(optionsWithDefaultCache, ["queryFile"]); - cy.fixture(queryFile).then(function (content) { - cy.apollo(__assign({ query: graphql_tag_1["default"](content) }, apolloOptions_1)); - }); - } - else if (isMutationFile(optionsWithDefaultCache)) { - var mutationFile = optionsWithDefaultCache.mutationFile, apolloOptions_2 = __rest(optionsWithDefaultCache, ["mutationFile"]); - cy.fixture(mutationFile).then(function (content) { - cy.apollo(__assign({ mutation: graphql_tag_1["default"](content) }, apolloOptions_2)); - }); - } - else { - var _a = optionsWithDefaultCache.log, log = _a === void 0 ? true : _a, apolloOptions_3 = __rest(optionsWithDefaultCache, ["log"]); - if (log) { - logger = Cypress.log({ - autoEnd: false, - name: 'apollo', - displayName: 'apollo', - message: isQuery(apolloOptions_3) ? "Execute Graphql Query: " + apolloOptions_3.query.loc.source.body : "Execute Graphql Mutation: " + apolloOptions_3.mutation.loc.source.body, - consoleProps: function () { - return { - Options: apolloOptions_3, - Yielded: result - }; - } - }); - } - cy.wrap({}, { log: true }) - .then(function () { return (isQuery(optionsWithDefaultCache) ? apollo.query(optionsWithDefaultCache)["catch"](function (error) { - cy.log("Caught Graphql Query Error: " + JSON.stringify(error)); - return error; - }) : apollo.mutate(optionsWithDefaultCache)["catch"](function (error) { - cy.log("Caught Graphql Mutation Error: " + JSON.stringify(error)); - return error; - })) - .then(function (r) { - result = r; - logger === null || logger === void 0 ? void 0 : logger.end(); - return r; - }); }); - } -}; -exports.apollo = apollo; diff --git a/dist/support/apollo/apolloClient.d.ts b/dist/support/apollo/apolloClient.d.ts deleted file mode 100644 index 750e0ad..0000000 --- a/dist/support/apollo/apolloClient.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// -import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core'; -interface AuthMethod { - token?: string; - username?: string; - password?: string; - url?: string; -} -declare global { - namespace Cypress { - interface Chainable { - apolloClient(authMethod?: AuthMethod): Chainable>; - } - } -} -export declare type ApolloClientOptions = Cypress.Loggable & { - setCurrentApolloClient: boolean; -}; -export declare const apolloClient: (authMethod?: AuthMethod, options?: ApolloClientOptions) => void; -export {}; diff --git a/dist/support/apollo/apolloClient.js b/dist/support/apollo/apolloClient.js deleted file mode 100644 index f38da66..0000000 --- a/dist/support/apollo/apolloClient.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.apolloClient = void 0; -var core_1 = require("@apollo/client/core"); -var links_1 = require("./links"); -var apolloClient = function (authMethod, options) { - if (authMethod === void 0) { authMethod = { url: Cypress.config().baseUrl }; } - if (options === void 0) { options = { - log: true, - setCurrentApolloClient: true - }; } - var headers = {}; - if (authMethod.token !== undefined) { - headers.authorization = "APIToken " + authMethod.token; - } - else if (authMethod.username !== undefined && authMethod.password !== undefined) { - headers.authorization = "Basic " + btoa(authMethod.username + ':' + authMethod.password); - } - else { - headers.authorization = "Basic " + btoa('root:' + Cypress.env('SUPER_USER_PASSWORD')); - } - var links = [links_1.uploadLink, links_1.formDataHttpLink(authMethod.url, headers)]; - var client = new core_1.ApolloClient({ - link: core_1.from(links), - cache: new core_1.InMemoryCache(), - defaultOptions: { - query: { - fetchPolicy: 'no-cache' - } - } - }); - if (options.log) { - Cypress.log({ - name: 'apolloClient', - displayName: 'apClient', - message: 'Create new apollo client', - consoleProps: function () { - return { - Auth: authMethod, - Yielded: client - }; - } - }); - } - if (options.setCurrentApolloClient) { - cy.wrap(client, { log: false }).as('currentApolloClient'); - } - else { - cy.wrap(client, { log: false }); - } -}; -exports.apolloClient = apolloClient; diff --git a/dist/support/apollo/index.d.ts b/dist/support/apollo/index.d.ts deleted file mode 100644 index 3c55f57..0000000 --- a/dist/support/apollo/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './apolloClient'; -export * from './apollo'; diff --git a/dist/support/apollo/index.js b/dist/support/apollo/index.js deleted file mode 100644 index 5add37b..0000000 --- a/dist/support/apollo/index.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./apolloClient"), exports); -__exportStar(require("./apollo"), exports); diff --git a/dist/support/apollo/links.d.ts b/dist/support/apollo/links.d.ts deleted file mode 100644 index d619923..0000000 --- a/dist/support/apollo/links.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { HttpLink } from '@apollo/client/link/http'; -export declare const formDataHttpLink: (baseUrl: string, headers: unknown) => HttpLink; -export declare const uploadLink: import("@apollo/client/core").ApolloLink; diff --git a/dist/support/apollo/links.js b/dist/support/apollo/links.js deleted file mode 100644 index c694839..0000000 --- a/dist/support/apollo/links.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -exports.__esModule = true; -exports.uploadLink = exports.formDataHttpLink = void 0; -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -var http_1 = require("@apollo/client/link/http"); -var cross_fetch_1 = __importDefault(require("cross-fetch")); -var context_1 = require("@apollo/client/link/context"); -var formDataHttpLink = function (baseUrl, headers) { - return new http_1.HttpLink({ - uri: baseUrl + "/modules/graphql", - headers: headers, - fetch: function (uri, fetcherOptions) { - var options = __assign({}, fetcherOptions); - if (options.formData) { - var formData_1 = options.formData; - var body_1 = JSON.parse(options.body.toString()); - if (Array.isArray(body_1)) { - formData_1.append('query', options.body.toString()); - } - else { - Object.keys(body_1).forEach(function (k) { - return formData_1.append(k, typeof body_1[k] === 'string' ? body_1[k] : JSON.stringify(body_1[k])); - }); - } - fetcherOptions.body = formData_1; - delete fetcherOptions.headers['content-type']; - return cross_fetch_1["default"](uri, fetcherOptions); - } - return cross_fetch_1["default"](uri, fetcherOptions); - } - }); -}; -exports.formDataHttpLink = formDataHttpLink; -exports.uploadLink = context_1.setContext(function (operation, _a) { - var fetchOptions = _a.fetchOptions; - var variables = operation.variables; - var fileFound = false; - var formData = new FormData(); - var id = Math.random().toString(36); - // Search for File objects on the request and set it as formData - Object.keys(variables).forEach(function (k) { - var variable = variables[k]; - if (variable instanceof File) { - formData.append(id, variable); - variables[k] = id; - fileFound = true; - } - }); - if (fileFound) { - return { - fetchOptions: __assign(__assign({}, fetchOptions), { formData: formData }) - }; - } - return { - fetchOptions: __assign({}, fetchOptions) - }; -}); diff --git a/dist/support/commands.d.ts b/dist/support/commands.d.ts deleted file mode 100644 index cfd6202..0000000 --- a/dist/support/commands.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import 'cypress-wait-until'; -import 'cypress-real-events'; diff --git a/dist/support/commands.js b/dist/support/commands.js deleted file mode 100644 index c73a0aa..0000000 --- a/dist/support/commands.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; -exports.__esModule = true; -require("cypress-wait-until"); -require("cypress-real-events"); diff --git a/dist/support/fixture.d.ts b/dist/support/fixture.d.ts deleted file mode 100644 index 443d2c5..0000000 --- a/dist/support/fixture.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import Chainable = Cypress.Chainable; -export declare const fixture: (originalCommand: (...args: any[]) => any, fixtureParam: string, ...args: any[]) => Chainable; diff --git a/dist/support/fixture.js b/dist/support/fixture.js deleted file mode 100644 index 45231c3..0000000 --- a/dist/support/fixture.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -var __spreadArray = (this && this.__spreadArray) || function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; -}; -exports.__esModule = true; -exports.fixture = void 0; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -var fixture = function (originalCommand, fixtureParam) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - return cy.wrap({}, { log: false }).then(function () { - return originalCommand.apply(void 0, __spreadArray([fixtureParam], args)).then(function (f) { - return f; - })["catch"](function () { - return null; - }); - }).then(function (file) { - if (!file) { - var encoding = void 0; - if (typeof args[0] === 'string') { - encoding = args[0]; - } - try { - cy.readFile('./node_modules/@jahia/cypress/fixtures/' + fixtureParam, encoding, { log: false, timeout: 2000 }); - } - catch (e) { - console.log(e); - } - } - }); -}; -exports.fixture = fixture; diff --git a/dist/support/index.d.ts b/dist/support/index.d.ts deleted file mode 100644 index fa93ce0..0000000 --- a/dist/support/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './apollo'; -export * from './provisioning'; -export * from './login'; -export * from './logout'; -export * from './repeatUntil'; diff --git a/dist/support/index.js b/dist/support/index.js deleted file mode 100644 index ed4c7d7..0000000 --- a/dist/support/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./apollo"), exports); -__exportStar(require("./provisioning"), exports); -__exportStar(require("./login"), exports); -__exportStar(require("./logout"), exports); -__exportStar(require("./repeatUntil"), exports); diff --git a/dist/support/login.d.ts b/dist/support/login.d.ts deleted file mode 100644 index 491c235..0000000 --- a/dist/support/login.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// -declare global { - namespace Cypress { - interface Chainable { - login(username?: string, password?: string): Chainable>; - loginAndStoreSession(username?: string, password?: string): Chainable>; - } - } -} -export declare const login: (username?: string, password?: string) => void; -export declare const loginAndStoreSession: (username?: string, password?: string) => void; diff --git a/dist/support/login.js b/dist/support/login.js deleted file mode 100644 index 20984c4..0000000 --- a/dist/support/login.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */ -exports.__esModule = true; -exports.loginAndStoreSession = exports.login = void 0; -/// -var login = function (username, password) { - if (username === void 0) { username = 'root'; } - if (password === void 0) { password = Cypress.env('SUPER_USER_PASSWORD'); } - Cypress.log({ - name: 'login', - message: "Login with " + username, - consoleProps: function () { - return { - User: username - }; - } - }); - cy.request({ - method: 'POST', - url: '/cms/login', - form: true, - body: { username: username, password: password }, - followRedirect: false, - log: false - }).then(function (res) { - expect(res.status, 'Login result').to.eq(302); - }); -}; -exports.login = login; -var loginAndStoreSession = function (username, password) { - if (username === void 0) { username = 'root'; } - if (password === void 0) { password = Cypress.env('SUPER_USER_PASSWORD'); } - cy.session('session-' + username, function () { - cy.login(username, password); // Edit in chief - }, { - validate: function () { - cy.request('/start').its('status').should('eq', 200); - } - }); -}; -exports.loginAndStoreSession = loginAndStoreSession; diff --git a/dist/support/logout.d.ts b/dist/support/logout.d.ts deleted file mode 100644 index 3843a1c..0000000 --- a/dist/support/logout.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// -declare global { - namespace Cypress { - interface Chainable { - logout(): Chainable>; - } - } -} -export declare const logout: () => void; diff --git a/dist/support/logout.js b/dist/support/logout.js deleted file mode 100644 index 4888da5..0000000 --- a/dist/support/logout.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */ -exports.__esModule = true; -exports.logout = void 0; -/// -var logout = function () { - Cypress.log({ - name: 'logout', - message: 'Logout', - consoleProps: function () { - return {}; - } - }); - cy.request({ - method: 'POST', - url: '/cms/logout', - followRedirect: false, - log: false - }).then(function (res) { - expect(res.status, 'Logout result').to.eq(302); - }); -}; -exports.logout = logout; diff --git a/dist/support/provisioning/executeGroovy.d.ts b/dist/support/provisioning/executeGroovy.d.ts deleted file mode 100644 index 12df206..0000000 --- a/dist/support/provisioning/executeGroovy.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -declare global { - namespace Cypress { - interface Chainable { - executeGroovy(scriptFile: string, replacements?: { - [key: string]: string; - }, jahiaServer?: JahiaServer): Chainable; - } - } -} -declare type JahiaServer = { - url: string; - username: string; - password: string; -}; -export declare const executeGroovy: (scriptFile: string, replacements?: { - [key: string]: string; -}, jahiaServer?: JahiaServer) => void; -export {}; diff --git a/dist/support/provisioning/executeGroovy.js b/dist/support/provisioning/executeGroovy.js deleted file mode 100644 index 6ae8c47..0000000 --- a/dist/support/provisioning/executeGroovy.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */ -exports.__esModule = true; -exports.executeGroovy = void 0; -/// -var serverDefaults = { - url: Cypress.config().baseUrl, - username: 'root', - password: Cypress.env('SUPER_USER_PASSWORD') -}; -var executeGroovy = function (scriptFile, replacements, jahiaServer) { - if (jahiaServer === void 0) { jahiaServer = serverDefaults; } - cy.runProvisioningScript({ - fileContent: '- executeScript: "' + scriptFile + '"', - type: 'application/yaml' - }, [{ - fileName: scriptFile, - replacements: replacements, - type: 'text/plain' - }], jahiaServer).then(function (r) { return r[0]; }); -}; -exports.executeGroovy = executeGroovy; diff --git a/dist/support/provisioning/index.d.ts b/dist/support/provisioning/index.d.ts deleted file mode 100644 index 5e05309..0000000 --- a/dist/support/provisioning/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './executeGroovy'; -export * from './runProvisioningScript'; -export * from './installBundle'; -export * from './uninstallBundle'; diff --git a/dist/support/provisioning/index.js b/dist/support/provisioning/index.js deleted file mode 100644 index 47b341f..0000000 --- a/dist/support/provisioning/index.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./executeGroovy"), exports); -__exportStar(require("./runProvisioningScript"), exports); -__exportStar(require("./installBundle"), exports); -__exportStar(require("./uninstallBundle"), exports); diff --git a/dist/support/provisioning/installBundle.d.ts b/dist/support/provisioning/installBundle.d.ts deleted file mode 100644 index 0984465..0000000 --- a/dist/support/provisioning/installBundle.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// -declare global { - namespace Cypress { - interface Chainable { - installBundle(bundleFile: string): Chainable>; - } - } -} -export declare const installBundle: (bundleFile: string) => void; diff --git a/dist/support/provisioning/installBundle.js b/dist/support/provisioning/installBundle.js deleted file mode 100644 index a07236b..0000000 --- a/dist/support/provisioning/installBundle.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */ -exports.__esModule = true; -exports.installBundle = void 0; -/// -var installBundle = function (bundleFile) { - cy.runProvisioningScript([{ installBundle: bundleFile }], [{ - fileName: bundleFile, - type: 'text/plain' - }]); -}; -exports.installBundle = installBundle; diff --git a/dist/support/provisioning/runProvisioningScript.d.ts b/dist/support/provisioning/runProvisioningScript.d.ts deleted file mode 100644 index 73e83c3..0000000 --- a/dist/support/provisioning/runProvisioningScript.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/// -declare global { - namespace Cypress { - interface Chainable { - runProvisioningScript(script: FormFile | StringDictionary[], files?: FormFile[], jahiaServer?: JahiaServer): Chainable; - } - } -} -export declare type StringDictionary = { - [key: string]: string; -}; -export declare type FormFile = { - fileName?: string; - fileContent?: string; - type?: string; - encoding?: Cypress.Encodings; - replacements?: StringDictionary; -}; -export declare type JahiaServer = { - url: string; - username: string; - password: string; -}; -export declare const runProvisioningScript: (script: FormFile | StringDictionary[], files?: FormFile[], jahiaServer?: JahiaServer, options?: Cypress.Loggable, timeout?: number) => void; diff --git a/dist/support/provisioning/runProvisioningScript.js b/dist/support/provisioning/runProvisioningScript.js deleted file mode 100644 index 26f1234..0000000 --- a/dist/support/provisioning/runProvisioningScript.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.runProvisioningScript = void 0; -function processContent(formFile) { - var content = formFile.fileContent; - if (formFile.replacements) { - Object.keys(formFile.replacements).forEach(function (k) { - content = content.replaceAll(k, formFile.replacements[k]); - }); - } - formFile.fileContent = content; - return Cypress.Blob.binaryStringToBlob(content, formFile.type); -} -function append(formFile, formData, key) { - if (formFile.fileContent) { - formData.append(key, processContent(formFile), formFile.fileName); - } - else if (formFile.fileName) { - cy.fixture(formFile.fileName, (formFile.encoding ? formFile.encoding : 'binary')).then(function (content) { - if (typeof content === 'object') { - formFile.fileContent = JSON.stringify(content); - } - else { - formFile.fileContent = content; - } - formData.append(key, processContent(formFile), formFile.fileName); - }); - } -} -var serverDefaults = { - url: Cypress.config().baseUrl, - username: 'root', - password: Cypress.env('SUPER_USER_PASSWORD') -}; -function isFormFile(script) { - return Boolean(script.fileContent || script.fileName); -} -// eslint-disable-next-line default-param-last, max-params -var runProvisioningScript = function (script, files, jahiaServer, options, timeout) { - if (jahiaServer === void 0) { jahiaServer = serverDefaults; } - if (options === void 0) { options = { log: true }; } - var formData = new FormData(); - if (isFormFile(script)) { - append(script, formData, 'script'); - } - else { - append({ - fileContent: JSON.stringify(script), - type: 'application/json' - }, formData, 'script'); - } - if (files) { - files.forEach(function (f) { - append(f, formData, 'file'); - }); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var response; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var result; - var logger; - if (options.log) { - logger = Cypress.log({ - autoEnd: false, - name: 'runProvisioningScript', - displayName: 'provScript', - message: "Run " + (isFormFile(script) && script.fileName ? script.fileName : 'inline script') + " towards server: " + jahiaServer.url, - consoleProps: function () { - return { - Script: script, - Files: files, - Response: response, - Yielded: result - }; - } - }); - } - var request = { - url: jahiaServer.url + "/modules/api/provisioning", - method: 'POST', - auth: { - user: jahiaServer.username, - pass: jahiaServer.password, - sendImmediately: true - }, - body: formData, - log: false - }; - if (typeof timeout !== 'undefined') { - request.timeout = timeout; - } - cy.request(request).then(function (res) { - response = res; - expect(res.status, 'Script result').to.eq(200); - try { - var decoder = new TextDecoder(); - result = JSON.parse(decoder.decode(response.body)); - } - catch (e) { - result = e; - } - logger === null || logger === void 0 ? void 0 : logger.end(); - return result; - }); -}; -exports.runProvisioningScript = runProvisioningScript; diff --git a/dist/support/provisioning/uninstallBundle.d.ts b/dist/support/provisioning/uninstallBundle.d.ts deleted file mode 100644 index 8772315..0000000 --- a/dist/support/provisioning/uninstallBundle.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// -declare global { - namespace Cypress { - interface Chainable { - uninstallBundle(bundleSymbolicName: string): Chainable>; - } - } -} -export declare const uninstallBundle: (bundleSymbolicName: string) => void; diff --git a/dist/support/provisioning/uninstallBundle.js b/dist/support/provisioning/uninstallBundle.js deleted file mode 100644 index f64388c..0000000 --- a/dist/support/provisioning/uninstallBundle.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */ -exports.__esModule = true; -exports.uninstallBundle = void 0; -/// -var uninstallBundle = function (bundleSymbolicName) { - cy.runProvisioningScript({ - fileContent: '- uninstallBundle: "' + bundleSymbolicName + '"\n', - type: 'application/yaml' - }); -}; -exports.uninstallBundle = uninstallBundle; diff --git a/dist/support/registerSupport.d.ts b/dist/support/registerSupport.d.ts deleted file mode 100644 index 1e8f90a..0000000 --- a/dist/support/registerSupport.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const registerSupport: () => void; diff --git a/dist/support/registerSupport.js b/dist/support/registerSupport.js deleted file mode 100644 index b6b2918..0000000 --- a/dist/support/registerSupport.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.registerSupport = void 0; -var apollo_1 = require("./apollo"); -var provisioning_1 = require("./provisioning"); -var login_1 = require("./login"); -var logout_1 = require("./logout"); -var fixture_1 = require("./fixture"); -var repeatUntil_1 = require("./repeatUntil"); -var registerSupport = function () { - Cypress.Commands.add('apolloClient', apollo_1.apolloClient); - Cypress.Commands.add('apollo', { prevSubject: 'optional' }, apollo_1.apollo); - Cypress.Commands.add('runProvisioningScript', provisioning_1.runProvisioningScript); - Cypress.Commands.add('executeGroovy', provisioning_1.executeGroovy); - Cypress.Commands.add('installBundle', provisioning_1.installBundle); - Cypress.Commands.add('login', login_1.login); - Cypress.Commands.add('loginAndStoreSession', login_1.loginAndStoreSession); - Cypress.Commands.add('logout', logout_1.logout); - Cypress.Commands.add('repeatUntil', repeatUntil_1.repeatUntil); - Cypress.Commands.overwrite('fixture', fixture_1.fixture); -}; -exports.registerSupport = registerSupport; diff --git a/dist/support/repeatUntil.d.ts b/dist/support/repeatUntil.d.ts deleted file mode 100644 index 1e15f91..0000000 --- a/dist/support/repeatUntil.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// -export declare type RepeatUntilOptions = { - attempts: number; - callback: () => void; - delay: number; -}; -declare global { - namespace Cypress { - interface Chainable { - repeatUntil(selector: string, options?: Partial): Chainable; - } - } -} -export declare const repeatUntil: (selector: string, options?: Partial) => void; diff --git a/dist/support/repeatUntil.js b/dist/support/repeatUntil.js deleted file mode 100644 index 8ec7728..0000000 --- a/dist/support/repeatUntil.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -// Load type definitions that come with Cypress module -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -exports.__esModule = true; -exports.repeatUntil = void 0; -var defaultOptions = { - attempts: 10, - callback: function () { return cy.reload({ log: false }); }, - delay: 1000 -}; -var repeatUntil = function (selector, options) { - if (options === void 0) { options = {}; } - options = __assign(__assign({}, defaultOptions), options); - var log = Cypress.log({ - name: 'repeatUntil', - message: "Reload until " + selector + ", remaining attempts : " + options.attempts, - consoleProps: function () { - return { - attempts: options.attempts - }; - } - }); - var items = Cypress.$(selector); - if (items.length) { - log.set({ $el: items }); - cy.wrap(items, { log: false }); - return; - } - if (options.attempts > 1) { - log.end(); - options.callback(); - cy.wait(options.delay); - cy.repeatUntil(selector, __assign(__assign({}, options), { attempts: options.attempts - 1 })); - } - else { - var err = Error('Items not found.'); - log.error(err); - throw err; - } -}; -exports.repeatUntil = repeatUntil; diff --git a/dist/utils/ClusterHelper.d.ts b/dist/utils/ClusterHelper.d.ts deleted file mode 100644 index 7767fbd..0000000 --- a/dist/utils/ClusterHelper.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const waitUntilJournalSync: (predicate?: (cluster: any) => boolean, timeout?: number, interval?: number) => void; diff --git a/dist/utils/ClusterHelper.js b/dist/utils/ClusterHelper.js deleted file mode 100644 index bfb76f2..0000000 --- a/dist/utils/ClusterHelper.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.waitUntilJournalSync = void 0; -var waitUntilJournalSync = function (predicate, timeout, interval) { - if (timeout === void 0) { timeout = 60000; } - if (interval === void 0) { interval = 1000; } - cy.waitUntil(function () { - return cy.apollo({ - fetchPolicy: 'no-cache', - queryFile: 'graphql/jcr/query/adminCluster.graphql' - }).then(function (result) { - var _a; - var adminResult = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.admin; - if (adminResult) { - return adminResult.cluster.isActivated && - adminResult.cluster.journal.isClusterSync && - (!predicate || predicate(adminResult.cluster)); - } - }); - }, { - errorMsg: 'Timeout waiting for journal to be synced', - timeout: timeout, - verbose: true, - interval: interval - }); -}; -exports.waitUntilJournalSync = waitUntilJournalSync; diff --git a/dist/utils/GraphQLHelper.d.ts b/dist/utils/GraphQLHelper.d.ts deleted file mode 100644 index 86ba066..0000000 --- a/dist/utils/GraphQLHelper.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const getDescriptions: (rootNode: string) => Cypress.Chainable; diff --git a/dist/utils/GraphQLHelper.js b/dist/utils/GraphQLHelper.js deleted file mode 100644 index d50fa24..0000000 --- a/dist/utils/GraphQLHelper.js +++ /dev/null @@ -1,163 +0,0 @@ -"use strict"; -/* eslint max-depth: ["error", 5] */ -var __spreadArray = (this && this.__spreadArray) || function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; -}; -exports.__esModule = true; -exports.getDescriptions = void 0; -// The type name to be used for further introspection can be located either in -// the type object itself or in the ofType object -var addTypes = (function (type, atPath) { - var newTypes = []; - if (type.name !== null) { - newTypes.push({ typeName: type.name, atPath: atPath }); - } - if (type.ofType && type.ofType.name !== null) { - newTypes.push({ typeName: type.ofType.name, atPath: atPath }); - } - return newTypes; -}); -// This returns a flat list of all children fields and args for a given GraphQL node -// This list can then be used in Cypress tests to look for missing descriptions -var getDescriptions = function (rootNode) { - cy.log('Starting analysis from GraphQL node: ' + rootNode); - return execIntrospection(rootNode, [], [rootNode]).then(function (descriptions) { - return descriptions; - }); -}; -exports.getDescriptions = getDescriptions; -var execIntrospection = function (typeName, descriptions, nodePath) { - return cy.apollo({ - variables: { - typeName: typeName - }, - queryFile: 'graphql/introspection.graphql' - }).then(function (response) { - var _a; - var responseDataType = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.__type; - if (responseDataType === null || responseDataType === undefined || responseDataType.kind === 'UNION') { - return; - } - if (responseDataType) { - // This array will be populated with types identified in the introspection query - // These will then be further introspected to get their children fields and args - var fetchSubTypes_1 = []; - descriptions.push({ - name: responseDataType.name, - description: responseDataType.description, - schemaType: '__Type', - schemaNode: responseDataType, - nodePath: nodePath - }); - // The following exploration of the object follows precisely the Graphql Introspection - // spec available at https://github.com/graphql/graphql-spec/blob/main/spec/Section%204%20--%20Introspection.md - if (responseDataType.fields) { - for (var _i = 0, _b = responseDataType.fields; _i < _b.length; _i++) { - var graphqlField = _b[_i]; - var fieldPath = __spreadArray(__spreadArray([], nodePath), [graphqlField.name]); - descriptions.push({ - name: graphqlField.name, - description: graphqlField.description, - schemaType: '__Field', - schemaNode: graphqlField, - isDeprecated: graphqlField.isDeprecated, - deprecationReason: graphqlField.deprecationReason, - nodePath: fieldPath - }); - fetchSubTypes_1 = __spreadArray(__spreadArray([], fetchSubTypes_1), addTypes(graphqlField.type, fieldPath)); - if (graphqlField.args) { - for (var _c = 0, _d = graphqlField.args; _c < _d.length; _c++) { - var graphQLInputValue = _d[_c]; - var inputValuePath = __spreadArray(__spreadArray([], fieldPath), [graphQLInputValue.name]); - descriptions.push({ - name: graphQLInputValue.name, - description: graphQLInputValue.description, - schemaType: '__InputValue', - schemaNode: graphQLInputValue, - isDeprecated: graphQLInputValue.isDeprecated, - deprecationReason: graphQLInputValue.deprecationReason, - nodePath: inputValuePath - }); - fetchSubTypes_1 = __spreadArray(__spreadArray([], fetchSubTypes_1), addTypes(graphQLInputValue.type, inputValuePath)); - } - } - } - } - if (responseDataType.interfaces) { - for (var _e = 0, _f = responseDataType.interfaces; _e < _f.length; _e++) { - var graphQLInterfaceType = _f[_e]; - descriptions.push({ - name: graphQLInterfaceType.name, - description: graphQLInterfaceType.description, - schemaType: '__Type', - schemaNode: graphQLInterfaceType, - nodePath: nodePath - }); - fetchSubTypes_1 = __spreadArray(__spreadArray([], fetchSubTypes_1), addTypes(graphQLInterfaceType, nodePath)); - } - } - if (responseDataType.possibleTypes) { - for (var _g = 0, _h = responseDataType.possibleTypes; _g < _h.length; _g++) { - var graphQLType = _h[_g]; - var fieldPath = __spreadArray(__spreadArray([], nodePath), [responseDataType.name, graphQLType.name]); - descriptions.push({ - name: graphQLType.name, - description: graphQLType.description, - schemaType: '__Type', - schemaNode: graphQLType, - nodePath: fieldPath - }); - fetchSubTypes_1 = __spreadArray(__spreadArray([], fetchSubTypes_1), addTypes(graphQLType, fieldPath)); - } - } - if (responseDataType.enumValues) { - for (var _j = 0, _k = responseDataType.enumValues; _j < _k.length; _j++) { - var graphQLEnumValue = _k[_j]; - var enumPath = __spreadArray(__spreadArray([], nodePath), [responseDataType.name, graphQLEnumValue.name]); - descriptions.push({ - name: graphQLEnumValue.name, - description: graphQLEnumValue.description, - schemaType: '__EnumValue', - schemaNode: graphQLEnumValue, - nodePath: enumPath, - isDeprecated: graphQLEnumValue.isDeprecated, - deprecationReason: graphQLEnumValue.deprecationReason - }); - } - } - if (responseDataType.inputFields) { - for (var _l = 0, _m = responseDataType.inputFields; _l < _m.length; _l++) { - var graphQLInputValue = _m[_l]; - var inputValuePath = __spreadArray(__spreadArray([], nodePath), [responseDataType.name, graphQLInputValue.name]); - descriptions.push({ - name: graphQLInputValue.name, - description: graphQLInputValue.description, - schemaType: '__InputValue', - schemaNode: graphQLInputValue, - nodePath: inputValuePath - }); - fetchSubTypes_1 = __spreadArray(__spreadArray([], fetchSubTypes_1), addTypes(graphQLInputValue.type, inputValuePath)); - } - } - if (responseDataType.ofType) { - fetchSubTypes_1 = __spreadArray(__spreadArray([], fetchSubTypes_1), addTypes(responseDataType.ofType, nodePath)); - } - var uniqueSubTypes = fetchSubTypes_1 - // Filter out duplicate types to ensure we don't introspect the same type multiple times - .filter(function (obj, index) { return fetchSubTypes_1.findIndex(function (item) { return item.typeName === obj.typeName; }) === index; }) - // Filter out types that have a name of null (e.g. List of non-null types) - .filter(function (subtype) { return subtype.typeName !== null; }) - // Remove types that might have already been introspected - .filter(function (subtype) { return descriptions.find(function (d) { return d.schemaType === '__Type' && d.name === subtype.typeName; }) === undefined; }); - // If there are no subtypes to introspect, we still need to return the descriptions - if (uniqueSubTypes.length === 0) { - return descriptions; - } - return Cypress.Promise.each(uniqueSubTypes, function (subType) { - return execIntrospection(subType.typeName, descriptions, __spreadArray(__spreadArray([], subType.atPath), [subType.typeName])); - }).then(function () { return descriptions; }); // Return descriptions after all recursive calls have completed - } - }); -}; diff --git a/dist/utils/JCRHelper.d.ts b/dist/utils/JCRHelper.d.ts deleted file mode 100644 index 81b62cb..0000000 --- a/dist/utils/JCRHelper.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -declare type Workspace = 'EDIT' | 'LIVE'; -export declare const setNodeProperty: (pathOrId: string, property: string, value: string | Array, language: string) => Cypress.Chainable; -export declare const deleteNode: (pathOrId: string, workspace?: Workspace) => Cypress.Chainable; -export declare const deleteNodeProperty: (pathOrId: string, property: string, language: string) => Cypress.Chainable; -export declare const addNode: (variables: { - parentPathOrId: string; - primaryNodeType: string; - name: string; - properties?: any[]; - children?: any[]; - mixins?: any[]; -}) => Cypress.Chainable; -export declare const getNodeByPath: (path: string, properties?: string[], language?: string, childrenTypes?: string[], workspace?: Workspace) => Cypress.Chainable; -export declare const getNodeAcl: (path: string) => Cypress.Chainable; -export declare const moveNode: (pathOrId: string, destParentPathOrId: string, destName?: string) => Cypress.Chainable; -export declare const getNodeTypes: (filter?: {}) => Cypress.Chainable; -export {}; diff --git a/dist/utils/JCRHelper.js b/dist/utils/JCRHelper.js deleted file mode 100644 index a061bcf..0000000 --- a/dist/utils/JCRHelper.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.getNodeTypes = exports.moveNode = exports.getNodeAcl = exports.getNodeByPath = exports.addNode = exports.deleteNodeProperty = exports.deleteNode = exports.setNodeProperty = void 0; -var setNodeProperty = function (pathOrId, property, value, language) { - var mutationFile = 'graphql/jcr/mutation/setProperty.graphql'; - if (value instanceof Array) { - mutationFile = 'graphql/jcr/mutation/setPropertyValues.graphql'; - } - return cy.apollo({ - variables: { - pathOrId: pathOrId, - property: property, - language: language, - value: value - }, - mutationFile: mutationFile - }); -}; -exports.setNodeProperty = setNodeProperty; -var deleteNode = function (pathOrId, workspace) { - if (workspace === void 0) { workspace = 'EDIT'; } - return cy.apollo({ - variables: { - pathOrId: pathOrId, - workspace: workspace - }, - mutationFile: 'graphql/jcr/mutation/deleteNode.graphql' - }); -}; -exports.deleteNode = deleteNode; -var deleteNodeProperty = function (pathOrId, property, language) { - return cy.apollo({ - variables: { - pathOrId: pathOrId, - property: property, - language: language - }, - mutationFile: 'graphql/jcr/mutation/deleteNodeProperty.graphql' - }); -}; -exports.deleteNodeProperty = deleteNodeProperty; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -var addNode = function (variables) { - return cy.apollo({ - variables: variables, - mutationFile: 'graphql/jcr/mutation/addNode.graphql' - }); -}; -exports.addNode = addNode; -var getNodeByPath = function (path, properties, language, childrenTypes, workspace) { - if (childrenTypes === void 0) { childrenTypes = []; } - if (workspace === void 0) { workspace = 'EDIT'; } - return cy.apollo({ - variables: { - path: path, - properties: properties, - language: language, - childrenTypes: childrenTypes || [], - workspace: workspace || 'EDIT' - }, - queryFile: 'graphql/jcr/query/getNodeByPath.graphql' - }); -}; -exports.getNodeByPath = getNodeByPath; -var getNodeAcl = function (path) { - return cy.apollo({ - variables: { - path: path - }, - queryFile: 'graphql/jcr/query/getNodeAcl.graphql' - }); -}; -exports.getNodeAcl = getNodeAcl; -var moveNode = function (pathOrId, destParentPathOrId, destName) { - return cy.apollo({ - variables: { - pathOrId: pathOrId, - destParentPathOrId: destParentPathOrId, - destName: destName - }, - mutationFile: 'graphql/jcr/mutation/moveNode.graphql' - }); -}; -exports.moveNode = moveNode; -var getNodeTypes = function (filter) { - if (filter === void 0) { filter = {}; } - return cy.apollo({ - variables: { - filter: filter - }, - queryFile: 'graphql/jcr/query/getNodeTypes.graphql' - }); -}; -exports.getNodeTypes = getNodeTypes; diff --git a/dist/utils/JahiaPlatformHelper.d.ts b/dist/utils/JahiaPlatformHelper.d.ts deleted file mode 100644 index 695128a..0000000 --- a/dist/utils/JahiaPlatformHelper.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const getJahiaVersion: () => Cypress.Chainable; diff --git a/dist/utils/JahiaPlatformHelper.js b/dist/utils/JahiaPlatformHelper.js deleted file mode 100644 index a9b069a..0000000 --- a/dist/utils/JahiaPlatformHelper.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.getJahiaVersion = void 0; -var getJahiaVersion = function () { - return cy.apollo({ - fetchPolicy: 'no-cache', - queryFile: 'graphql/jcr/query/getJahiaVersion.graphql' - }).then(function (result) { - var _a; - return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.admin.jahia.version; - }); -}; -exports.getJahiaVersion = getJahiaVersion; diff --git a/dist/utils/PublicationAndWorkflowHelper.d.ts b/dist/utils/PublicationAndWorkflowHelper.d.ts deleted file mode 100644 index 3343579..0000000 --- a/dist/utils/PublicationAndWorkflowHelper.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare const publishAndWaitJobEnding: (path: string, languages?: string[]) => void; -export declare const unpublishNode: (path: string, languages: string) => void; -export declare const startWorkflow: (pathOrId: string, definition: string, language: string) => Cypress.Chainable; -export declare const validateAllWorkflows: () => void; -export declare const abortAllWorkflows: () => void; -export declare const waitAllJobsFinished: (errorMessage?: string, timeout?: number) => void; diff --git a/dist/utils/PublicationAndWorkflowHelper.js b/dist/utils/PublicationAndWorkflowHelper.js deleted file mode 100644 index c5f7b64..0000000 --- a/dist/utils/PublicationAndWorkflowHelper.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.waitAllJobsFinished = exports.abortAllWorkflows = exports.validateAllWorkflows = exports.startWorkflow = exports.unpublishNode = exports.publishAndWaitJobEnding = void 0; -var publishAndWaitJobEnding = function (path, languages) { - if (languages === void 0) { languages = ['en']; } - cy.apollo({ - variables: { - pathOrId: path, - languages: languages, - publishSubNodes: true, - includeSubTree: true - }, - mutationFile: 'graphql/jcr/mutation/publishNode.graphql' - }); - exports.waitAllJobsFinished('Publication timeout for node: ' + path, 60000); -}; -exports.publishAndWaitJobEnding = publishAndWaitJobEnding; -var unpublishNode = function (path, languages) { - cy.apollo({ - variables: { - pathOrId: path, - languages: languages - }, - mutationFile: 'graphql/jcr/mutation/unpublishNode.graphql' - }); -}; -exports.unpublishNode = unpublishNode; -var startWorkflow = function (pathOrId, definition, language) { - return cy.apollo({ - variables: { - pathOrId: pathOrId, - definition: definition, - language: language - }, - mutationFile: 'graphql/jcr/mutation/startWorkflow.graphql' - }); -}; -exports.startWorkflow = startWorkflow; -var validateAllWorkflows = function () { - cy.executeGroovy('groovy/admin/completeWorkflows.groovy'); - exports.waitAllJobsFinished('All workflows validated but some jobs are still running after a minute', 60000); -}; -exports.validateAllWorkflows = validateAllWorkflows; -var abortAllWorkflows = function () { - cy.executeGroovy('groovy/admin/abortWorkflows.groovy'); -}; -exports.abortAllWorkflows = abortAllWorkflows; -var waitAllJobsFinished = function (errorMessage, timeout) { - if (timeout === void 0) { timeout = 60000; } - cy.waitUntil(function () { - return cy - .apollo({ - fetchPolicy: 'no-cache', - queryFile: 'graphql/jcr/query/getJobsWithStatus.graphql' - }) - .then(function (response) { - var _a, _b, _c, _d; - var jobs = (_d = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.admin) === null || _b === void 0 ? void 0 : _b.jahia) === null || _c === void 0 ? void 0 : _c.scheduler) === null || _d === void 0 ? void 0 : _d.jobs; - var publicationJobs = jobs.filter(function (job) { return job.group === 'PublicationJob'; }); - var hasActivePublicationJobs = publicationJobs.some(function (job) { return job.jobStatus === 'EXECUTING'; }); - return !hasActivePublicationJobs; - }); - }, { - errorMsg: errorMessage ? errorMessage : 'Jobs are still running before the end of timeout', - timeout: timeout, - verbose: true, - interval: 500 - }); - // Wait 0.5 seconds for server sync after publication - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(500); -}; -exports.waitAllJobsFinished = waitAllJobsFinished; diff --git a/dist/utils/SAMHelper.d.ts b/dist/utils/SAMHelper.d.ts deleted file mode 100644 index f66dbb2..0000000 --- a/dist/utils/SAMHelper.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const waitUntilSAMStatusGreen: (severity?: string, timeout?: number, interval?: number, greenMatchCount?: number) => void; diff --git a/dist/utils/SAMHelper.js b/dist/utils/SAMHelper.js deleted file mode 100644 index 77c698c..0000000 --- a/dist/utils/SAMHelper.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.waitUntilSAMStatusGreen = void 0; -/* - When Jahia is starting or performing provisioning operations - it is expected for the SAM probe to alternate beween GREEN, YELLOW and RED statuses. - - The primary use of this method is to wait until a Jahia platform stabilizes after a startup or - provisioning operation. - - Instead of waiting only for one occurence of a GREEN status, this function will wait until the a - GREEN status was returned a number of consecutive times (greenMatchCount). -*/ -var waitUntilSAMStatusGreen = function (severity, timeout, interval, greenMatchCount) { - if (severity === void 0) { severity = 'MEDIUM'; } - if (timeout === void 0) { timeout = 60000; } - if (interval === void 0) { interval = 500; } - if (greenMatchCount === void 0) { greenMatchCount = 10; } - var greenCount = 0; - cy.waitUntil(function () { - return cy.apollo({ - fetchPolicy: 'no-cache', - queryFile: 'graphql/sam/healthStatus.graphql', - variables: { - severity: severity - } - }).then(function (result) { - var _a, _b, _c, _d; - var healthStatus = (_d = (_c = (_b = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.admin) === null || _b === void 0 ? void 0 : _b.jahia) === null || _c === void 0 ? void 0 : _c.healthCheck) === null || _d === void 0 ? void 0 : _d.status; - if (healthStatus) { - greenCount = healthStatus.health === 'GREEN' ? greenCount + 1 : 0; - return greenCount >= greenMatchCount; - } - }); - }, { - errorMsg: "Timeout waiting for SAM to be green for severity: " + severity, - timeout: timeout, - verbose: true, - interval: interval - }); -}; -exports.waitUntilSAMStatusGreen = waitUntilSAMStatusGreen; diff --git a/dist/utils/SiteHelper.d.ts b/dist/utils/SiteHelper.d.ts deleted file mode 100644 index b942188..0000000 --- a/dist/utils/SiteHelper.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { JahiaServer } from '../support'; -export declare const createSite: (siteKey: string, config?: { - languages?: string; - templateSet: string; - serverName: string; - locale: string; -}, jahiaServer?: JahiaServer) => void; -export declare const deleteSite: (siteKey: string, jahiaServer?: JahiaServer) => void; -export declare const enableModule: (moduleName: string, siteKey: string, jahiaServer?: JahiaServer) => void; -export declare const disableModule: (moduleName: string, siteKey: string, apollo?: Function) => void; -export declare const editSite: (siteKey: string, config?: { - serverName: string; -}, jahiaServer?: JahiaServer) => void; diff --git a/dist/utils/SiteHelper.js b/dist/utils/SiteHelper.js deleted file mode 100644 index 3552083..0000000 --- a/dist/utils/SiteHelper.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.editSite = exports.disableModule = exports.enableModule = exports.deleteSite = exports.createSite = void 0; -var createSite = function (siteKey, config, jahiaServer) { - if (config === void 0) { config = { templateSet: 'dx-base-demo-templates', serverName: 'localhost', locale: 'en' }; } - cy.executeGroovy('groovy/admin/createSite.groovy', { - SITEKEY: siteKey, - TEMPLATES_SET: config.templateSet, - SERVERNAME: config.serverName, - LOCALE: config.locale, - LANGUAGES: config.languages || config.locale - }, jahiaServer); -}; -exports.createSite = createSite; -var deleteSite = function (siteKey, jahiaServer) { - cy.executeGroovy('groovy/admin/deleteSite.groovy', { - SITEKEY: siteKey - }, jahiaServer); -}; -exports.deleteSite = deleteSite; -var enableModule = function (moduleName, siteKey, jahiaServer) { - cy.runProvisioningScript({ - fileContent: '- enable: "' + moduleName + '"\n site: "' + siteKey + '"', - type: 'application/yaml' - }, undefined, jahiaServer); -}; -exports.enableModule = enableModule; -var disableModule = function (moduleName, siteKey, apollo) { - if (apollo === void 0) { apollo = cy.apollo; } - apollo({ - mutationFile: 'graphql/jcr/mutation/disableModule.graphql', - variables: { moduleName: moduleName, pathOrId: "/sites/" + siteKey } - }); -}; -exports.disableModule = disableModule; -var editSite = function (siteKey, config, jahiaServer) { - if (config === void 0) { config = { serverName: 'localhost' }; } - cy.executeGroovy('groovy/admin/editSite.groovy', { - SITEKEY: siteKey, - SERVERNAME: config.serverName - }, jahiaServer); -}; -exports.editSite = editSite; diff --git a/dist/utils/UsersHelper.d.ts b/dist/utils/UsersHelper.d.ts deleted file mode 100644 index 071376d..0000000 --- a/dist/utils/UsersHelper.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export declare const grantRoles: (pathOrId: string, roleNames: Array, principalName: string, principalType: string) => Cypress.Chainable; -export declare const revokeRoles: (pathOrId: string, roleNames: Array, principalName: string, principalType: string) => Cypress.Chainable; -export declare const createUser: (userName: string, password: string, properties?: { - name: string; - value: string; -}[]) => void; -export declare const deleteUser: (userName: string) => void; -export declare const addUserToGroup: (userName: string, groupName: string, siteKey?: string) => void; diff --git a/dist/utils/UsersHelper.js b/dist/utils/UsersHelper.js deleted file mode 100644 index aa16c3e..0000000 --- a/dist/utils/UsersHelper.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.addUserToGroup = exports.deleteUser = exports.createUser = exports.revokeRoles = exports.grantRoles = void 0; -var grantRoles = function (pathOrId, roleNames, principalName, principalType) { - cy.log('Grant role(s) ' + roleNames + ' with principal type ' + principalType + ' to ' + principalName + ' on node ' + pathOrId); - return cy.apollo({ - variables: { - pathOrId: pathOrId, - roleNames: roleNames, - principalName: principalName, - principalType: principalType - }, - mutationFile: 'graphql/jcr/mutation/grantRoles.graphql' - }); -}; -exports.grantRoles = grantRoles; -var revokeRoles = function (pathOrId, roleNames, principalName, principalType) { - cy.log('Revoke role(s) ' + roleNames + ' with principal type ' + principalType + ' to ' + principalName + ' on node ' + pathOrId); - return cy.apollo({ - variables: { - pathOrId: pathOrId, - roleNames: roleNames, - principalName: principalName, - principalType: principalType - }, - mutationFile: 'graphql/jcr/mutation/revokeRoles.graphql' - }); -}; -exports.revokeRoles = revokeRoles; -var createUser = function (userName, password, properties) { - if (properties === void 0) { properties = []; } - var userProperties = properties.map(function (property) { - return 'properties.setProperty("' + property.name + '", "' + property.value + '")'; - }); - cy.executeGroovy('groovy/admin/createUser.groovy', { - USER_NAME: userName, - PASSWORD: password ? password : 'password', - USER_PROPERTIES: userProperties ? userProperties.join('\n') : '' - }); -}; -exports.createUser = createUser; -var deleteUser = function (userName) { - cy.executeGroovy('groovy/admin/deleteUser.groovy', { - USER_NAME: userName - }); -}; -exports.deleteUser = deleteUser; -var addUserToGroup = function (userName, groupName, siteKey) { - cy.executeGroovy('groovy/admin/addUserToGroup.groovy', { - USER_NAME: userName, - GROUP_NAME: groupName, - SITE_KEY: siteKey ? "\"" + siteKey + "\"" : 'null' - }); -}; -exports.addUserToGroup = addUserToGroup; diff --git a/dist/utils/VanityUrlHelper.d.ts b/dist/utils/VanityUrlHelper.d.ts deleted file mode 100644 index 00f4929..0000000 --- a/dist/utils/VanityUrlHelper.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const addVanityUrl: (pathOrId: string, language: string, url: string) => Cypress.Chainable; -export declare const getVanityUrl: (path: string, languages: Array) => Cypress.Chainable; -export declare const removeVanityUrl: (pathOrId: string, url: string) => Cypress.Chainable; diff --git a/dist/utils/VanityUrlHelper.js b/dist/utils/VanityUrlHelper.js deleted file mode 100644 index 4c9549c..0000000 --- a/dist/utils/VanityUrlHelper.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -exports.__esModule = true; -exports.removeVanityUrl = exports.getVanityUrl = exports.addVanityUrl = void 0; -var addVanityUrl = function (pathOrId, language, url) { - return cy.apollo({ - variables: { - pathOrId: pathOrId, - language: language, - url: url - }, - mutationFile: 'graphql/jcr/mutation/addVanityUrl.graphql' - }); -}; -exports.addVanityUrl = addVanityUrl; -var getVanityUrl = function (path, languages) { - return cy.apollo({ - variables: { - path: path, - languages: languages - }, - queryFile: 'graphql/jcr/query/getVanityUrls.graphql' - }); -}; -exports.getVanityUrl = getVanityUrl; -var removeVanityUrl = function (pathOrId, url) { - return cy.apollo({ - variables: { - pathOrId: pathOrId, - url: url - }, - mutationFile: 'graphql/jcr/mutation/removeVanityUrl.graphql' - }); -}; -exports.removeVanityUrl = removeVanityUrl; diff --git a/dist/utils/index.d.ts b/dist/utils/index.d.ts deleted file mode 100644 index 3634570..0000000 --- a/dist/utils/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from './JCRHelper'; -export * from './PublicationAndWorkflowHelper'; -export * from './SiteHelper'; -export * from './UsersHelper'; -export * from './VanityUrlHelper'; -export * from './ClusterHelper'; -export * from './JahiaPlatformHelper'; -export * from './GraphQLHelper'; -export * from './SAMHelper'; diff --git a/dist/utils/index.js b/dist/utils/index.js deleted file mode 100644 index 01604d7..0000000 --- a/dist/utils/index.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./JCRHelper"), exports); -__exportStar(require("./PublicationAndWorkflowHelper"), exports); -__exportStar(require("./SiteHelper"), exports); -__exportStar(require("./UsersHelper"), exports); -__exportStar(require("./VanityUrlHelper"), exports); -__exportStar(require("./ClusterHelper"), exports); -__exportStar(require("./JahiaPlatformHelper"), exports); -__exportStar(require("./GraphQLHelper"), exports); -__exportStar(require("./SAMHelper"), exports);