@jahia/cypress 3.17.5 → 3.17.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,4 +3,6 @@ export declare class Collapsible extends BaseComponent {
3
3
  static defaultSelector: string;
4
4
  collapse(): Collapsible;
5
5
  expand(): Collapsible;
6
+ shouldBeCollapsed(): void;
7
+ shouldBeExpanded(): void;
6
8
  }
@@ -40,6 +40,12 @@ var Collapsible = /** @class */ (function (_super) {
40
40
  });
41
41
  return this;
42
42
  };
43
+ Collapsible.prototype.shouldBeCollapsed = function () {
44
+ this.get().find('.moonstone-collapsible_content_collapsed').should('exist');
45
+ };
46
+ Collapsible.prototype.shouldBeExpanded = function () {
47
+ this.get().find('.moonstone-collapsible_content_expanded').should('exist');
48
+ };
43
49
  Collapsible.defaultSelector = '.moonstone-collapsible';
44
50
  return Collapsible;
45
51
  }(baseComponent_1.BaseComponent));
@@ -1,3 +1,4 @@
1
1
  export * from './executeGroovy';
2
2
  export * from './runProvisioningScript';
3
3
  export * from './installBundle';
4
+ export * from './uninstallBundle';
@@ -13,3 +13,4 @@ exports.__esModule = true;
13
13
  __exportStar(require("./executeGroovy"), exports);
14
14
  __exportStar(require("./runProvisioningScript"), exports);
15
15
  __exportStar(require("./installBundle"), exports);
16
+ __exportStar(require("./uninstallBundle"), exports);
@@ -0,0 +1,9 @@
1
+ /// <reference types="cypress" />
2
+ declare global {
3
+ namespace Cypress {
4
+ interface Chainable<Subject> {
5
+ uninstallBundle(bundleSymbolicName: string): Chainable<Cypress.Response<any>>;
6
+ }
7
+ }
8
+ }
9
+ export declare const uninstallBundle: (bundleSymbolicName: string) => void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */
3
+ exports.__esModule = true;
4
+ exports.uninstallBundle = void 0;
5
+ /// <reference types="cypress" />
6
+ var uninstallBundle = function (bundleSymbolicName) {
7
+ cy.runProvisioningScript({
8
+ fileContent: '- uninstallBundle: "' + bundleSymbolicName + '"\n',
9
+ type: 'application/yaml'
10
+ });
11
+ };
12
+ exports.uninstallBundle = uninstallBundle;
@@ -6,6 +6,7 @@ export declare const createSite: (siteKey: string, config?: {
6
6
  }) => void;
7
7
  export declare const deleteSite: (siteKey: string) => void;
8
8
  export declare const enableModule: (moduleName: string, siteKey: string) => void;
9
+ export declare const disableModule: (moduleName: string, siteKey: string) => void;
9
10
  export declare const editSite: (siteKey: string, config?: {
10
11
  serverName: string;
11
12
  }) => void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.editSite = exports.enableModule = exports.deleteSite = exports.createSite = void 0;
3
+ exports.editSite = exports.disableModule = exports.enableModule = exports.deleteSite = exports.createSite = void 0;
4
4
  var createSite = function (siteKey, config) {
5
5
  if (config === void 0) { config = { templateSet: 'dx-base-demo-templates', serverName: 'localhost', locale: 'en' }; }
6
6
  cy.executeGroovy('groovy/admin/createSite.groovy', {
@@ -25,6 +25,13 @@ var enableModule = function (moduleName, siteKey) {
25
25
  });
26
26
  };
27
27
  exports.enableModule = enableModule;
28
+ var disableModule = function (moduleName, siteKey) {
29
+ cy.apollo({
30
+ mutationFile: 'graphql/jcr/mutation/disableModule.graphql',
31
+ variables: { moduleName: moduleName, pathOrId: "/sites/" + siteKey }
32
+ });
33
+ };
34
+ exports.disableModule = disableModule;
28
35
  var editSite = function (siteKey, config) {
29
36
  if (config === void 0) { config = { serverName: 'localhost' }; }
30
37
  cy.executeGroovy('groovy/admin/editSite.groovy', {
@@ -0,0 +1,9 @@
1
+ mutation disableModule($moduleName: String!, $pathOrId: String!) {
2
+ jcr {
3
+ mutateNode(pathOrId: $pathOrId) {
4
+ mutateProperty(name: "j:installedModules") {
5
+ removeValue(value: $moduleName)
6
+ }
7
+ }
8
+ }
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jahia/cypress",
3
- "version": "3.17.5",
3
+ "version": "3.17.7",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "lint": "eslint src -c .eslintrc.json --ext .ts"
@@ -20,4 +20,12 @@ export class Collapsible extends BaseComponent {
20
20
  });
21
21
  return this;
22
22
  }
23
+
24
+ shouldBeCollapsed(): void {
25
+ this.get().find('.moonstone-collapsible_content_collapsed').should('exist');
26
+ }
27
+
28
+ shouldBeExpanded(): void {
29
+ this.get().find('.moonstone-collapsible_content_expanded').should('exist');
30
+ }
23
31
  }
@@ -1,3 +1,4 @@
1
1
  export * from './executeGroovy';
2
2
  export * from './runProvisioningScript';
3
3
  export * from './installBundle';
4
+ export * from './uninstallBundle';
@@ -0,0 +1,20 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */
2
+
3
+ // Load type definitions that come with Cypress module
4
+ /// <reference types="cypress" />
5
+
6
+ declare global {
7
+ namespace Cypress {
8
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
+ interface Chainable<Subject> {
10
+ uninstallBundle(bundleSymbolicName: string): Chainable<Cypress.Response<any>>
11
+ }
12
+ }
13
+ }
14
+
15
+ export const uninstallBundle = function (bundleSymbolicName: string): void {
16
+ cy.runProvisioningScript({
17
+ fileContent: '- uninstallBundle: "' + bundleSymbolicName + '"\n',
18
+ type: 'application/yaml'
19
+ });
20
+ };
@@ -22,6 +22,13 @@ export const enableModule = (moduleName: string, siteKey: string): void => {
22
22
  });
23
23
  };
24
24
 
25
+ export const disableModule = (moduleName: string, siteKey: string): void => {
26
+ cy.apollo({
27
+ mutationFile: 'graphql/jcr/mutation/disableModule.graphql',
28
+ variables: {moduleName, pathOrId: `/sites/${siteKey}`}
29
+ });
30
+ };
31
+
25
32
  export const editSite = (siteKey: string, config: {serverName: string} = {serverName: 'localhost'}): void => {
26
33
  cy.executeGroovy('groovy/admin/editSite.groovy', {
27
34
  SITEKEY: siteKey,