@jahia/cypress 3.21.0 → 3.21.1

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.
@@ -2,10 +2,10 @@
2
2
  declare global {
3
3
  namespace Cypress {
4
4
  interface Chainable<Subject> {
5
- login(username?: string, password?: string): Chainable<Cypress.Response<any>>;
6
- loginAndStoreSession(username?: string, password?: string): Chainable<Cypress.Response<any>>;
5
+ login(username?: string, password?: string, url?: string): Chainable<Cypress.Response<any>>;
6
+ loginAndStoreSession(username?: string, password?: string, url?: string): Chainable<Cypress.Response<any>>;
7
7
  }
8
8
  }
9
9
  }
10
10
  export declare const login: (username?: string, password?: string, url?: string) => void;
11
- export declare const loginAndStoreSession: (username?: string, password?: string) => void;
11
+ export declare const loginAndStoreSession: (username?: string, password?: string, url?: string) => void;
@@ -28,14 +28,15 @@ var login = function (username, password, url) {
28
28
  });
29
29
  };
30
30
  exports.login = login;
31
- var loginAndStoreSession = function (username, password) {
31
+ var loginAndStoreSession = function (username, password, url) {
32
32
  if (username === void 0) { username = 'root'; }
33
33
  if (password === void 0) { password = Cypress.env('SUPER_USER_PASSWORD'); }
34
+ if (url === void 0) { url = '/start'; }
34
35
  cy.session('session-' + username, function () {
35
36
  cy.login(username, password); // Edit in chief
36
37
  }, {
37
38
  validate: function () {
38
- cy.request('/start').its('status').should('eq', 200);
39
+ cy.request(url).its('status').should('eq', 200);
39
40
  }
40
41
  });
41
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jahia/cypress",
3
- "version": "3.21.0",
3
+ "version": "3.21.1",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "lint": "eslint src -c .eslintrc.json --ext .ts"
@@ -7,8 +7,8 @@ declare global {
7
7
  namespace Cypress {
8
8
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
9
  interface Chainable<Subject> {
10
- login(username?: string, password?: string): Chainable<Cypress.Response<any>>
11
- loginAndStoreSession(username?: string, password?: string): Chainable<Cypress.Response<any>>
10
+ login(username?: string, password?: string, url?: string): Chainable<Cypress.Response<any>>
11
+ loginAndStoreSession(username?: string, password?: string, url?: string): Chainable<Cypress.Response<any>>
12
12
  }
13
13
  }
14
14
  }
@@ -36,12 +36,12 @@ export const login = (username = 'root', password: string = Cypress.env('SUPER_U
36
36
  });
37
37
  };
38
38
 
39
- export const loginAndStoreSession = (username = 'root', password: string = Cypress.env('SUPER_USER_PASSWORD')): void => {
39
+ export const loginAndStoreSession = (username = 'root', password: string = Cypress.env('SUPER_USER_PASSWORD'), url = '/start'): void => {
40
40
  cy.session('session-' + username, () => {
41
41
  cy.login(username, password); // Edit in chief
42
42
  }, {
43
43
  validate() {
44
- cy.request('/start').its('status').should('eq', 200);
44
+ cy.request(url).its('status').should('eq', 200);
45
45
  }
46
46
  });
47
47
  };