dceky 1.1.8 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -0
- package/lib/src/commands/getId.js +1 -1
- package/lib/src/commands/getId.js.map +1 -1
- package/lib/src/commands/launchAs.js +1 -1
- package/lib/src/commands/launchAs.js.map +1 -1
- package/lib/src/commands/logIntoPorta.js +4 -4
- package/lib/src/commands/logIntoPorta.js.map +1 -1
- package/lib/src/commands/sendRequest.d.ts +23 -0
- package/lib/src/commands/sendRequest.js +104 -0
- package/lib/src/commands/sendRequest.js.map +1 -0
- package/lib/start/helpers/executeAllHeadlessCombinations.js +25 -10
- package/lib/start/helpers/executeAllHeadlessCombinations.js.map +1 -1
- package/lib/start/helpers/generateReportHomepage.js +8 -4
- package/lib/start/helpers/generateReportHomepage.js.map +1 -1
- package/lib/start/helpers/reportHomepage.ejs +18 -7
- package/lib/start/helpers/runCypressHeadless.js +1 -1
- package/lib/start/helpers/runCypressHeadless.js.map +1 -1
- package/lib/start/index.js +52 -4
- package/lib/start/index.js.map +1 -1
- package/lib/start/types/TemplateReportInfo.d.ts +1 -0
- package/package.json +3 -2
- package/src/commands/getId.ts +1 -1
- package/src/commands/launchAs.ts +1 -1
- package/src/commands/logIntoPorta.ts +4 -4
- package/src/commands/sendRequest.ts +139 -0
- package/start/helpers/executeAllHeadlessCombinations.ts +25 -10
- package/start/helpers/generateReportHomepage.ts +10 -3
- package/start/helpers/reportHomepage.ejs +18 -7
- package/start/helpers/runCypressHeadless.ts +1 -1
- package/start/index.ts +57 -4
- package/start/types/ReportInfo.ts +2 -1
- package/start/types/TemplateReportInfo.ts +2 -0
package/README.md
CHANGED
|
@@ -63,3 +63,70 @@ This will regenerate configuration files, typescript declarations, and other ky
|
|
|
63
63
|
QA people and CI systems should start tests using `npm run ky:start` because that ensures that no files, dependencies, or files will be changed on run.
|
|
64
64
|
|
|
65
65
|
But, developers should run tests using `npm run ky:dev` because each time the tests are run, ky is automatically set up again, ensuring that ky files are up-to-date and running smoothly.
|
|
66
|
+
|
|
67
|
+
### Writing Your Own Custom Commands
|
|
68
|
+
|
|
69
|
+
Custom commands are called using Ky (e.g. `ky.myCustomCommand()`), and you define them in the `commands` folder generated when you first setup Ky.
|
|
70
|
+
|
|
71
|
+
Create a new file when creating a custom command, and this file will take the following structure:
|
|
72
|
+
(e.g. myCustomCommand.ts)
|
|
73
|
+
```ts
|
|
74
|
+
/// <reference types="cypress" />
|
|
75
|
+
|
|
76
|
+
/*----------------------------------------*/
|
|
77
|
+
/* ---------------- Type ---------------- */
|
|
78
|
+
/*----------------------------------------*/
|
|
79
|
+
|
|
80
|
+
declare global {
|
|
81
|
+
namespace Cypress {
|
|
82
|
+
interface Chainable {
|
|
83
|
+
/**
|
|
84
|
+
* My custom command
|
|
85
|
+
* @author Your name here
|
|
86
|
+
* @param any params
|
|
87
|
+
* @returns what is returned
|
|
88
|
+
*/
|
|
89
|
+
myCustomCommand(
|
|
90
|
+
/* params here */
|
|
91
|
+
): Chainable</* your return type */>;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/*----------------------------------------*/
|
|
97
|
+
/* --------------- Command -------------- */
|
|
98
|
+
/*----------------------------------------*/
|
|
99
|
+
|
|
100
|
+
const myCustomCommand = () => {
|
|
101
|
+
Cypress.Commands.add('myCustomCommand', (/* Function Params */) => {
|
|
102
|
+
/* Function Body */
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/*----------------------------------------*/
|
|
107
|
+
/* --------------- Export --------------- */
|
|
108
|
+
/*----------------------------------------*/
|
|
109
|
+
|
|
110
|
+
export default myCustomCommand;
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
When you finish writing your command, run `npm run ky:setup`, which will let Ky initialize your command. You can now use your command in your tests!
|
|
115
|
+
|
|
116
|
+
All return types should be [Chainable](https://learn.cypress.io/cypress-fundamentals/command-chaining). For example, if your custom command returns a boolean, the return type should be `Chainable<boolean>`, and you would use it in a test like this:
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
ky.myCustomCommand().then((result) => {
|
|
120
|
+
// result is typed as boolean here
|
|
121
|
+
});
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### Create your own return value?
|
|
125
|
+
|
|
126
|
+
Any time you don't return the value directly from another ky or Cypress command (for example, returning a primitive value or an object that you create), make sure to wrap it (`ky.wrap()`) so it can be properly chained. For example:
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
const myReturnValue = { hello: 'world' };
|
|
130
|
+
|
|
131
|
+
return ky.wrap(myReturnValue);
|
|
132
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getId.js","sourceRoot":"","sources":["../../../src/commands/getId.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,KAAK,GAAG,GAAG,EAAE;IACjB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,QAAgB,EAAE,EAAE;QACjD,OAAO,CACL,EAAE;aACC,GAAG,CAAC,QAAQ,CAAC;aACb,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;aACpB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACb,OAAO,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"getId.js","sourceRoot":"","sources":["../../../src/commands/getId.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,KAAK,GAAG,GAAG,EAAE;IACjB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,QAAgB,EAAE,EAAE;QACjD,OAAO,CACL,EAAE;aACC,GAAG,CAAC,QAAQ,CAAC;aACb,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;aACpB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACb,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,KAAK,CAAC"}
|
|
@@ -102,7 +102,7 @@ const launchAs = () => {
|
|
|
102
102
|
});
|
|
103
103
|
// Launch via the sessionless launch URL
|
|
104
104
|
const launchURL = sessionlessLaunchInfo.url;
|
|
105
|
-
cy.
|
|
105
|
+
cy.sendRequest({ url: launchURL }).then((response) => {
|
|
106
106
|
const { action, fields } = (0, getFormData_1.default)({ html: response.body });
|
|
107
107
|
cy.visit({
|
|
108
108
|
url: action,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launchAs.js","sourceRoot":"","sources":["../../../src/commands/launchAs.ts"],"names":[],"mappings":";AAAA,iCAAiC;;;;;AAEjC,wEAAgD;AAkChD,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,QAAQ,GAAG,GAAG,EAAE;IACpB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,UAAU,EACV,CACE,IAAY,EACZ,OAGI,EAAE,EACN,EAAE;QACF,iBAAiB;QACjB,EAAE,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC;QAE/B,mBAAmB;QACnB,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAEjC,0DAA0D;QAC1D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,WAAW,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;YACnD,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;YACtE,CAAC;YACD,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,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,MAAM,EAAE,MAAM;wBACd,IAAI,EAAE,MAAM;qBACb,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CACL,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,QAAQ,CAAC"}
|
|
@@ -33,7 +33,7 @@ const logIntoPorta = () => {
|
|
|
33
33
|
}
|
|
34
34
|
const htmlHeaders = { accept: 'text/html' };
|
|
35
35
|
// Request 1: GET Cirrus Identity discovery page
|
|
36
|
-
cy.
|
|
36
|
+
cy.sendRequest({
|
|
37
37
|
url: LOGIN_PAGE,
|
|
38
38
|
followRedirect: true,
|
|
39
39
|
failOnStatusCode: false,
|
|
@@ -46,7 +46,7 @@ const logIntoPorta = () => {
|
|
|
46
46
|
}
|
|
47
47
|
const idpUrl = `${IDP_BASE_URL}${btnMatch[1]}`;
|
|
48
48
|
// Request 2: GET HarvardKey IdP login page
|
|
49
|
-
cy.
|
|
49
|
+
cy.sendRequest({
|
|
50
50
|
url: idpUrl,
|
|
51
51
|
followRedirect: true,
|
|
52
52
|
failOnStatusCode: false,
|
|
@@ -58,7 +58,7 @@ const logIntoPorta = () => {
|
|
|
58
58
|
throw new Error('Could not find login form action on HarvardKey page');
|
|
59
59
|
}
|
|
60
60
|
// Request 3: POST credentials to HarvardKey login form
|
|
61
|
-
cy.
|
|
61
|
+
cy.sendRequest({
|
|
62
62
|
method: loginMethod,
|
|
63
63
|
url: loginFormUrl,
|
|
64
64
|
form: true,
|
|
@@ -74,7 +74,7 @@ const logIntoPorta = () => {
|
|
|
74
74
|
throw new Error('Could not find SAML form in login response');
|
|
75
75
|
}
|
|
76
76
|
// Request 4: POST SAML assertion to ACS
|
|
77
|
-
|
|
77
|
+
cy.sendRequest({
|
|
78
78
|
method: samlMethod,
|
|
79
79
|
url: samlFormUrl,
|
|
80
80
|
form: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logIntoPorta.js","sourceRoot":"","sources":["../../../src/commands/logIntoPorta.ts"],"names":[],"mappings":";AAAA,iCAAiC;;;;;AAEjC,wEAAgD;AA6BhD,4CAA4C;AAC5C,kDAAkD;AAClD,4CAA4C;AAE5C,6CAA6C;AAC7C,MAAM,UAAU,GAAG,uHAAuH,CAAC;AAC3I,0CAA0C;AAC1C,MAAM,YAAY,GAAG,iCAAiC,CAAC;AACvD,oDAAoD;AACpD,MAAM,wBAAwB,GAAG,uBAAuB,CAAC;AAEzD,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,cAAc,EACd,CACE,IAAY,EACZ,EAAE;QACF,EAAE,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;QAExD,kDAAkD;QAClD,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACxC,MAAM,QAAQ,GAAG,IAAI,CAAC;YAEtB,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,2BAA2B,CAAC,CAAC;YACrE,CAAC;YACD,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC;YAExC,yCAAyC;YACzC,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CAAC,eAAe,IAAI,uCAAuC,CAAC,CAAC;YAC9E,CAAC;YAED,MAAM,WAAW,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;YAE5C,gDAAgD;YAChD,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"logIntoPorta.js","sourceRoot":"","sources":["../../../src/commands/logIntoPorta.ts"],"names":[],"mappings":";AAAA,iCAAiC;;;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AI,EAAE,YAAY,EAAE,2BAA2B,EAAE,CAAC,CAAC;wBACnF,IAAI,CAAC,WAAW,EAAE,CAAC;4BACjB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;wBAChE,CAAC;wBAED,wCAAwC;wBACxC,EAAE,CAAC,WAAW,CAAC;4BACb,MAAM,EAAE,UAAU;4BAClB,GAAG,EAAE,WAAW;4BAChB,IAAI,EAAE,IAAI;4BACV,cAAc,EAAE,IAAI;4BACpB,gBAAgB,EAAE,KAAK;4BACvB,OAAO,EAAE,WAAW;4BACpB,IAAI,EAAE,gBAAgB;yBACvB,CAAC,CAAC;oBACL,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace Cypress {
|
|
3
|
+
interface Chainable {
|
|
4
|
+
/**
|
|
5
|
+
* Send an HTTP request. For full documentation,
|
|
6
|
+
* see {@link https://docs.cypress.io/api/commands/request}
|
|
7
|
+
* and scroll down to the "Options" section
|
|
8
|
+
* @author Yuen Ler Chow
|
|
9
|
+
* @param options object containing all arguments
|
|
10
|
+
* @param options.url the URL to send the request to (required)
|
|
11
|
+
* @param options.method the HTTP method to use (default: "GET")
|
|
12
|
+
* @param [options.body] the body to send with the request
|
|
13
|
+
* @param [options.headers] any additional headers to send with the request
|
|
14
|
+
* @return chainable response (same shape as `cy.request`)
|
|
15
|
+
*/
|
|
16
|
+
sendRequest(options: Partial<Cypress.RequestOptions> & {
|
|
17
|
+
url: string;
|
|
18
|
+
}): Chainable<Cypress.Response<any>>;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
declare const sendRequest: () => void;
|
|
23
|
+
export default sendRequest;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/// <reference types="cypress" />
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
/**
|
|
8
|
+
* Wraps `cy.request` to handle two Cypress-on-WebKit (Playwright) cookie bugs:
|
|
9
|
+
*
|
|
10
|
+
* 1. **Outbound cookies are dropped.** WebKit's `cy.request` stores
|
|
11
|
+
* `Set-Cookie` responses in the jar but does NOT auto-attach them
|
|
12
|
+
* to subsequent `cy.request` calls. We work around this by reading
|
|
13
|
+
* the jar before the request and explicitly setting the `Cookie`
|
|
14
|
+
* header.
|
|
15
|
+
*
|
|
16
|
+
* 2. **Domain cookies are downgraded to host-only.** When a response
|
|
17
|
+
* sets a cookie with `Domain=example.com`, WebKit stores it as a
|
|
18
|
+
* host-only cookie on `example.com` instead of a domain cookie on
|
|
19
|
+
* `.example.com`, so it is never sent to subdomains. We work
|
|
20
|
+
* around this by parsing the `Set-Cookie` headers from the
|
|
21
|
+
* response (and any redirect hops) with `set-cookie-parser` and
|
|
22
|
+
* re-planting any cookie that had an explicit `Domain=` attribute
|
|
23
|
+
* as a leading-dot domain cookie via `cy.setCookie`.
|
|
24
|
+
*
|
|
25
|
+
* On Chrome and other browsers, both workarounds are effectively no-ops, so this is safe
|
|
26
|
+
* to use everywhere.
|
|
27
|
+
*/
|
|
28
|
+
const set_cookie_parser_1 = __importDefault(require("set-cookie-parser"));
|
|
29
|
+
/*----------------------------------------*/
|
|
30
|
+
/* -------------- Helpers -------------- */
|
|
31
|
+
/*----------------------------------------*/
|
|
32
|
+
/**
|
|
33
|
+
* Build a `Cookie:` request header value from Cypress's cookie jar for the
|
|
34
|
+
* given URL's host. Skips RFC 6265 path matching since virtually no real
|
|
35
|
+
* server cares about cookie path scoping on incoming requests.
|
|
36
|
+
*
|
|
37
|
+
* @param url full request URL whose host drives cookie selection
|
|
38
|
+
* @return chainable cookie header string ("" if no cookies stored for the host)
|
|
39
|
+
*/
|
|
40
|
+
const buildCookieHeader = (url) => {
|
|
41
|
+
const host = new URL(url).hostname;
|
|
42
|
+
return cy.getCookies({ domain: host }).then((cookies) => {
|
|
43
|
+
return cy.wrap(cookies.map((c) => { return `${c.name}=${c.value}`; }).join('; '), { log: false });
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Walk the response (plus all redirect hops) and re-plant any cookie whose
|
|
48
|
+
* `Set-Cookie` carried an explicit `Domain=` attribute as a domain cookie
|
|
49
|
+
* with a leading dot. Fixes WebKit's "domain cookie downgraded to host-only"
|
|
50
|
+
* bug. Cookies without an explicit `Domain=` attribute are left alone.
|
|
51
|
+
*
|
|
52
|
+
* @param response the response yielded by `cy.request`
|
|
53
|
+
*/
|
|
54
|
+
const replantDomainCookies = (response) => {
|
|
55
|
+
var _a;
|
|
56
|
+
const redirectHops = (_a = response.allRequestResponses) !== null && _a !== void 0 ? _a : [{ 'Response Headers': response.headers }];
|
|
57
|
+
redirectHops.forEach((redirectHop) => {
|
|
58
|
+
var _a;
|
|
59
|
+
const setCookieHeader = (_a = redirectHop['Response Headers']) === null || _a === void 0 ? void 0 : _a['set-cookie'];
|
|
60
|
+
if (!setCookieHeader)
|
|
61
|
+
return;
|
|
62
|
+
set_cookie_parser_1.default.parse(setCookieHeader, { decodeValues: false }).forEach((cookie) => {
|
|
63
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64
|
+
// Only re-plant cookies that explicitly declared a Domain attribute;
|
|
65
|
+
// host-only cookies (no Domain) must stay host-only.
|
|
66
|
+
if (!cookie.domain)
|
|
67
|
+
return;
|
|
68
|
+
// Translate HTTP-wire SameSite values into the strings cy.setCookie expects.
|
|
69
|
+
const sameSiteMap = {
|
|
70
|
+
lax: 'lax',
|
|
71
|
+
strict: 'strict',
|
|
72
|
+
none: 'no_restriction',
|
|
73
|
+
};
|
|
74
|
+
cy.setCookie(cookie.name, cookie.value, {
|
|
75
|
+
domain: cookie.domain.startsWith('.') ? cookie.domain : `.${cookie.domain}`,
|
|
76
|
+
path: (_a = cookie.path) !== null && _a !== void 0 ? _a : '/',
|
|
77
|
+
secure: (_b = cookie.secure) !== null && _b !== void 0 ? _b : false,
|
|
78
|
+
httpOnly: (_c = cookie.httpOnly) !== null && _c !== void 0 ? _c : false,
|
|
79
|
+
sameSite: (_f = sameSiteMap[(_e = (_d = cookie.sameSite) === null || _d === void 0 ? void 0 : _d.toLowerCase()) !== null && _e !== void 0 ? _e : '']) !== null && _f !== void 0 ? _f : 'lax',
|
|
80
|
+
log: false,
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
/*----------------------------------------*/
|
|
86
|
+
/* --------------- Command -------------- */
|
|
87
|
+
/*----------------------------------------*/
|
|
88
|
+
const sendRequest = () => {
|
|
89
|
+
Cypress.Commands.add('sendRequest', (options) => {
|
|
90
|
+
return buildCookieHeader(options.url).then((cookieHeader) => {
|
|
91
|
+
var _a;
|
|
92
|
+
const mergedHeaders = Object.assign(Object.assign({}, ((_a = options.headers) !== null && _a !== void 0 ? _a : {})), (cookieHeader ? { cookie: cookieHeader } : {}));
|
|
93
|
+
return cy.request(Object.assign(Object.assign({}, options), { headers: mergedHeaders })).then((response) => {
|
|
94
|
+
replantDomainCookies(response);
|
|
95
|
+
return cy.wrap(response, { log: false });
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
/*----------------------------------------*/
|
|
101
|
+
/* --------------- Export --------------- */
|
|
102
|
+
/*----------------------------------------*/
|
|
103
|
+
exports.default = sendRequest;
|
|
104
|
+
//# sourceMappingURL=sendRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendRequest.js","sourceRoot":"","sources":["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CAClD,CAAC;YACF,OAAO,EAAE,CAAC,OAAO,iCACZ,OAAO,KACV,OAAO,EAAE,aAAa,IACtB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACnB,oBAAoB,CAAC,QAAQ,CAAC,CAAC;gBAC/B,OAAO,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,WAAW,CAAC"}
|
|
@@ -15,11 +15,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
/* eslint-disable no-console */
|
|
16
16
|
const fs_1 = __importDefault(require("fs"));
|
|
17
17
|
const path_1 = __importDefault(require("path"));
|
|
18
|
+
const clear_1 = __importDefault(require("clear"));
|
|
18
19
|
// Import helpers
|
|
19
20
|
const runCypressHeadless_1 = __importDefault(require("./runCypressHeadless"));
|
|
20
21
|
const getDateLabeledDir_1 = __importDefault(require("./getDateLabeledDir"));
|
|
21
22
|
const generateReportHomepage_1 = __importDefault(require("./generateReportHomepage"));
|
|
22
23
|
const mergeAllReportsAndGenerateHtml_1 = __importDefault(require("./mergeAllReportsAndGenerateHtml"));
|
|
24
|
+
const print_1 = __importDefault(require("./print"));
|
|
23
25
|
/**
|
|
24
26
|
* Execute all headless Cypress test combinations in parallel
|
|
25
27
|
* @author Yuen Ler Chow
|
|
@@ -70,16 +72,29 @@ const executeAllHeadlessCombinations = (opts) => __awaiter(void 0, void 0, void
|
|
|
70
72
|
};
|
|
71
73
|
});
|
|
72
74
|
(0, generateReportHomepage_1.default)(reportInfos, outputDir);
|
|
73
|
-
// Print
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
// Print if combos failed
|
|
76
|
+
const failedCombos = results.filter((r) => { return !r.success; });
|
|
77
|
+
if (failedCombos.length > 0) {
|
|
78
|
+
(0, clear_1.default)();
|
|
79
|
+
print_1.default.title('⚠️ Some combos failed to run');
|
|
80
|
+
console.log('');
|
|
81
|
+
console.log('The following combos failed to run:');
|
|
82
|
+
failedCombos.forEach((combo) => {
|
|
83
|
+
console.log(`- Profile: ${combo.profileName}, Browser: ${combo.browser}`);
|
|
84
|
+
});
|
|
85
|
+
console.log('\nPlease check the individual report files for details.');
|
|
86
|
+
print_1.default.enterToContinue();
|
|
87
|
+
}
|
|
88
|
+
// Clear and print title
|
|
89
|
+
(0, clear_1.default)();
|
|
90
|
+
print_1.default.title('Testing Finished');
|
|
91
|
+
console.log('');
|
|
92
|
+
console.log('Open the report (cmd + double click) the link below:');
|
|
93
|
+
console.log(`file://${path_1.default.join(outputDir, 'index.html')}`);
|
|
94
|
+
console.log('');
|
|
95
|
+
console.log('Save and share the report by zipping and sharing this folder:');
|
|
96
|
+
console.log(outputDir);
|
|
97
|
+
process.exit(0);
|
|
83
98
|
});
|
|
84
99
|
exports.default = executeAllHeadlessCombinations;
|
|
85
100
|
//# sourceMappingURL=executeAllHeadlessCombinations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeAllHeadlessCombinations.js","sourceRoot":"","sources":["../../../start/helpers/executeAllHeadlessCombinations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+BAA+B;AAC/B,4CAAoB;AACpB,gDAAwB;
|
|
1
|
+
{"version":3,"file":"executeAllHeadlessCombinations.js","sourceRoot":"","sources":["../../../start/helpers/executeAllHeadlessCombinations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+BAA+B;AAC/B,4CAAoB;AACpB,gDAAwB;AACxB,kDAA0B;AAE1B,iBAAiB;AACjB,8EAAsD;AACtD,4EAAoD;AACpD,sFAA8D;AAC9D,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CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,UAAU,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,kBAAe,8BAA8B,CAAC"}
|
|
@@ -86,8 +86,12 @@ const generateReportHomepage = (reports, outputDir) => {
|
|
|
86
86
|
screenshots.push({ href, name: rel });
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
+
const allTestsPassed = (typeof report.totalTests === 'number'
|
|
90
|
+
&& typeof report.passedTests === 'number'
|
|
91
|
+
&& report.passedTests === report.totalTests);
|
|
89
92
|
return Object.assign(Object.assign({}, report), { relativeReportPath,
|
|
90
|
-
screenshots
|
|
93
|
+
screenshots,
|
|
94
|
+
allTestsPassed });
|
|
91
95
|
});
|
|
92
96
|
// Group by profile
|
|
93
97
|
const reportsByProfile = {};
|
|
@@ -98,9 +102,9 @@ const generateReportHomepage = (reports, outputDir) => {
|
|
|
98
102
|
reportsByProfile[report.profileName].push(report);
|
|
99
103
|
});
|
|
100
104
|
// Calculate summary stats
|
|
101
|
-
const totalRuns =
|
|
102
|
-
const passedRuns =
|
|
103
|
-
const failedRuns =
|
|
105
|
+
const totalRuns = templateReports.length;
|
|
106
|
+
const passedRuns = templateReports.filter((r) => { return r.allTestsPassed; }).length;
|
|
107
|
+
const failedRuns = totalRuns - passedRuns;
|
|
104
108
|
const profileCount = Object.keys(reportsByProfile).length;
|
|
105
109
|
// Load and render EJS template
|
|
106
110
|
const templatePath = path_1.default.join(__dirname, 'reportHomepage.ejs');
|
|
@@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cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;IAChE,MAAM,YAAY,GAAG,YAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC5D,MAAM,IAAI,GAAG,aAAG,CAAC,MAAM,CAAC,YAAY,EAAE;QACpC,iBAAiB;QACjB,kBAAkB;QAClB,mBAAmB;QACnB,SAAS;QACT,UAAU;QACV,UAAU;QACV,YAAY;QACZ,gBAAgB;KACjB,CAAC,CAAC;IAEH,sBAAsB;IACtB,YAAE,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,mCAAmC,YAAY,EAAE,CAAC,CAAC;AACjE,CAAC,CAAC;AAEF,kBAAe,sBAAsB,CAAC"}
|
|
@@ -179,10 +179,20 @@
|
|
|
179
179
|
background: #115293;
|
|
180
180
|
border-color: #115293;
|
|
181
181
|
}
|
|
182
|
+
.screenshots-header {
|
|
183
|
+
margin-top: 0.875rem;
|
|
184
|
+
font-weight: 600;
|
|
185
|
+
}
|
|
182
186
|
.screenshot-list {
|
|
183
|
-
|
|
184
|
-
padding-
|
|
185
|
-
|
|
187
|
+
padding-left: 1.25rem;
|
|
188
|
+
padding-right: 0.5rem;
|
|
189
|
+
}
|
|
190
|
+
.screenshot-list li {
|
|
191
|
+
padding-bottom: 0.5rem;
|
|
192
|
+
overflow-wrap: anywhere;
|
|
193
|
+
}
|
|
194
|
+
.screenshot-list a {
|
|
195
|
+
color: #1976d2;
|
|
186
196
|
}
|
|
187
197
|
.no-report {
|
|
188
198
|
color: #999;
|
|
@@ -240,10 +250,10 @@
|
|
|
240
250
|
<h2 class="profile-title">📋 Profile: <%= profileName %></h2>
|
|
241
251
|
<div class="report-grid">
|
|
242
252
|
<% profileReports.forEach((report) => { %>
|
|
243
|
-
<div class="report-card <%= report.
|
|
253
|
+
<div class="report-card <%= report.allTestsPassed ? 'success' : 'failed' %>">
|
|
244
254
|
<div class="browser-name">🌐 <%= report.browser %></div>
|
|
245
|
-
<span class="status <%= report.
|
|
246
|
-
<%= report.
|
|
255
|
+
<span class="status <%= report.allTestsPassed ? 'success' : 'failed' %>">
|
|
256
|
+
<%= report.allTestsPassed ? 'Passed' : 'Failed' %>
|
|
247
257
|
</span>
|
|
248
258
|
<% if (report.totalTests !== undefined && report.passedTests !== undefined) { %>
|
|
249
259
|
<div class="timestamp"><%= report.passedTests %>/<%= report.totalTests %> tests passing</div>
|
|
@@ -255,9 +265,10 @@
|
|
|
255
265
|
<p class="no-report">Report not available</p>
|
|
256
266
|
<% } %>
|
|
257
267
|
<% if (report.screenshots && report.screenshots.length > 0) { %>
|
|
268
|
+
<div class="screenshots-header">📸 Screenshots from failed tests</div>
|
|
258
269
|
<ul class="screenshot-list">
|
|
259
270
|
<% report.screenshots.forEach((screenshot) => { %>
|
|
260
|
-
<li><a href="<%= screenshot.href %>"
|
|
271
|
+
<li><a href="<%= screenshot.href %>" target="_blank"><%= screenshot.name %></a></li>
|
|
261
272
|
<% }) %>
|
|
262
273
|
</ul>
|
|
263
274
|
<% } %>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runCypressHeadless.js","sourceRoot":"","sources":["../../../start/helpers/runCypressHeadless.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;;;AAE/B,cAAc;AACd,iDAAsC;AACtC,gDAAwB;AACxB,4CAAoB;AAEpB,iBAAiB;AACjB,gEAAwC;AACxC,sFAA8D;AAC9D,kEAA0C;AAC1C,8EAAsD;AAKtD,mBAAmB;AACnB,uGAA+E;AAE/E;;;;;;;;;GASG;AACH,MAAM,kBAAkB,GAAG,CAAC,IAK3B,EAAsB,EAAE;IACvB,MAAM,EACJ,WAAW,EACX,OAAO,EACP,SAAS,EACT,UAAU,GAAG,mCAAyB,GACvC,GAAG,IAAI,CAAC;IAET,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC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GAAG,cAAI,CAAC,IAAI,CAC1B,SAAS,EACT,GAAG,WAAW,IAAI,OAAO,EAAE,EAC3B,QAAQ,EACR,kBAAkB,CACnB,CAAC;YAEF,MAAM,MAAM,GAAc;gBACxB,WAAW;gBACX,OAAO;gBACP,OAAO,EAAE,OAAO,IAAI,eAAe;gBACnC,SAAS,EAAE,QAAQ;gBACnB,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;aACrD,CAAC;YAEF,IAAI,OAAO,IAAI,eAAe,EAAE,CAAC;gBAC/B,OAAO,CAAC,GAAG,CAAC,kBAAkB,WAAW,MAAM,OAAO,EAAE,CAAC,CAAC;YAC5D,CAAC;iBAAM,IAAI,CAAC,eAAe,EAAE,CAAC;gBAC5B,OAAO,CAAC,GAAG,CAAC,gDAAgD,WAAW,MAAM,OAAO,EAAE,CAAC,CAAC;YAC1F,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,eAAe,WAAW,MAAM,OAAO,gBAAgB,IAAI,GAAG,CAAC,CAAC;YAC9E,CAAC;YAED,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACnC,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
|
package/lib/start/index.js
CHANGED
|
@@ -115,15 +115,39 @@ if (isHeadless && selectedBrowsers.length === 0) {
|
|
|
115
115
|
description: name,
|
|
116
116
|
};
|
|
117
117
|
});
|
|
118
|
+
// Add "All" option if there are multiple browsers
|
|
119
|
+
if (choosableBrowsers.length > 1) {
|
|
120
|
+
options.unshift({
|
|
121
|
+
tag: 'A',
|
|
122
|
+
description: 'All browsers',
|
|
123
|
+
});
|
|
124
|
+
}
|
|
118
125
|
const choices = (0, showChooser_1.default)({
|
|
119
126
|
question: 'Choose browser(s) (commas for multiple: C,F)',
|
|
120
127
|
options,
|
|
121
|
-
title: 'Select
|
|
128
|
+
title: 'Select Browser(s)',
|
|
122
129
|
allowMulti: true,
|
|
123
130
|
});
|
|
124
|
-
|
|
125
|
-
return
|
|
131
|
+
const allBrowsersChosen = choices.some((choice) => {
|
|
132
|
+
return choice.tag === 'A';
|
|
126
133
|
});
|
|
134
|
+
if (allBrowsersChosen) {
|
|
135
|
+
selectedBrowsers = choosableBrowsers.map((b) => {
|
|
136
|
+
return b.name;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
selectedBrowsers = (choices
|
|
141
|
+
.map((choice) => {
|
|
142
|
+
if (choice.index === undefined) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
return choosableBrowsers[choice.index].name;
|
|
146
|
+
})
|
|
147
|
+
.filter((name) => {
|
|
148
|
+
return name !== null;
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
127
151
|
}
|
|
128
152
|
// If no profiles were selected, ask the user to choose
|
|
129
153
|
// - In headless mode, allow selecting multiple profiles
|
|
@@ -141,6 +165,13 @@ if (selectedProfiles.length === 0
|
|
|
141
165
|
description: p.profileName,
|
|
142
166
|
};
|
|
143
167
|
});
|
|
168
|
+
// If there are multiple profiles, add an "All" option for headless mode
|
|
169
|
+
if (isHeadless && choosableProfiles.length > 1) {
|
|
170
|
+
options.unshift({
|
|
171
|
+
tag: 'A',
|
|
172
|
+
description: 'All profiles',
|
|
173
|
+
});
|
|
174
|
+
}
|
|
144
175
|
const choices = (0, showChooser_1.default)({
|
|
145
176
|
question: (isHeadless
|
|
146
177
|
? 'Choose profile(s) (commas for multiple: 1,2):'
|
|
@@ -149,7 +180,24 @@ if (selectedProfiles.length === 0
|
|
|
149
180
|
title: `Choose profile${isHeadless ? 's' : ''}`,
|
|
150
181
|
allowMulti: isHeadless,
|
|
151
182
|
});
|
|
152
|
-
|
|
183
|
+
const allProfilesChosen = choices.some((choice) => {
|
|
184
|
+
return choice.tag === 'A';
|
|
185
|
+
});
|
|
186
|
+
if (allProfilesChosen) {
|
|
187
|
+
selectedProfiles = choosableProfiles;
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
selectedProfiles = (choices
|
|
191
|
+
.map((choice) => {
|
|
192
|
+
if (choice.index === undefined) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
return choosableProfiles[choice.index];
|
|
196
|
+
})
|
|
197
|
+
.filter((profile) => {
|
|
198
|
+
return profile !== null;
|
|
199
|
+
}));
|
|
200
|
+
}
|
|
153
201
|
}
|
|
154
202
|
// Execute Cypress with selected configuration
|
|
155
203
|
(0, executeCypress_1.default)({
|
package/lib/start/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../start/index.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B;;;;;GAKG;;;;;AAEH,cAAc;AACd,4CAAoB;AACpB,gDAAwB;AAExB,iBAAiB;AACjB,wEAAgD;AAChD,wFAAgE;AAChE,wFAAgE;AAChE,kFAA0D;AAC1D,gFAAwD;AACxD,wEAAgD;AAChD,8EAAsD;AACtD,0HAAkG;AAElG,mBAAmB;AACnB,sGAA8E;AAE9E,4BAA4B;AAC5B,MAAM,GAAG,GAAG,IAAA,qBAAW,GAAE,CAAC;AAE1B,kDAAkD;AAClD,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;AACvD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;IAChC,OAAO,CAAC,IAAI,CAAC,4CAA4C,WAAW,GAAG,CAAC,CAAC;IACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,gEAAgE;AAChE,MAAM,YAAY,GAAG,CACnB,YAAE;KACC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AK,GAAG,CAAC;IAC5B,CAAC,CAAC,CAAC;IACH,IAAI,iBAAiB,EAAE,CAAC;QACtB,gBAAgB,GAAG,iBAAiB,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,gBAAgB,GAAG,CACjB,OAAO;aACJ,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACd,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC/B,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;YAClB,OAAO,OAAO,KAAK,IAAI,CAAC;QAC1B,CAAC,CAAC,CACL,CAAC;IACJ,CAAC;AACH,CAAC;AAED,8CAA8C;AAC9C,IAAA,wBAAc,EAAC;IACb,gBAAgB;IAChB,gBAAgB;IAChB,UAAU;IACV,eAAe;CAChB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dceky",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "Cypress toolkit for Harvard DCE",
|
|
5
5
|
"main": "./lib/src/index.js",
|
|
6
6
|
"types": "./lib/src/index.d.ts",
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"cypress-iframe": "^1.0.1",
|
|
38
38
|
"deepmerge": "4.3.1",
|
|
39
39
|
"ejs": "^3.1.10",
|
|
40
|
-
"prompt-sync": "^4.2.0"
|
|
40
|
+
"prompt-sync": "^4.2.0",
|
|
41
|
+
"set-cookie-parser": "^3.1.0"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@types/deepmerge": "2.1.0",
|
package/src/commands/getId.ts
CHANGED
package/src/commands/launchAs.ts
CHANGED
|
@@ -157,7 +157,7 @@ const launchAs = () => {
|
|
|
157
157
|
|
|
158
158
|
// Launch via the sessionless launch URL
|
|
159
159
|
const launchURL = sessionlessLaunchInfo.url;
|
|
160
|
-
cy.
|
|
160
|
+
cy.sendRequest({ url: launchURL }).then((response) => {
|
|
161
161
|
const { action, fields } = getFormData({ html: response.body });
|
|
162
162
|
cy.visit({
|
|
163
163
|
url: action,
|
|
@@ -69,7 +69,7 @@ const logIntoPorta = () => {
|
|
|
69
69
|
const htmlHeaders = { accept: 'text/html' };
|
|
70
70
|
|
|
71
71
|
// Request 1: GET Cirrus Identity discovery page
|
|
72
|
-
cy.
|
|
72
|
+
cy.sendRequest({
|
|
73
73
|
url: LOGIN_PAGE,
|
|
74
74
|
followRedirect: true,
|
|
75
75
|
failOnStatusCode: false,
|
|
@@ -86,7 +86,7 @@ const logIntoPorta = () => {
|
|
|
86
86
|
const idpUrl = `${IDP_BASE_URL}${btnMatch[1]}`;
|
|
87
87
|
|
|
88
88
|
// Request 2: GET HarvardKey IdP login page
|
|
89
|
-
cy.
|
|
89
|
+
cy.sendRequest({
|
|
90
90
|
url: idpUrl,
|
|
91
91
|
followRedirect: true,
|
|
92
92
|
failOnStatusCode: false,
|
|
@@ -103,7 +103,7 @@ const logIntoPorta = () => {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
// Request 3: POST credentials to HarvardKey login form
|
|
106
|
-
cy.
|
|
106
|
+
cy.sendRequest({
|
|
107
107
|
method: loginMethod,
|
|
108
108
|
url: loginFormUrl,
|
|
109
109
|
form: true,
|
|
@@ -127,7 +127,7 @@ const logIntoPorta = () => {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
// Request 4: POST SAML assertion to ACS
|
|
130
|
-
|
|
130
|
+
cy.sendRequest({
|
|
131
131
|
method: samlMethod,
|
|
132
132
|
url: samlFormUrl,
|
|
133
133
|
form: true,
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/// <reference types="cypress" />
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Wraps `cy.request` to handle two Cypress-on-WebKit (Playwright) cookie bugs:
|
|
5
|
+
*
|
|
6
|
+
* 1. **Outbound cookies are dropped.** WebKit's `cy.request` stores
|
|
7
|
+
* `Set-Cookie` responses in the jar but does NOT auto-attach them
|
|
8
|
+
* to subsequent `cy.request` calls. We work around this by reading
|
|
9
|
+
* the jar before the request and explicitly setting the `Cookie`
|
|
10
|
+
* header.
|
|
11
|
+
*
|
|
12
|
+
* 2. **Domain cookies are downgraded to host-only.** When a response
|
|
13
|
+
* sets a cookie with `Domain=example.com`, WebKit stores it as a
|
|
14
|
+
* host-only cookie on `example.com` instead of a domain cookie on
|
|
15
|
+
* `.example.com`, so it is never sent to subdomains. We work
|
|
16
|
+
* around this by parsing the `Set-Cookie` headers from the
|
|
17
|
+
* response (and any redirect hops) with `set-cookie-parser` and
|
|
18
|
+
* re-planting any cookie that had an explicit `Domain=` attribute
|
|
19
|
+
* as a leading-dot domain cookie via `cy.setCookie`.
|
|
20
|
+
*
|
|
21
|
+
* On Chrome and other browsers, both workarounds are effectively no-ops, so this is safe
|
|
22
|
+
* to use everywhere.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import setCookieParser from 'set-cookie-parser';
|
|
26
|
+
|
|
27
|
+
/*----------------------------------------*/
|
|
28
|
+
/* ---------------- Type ---------------- */
|
|
29
|
+
/*----------------------------------------*/
|
|
30
|
+
|
|
31
|
+
declare global {
|
|
32
|
+
namespace Cypress {
|
|
33
|
+
interface Chainable {
|
|
34
|
+
/**
|
|
35
|
+
* Send an HTTP request. For full documentation,
|
|
36
|
+
* see {@link https://docs.cypress.io/api/commands/request}
|
|
37
|
+
* and scroll down to the "Options" section
|
|
38
|
+
* @author Yuen Ler Chow
|
|
39
|
+
* @param options object containing all arguments
|
|
40
|
+
* @param options.url the URL to send the request to (required)
|
|
41
|
+
* @param options.method the HTTP method to use (default: "GET")
|
|
42
|
+
* @param [options.body] the body to send with the request
|
|
43
|
+
* @param [options.headers] any additional headers to send with the request
|
|
44
|
+
* @return chainable response (same shape as `cy.request`)
|
|
45
|
+
*/
|
|
46
|
+
sendRequest(
|
|
47
|
+
options: Partial<Cypress.RequestOptions> & { url: string },
|
|
48
|
+
): Chainable<Cypress.Response<any>>;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/*----------------------------------------*/
|
|
54
|
+
/* -------------- Helpers -------------- */
|
|
55
|
+
/*----------------------------------------*/
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Build a `Cookie:` request header value from Cypress's cookie jar for the
|
|
59
|
+
* given URL's host. Skips RFC 6265 path matching since virtually no real
|
|
60
|
+
* server cares about cookie path scoping on incoming requests.
|
|
61
|
+
*
|
|
62
|
+
* @param url full request URL whose host drives cookie selection
|
|
63
|
+
* @return chainable cookie header string ("" if no cookies stored for the host)
|
|
64
|
+
*/
|
|
65
|
+
const buildCookieHeader = (url: string): Cypress.Chainable<string> => {
|
|
66
|
+
const host = new URL(url).hostname;
|
|
67
|
+
return cy.getCookies({ domain: host }).then((cookies) => {
|
|
68
|
+
return cy.wrap(
|
|
69
|
+
cookies.map((c) => { return `${c.name}=${c.value}`; }).join('; '),
|
|
70
|
+
{ log: false },
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Walk the response (plus all redirect hops) and re-plant any cookie whose
|
|
77
|
+
* `Set-Cookie` carried an explicit `Domain=` attribute as a domain cookie
|
|
78
|
+
* with a leading dot. Fixes WebKit's "domain cookie downgraded to host-only"
|
|
79
|
+
* bug. Cookies without an explicit `Domain=` attribute are left alone.
|
|
80
|
+
*
|
|
81
|
+
* @param response the response yielded by `cy.request`
|
|
82
|
+
*/
|
|
83
|
+
const replantDomainCookies = (response: Cypress.Response<any>) => {
|
|
84
|
+
const redirectHops = response.allRequestResponses ?? [{ 'Response Headers': response.headers }];
|
|
85
|
+
redirectHops.forEach((redirectHop) => {
|
|
86
|
+
const setCookieHeader = (redirectHop as any)['Response Headers']?.['set-cookie'];
|
|
87
|
+
if (!setCookieHeader) return;
|
|
88
|
+
setCookieParser.parse(setCookieHeader, { decodeValues: false }).forEach((cookie) => {
|
|
89
|
+
// Only re-plant cookies that explicitly declared a Domain attribute;
|
|
90
|
+
// host-only cookies (no Domain) must stay host-only.
|
|
91
|
+
if (!cookie.domain) return;
|
|
92
|
+
// Translate HTTP-wire SameSite values into the strings cy.setCookie expects.
|
|
93
|
+
const sameSiteMap: { [key: string]: 'lax' | 'strict' | 'no_restriction' } = {
|
|
94
|
+
lax: 'lax',
|
|
95
|
+
strict: 'strict',
|
|
96
|
+
none: 'no_restriction',
|
|
97
|
+
};
|
|
98
|
+
cy.setCookie(cookie.name, cookie.value, {
|
|
99
|
+
domain: cookie.domain.startsWith('.') ? cookie.domain : `.${cookie.domain}`,
|
|
100
|
+
path: cookie.path ?? '/',
|
|
101
|
+
secure: cookie.secure ?? false,
|
|
102
|
+
httpOnly: cookie.httpOnly ?? false,
|
|
103
|
+
sameSite: sameSiteMap[cookie.sameSite?.toLowerCase() ?? ''] ?? 'lax',
|
|
104
|
+
log: false,
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/*----------------------------------------*/
|
|
111
|
+
/* --------------- Command -------------- */
|
|
112
|
+
/*----------------------------------------*/
|
|
113
|
+
|
|
114
|
+
const sendRequest = () => {
|
|
115
|
+
Cypress.Commands.add(
|
|
116
|
+
'sendRequest',
|
|
117
|
+
(options) => {
|
|
118
|
+
return buildCookieHeader(options.url).then((cookieHeader) => {
|
|
119
|
+
const mergedHeaders = {
|
|
120
|
+
...(options.headers ?? {}),
|
|
121
|
+
...(cookieHeader ? { cookie: cookieHeader } : {}),
|
|
122
|
+
};
|
|
123
|
+
return cy.request({
|
|
124
|
+
...options,
|
|
125
|
+
headers: mergedHeaders,
|
|
126
|
+
}).then((response) => {
|
|
127
|
+
replantDomainCookies(response);
|
|
128
|
+
return cy.wrap(response, { log: false });
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
},
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/*----------------------------------------*/
|
|
136
|
+
/* --------------- Export --------------- */
|
|
137
|
+
/*----------------------------------------*/
|
|
138
|
+
|
|
139
|
+
export default sendRequest;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
|
+
import clear from 'clear';
|
|
4
5
|
|
|
5
6
|
// Import helpers
|
|
6
7
|
import runCypressHeadless from './runCypressHeadless';
|
|
7
8
|
import getDateLabeledDir from './getDateLabeledDir';
|
|
8
9
|
import generateReportHomepage from './generateReportHomepage';
|
|
9
10
|
import mergeAllReportsAndGenerateHtml from './mergeAllReportsAndGenerateHtml';
|
|
11
|
+
import print from './print';
|
|
10
12
|
|
|
11
13
|
// Import shared types
|
|
12
14
|
import Profile from '../types/Profile';
|
|
@@ -76,17 +78,30 @@ const executeAllHeadlessCombinations = async (
|
|
|
76
78
|
|
|
77
79
|
generateReportHomepage(reportInfos, outputDir);
|
|
78
80
|
|
|
79
|
-
// Print
|
|
80
|
-
const
|
|
81
|
-
|
|
81
|
+
// Print if combos failed
|
|
82
|
+
const failedCombos = results.filter((r) => { return !r.success; });
|
|
83
|
+
if (failedCombos.length > 0) {
|
|
84
|
+
clear();
|
|
85
|
+
print.title('⚠️ Some combos failed to run');
|
|
86
|
+
console.log('');
|
|
87
|
+
console.log('The following combos failed to run:');
|
|
88
|
+
failedCombos.forEach((combo) => {
|
|
89
|
+
console.log(`- Profile: ${combo.profileName}, Browser: ${combo.browser}`);
|
|
90
|
+
});
|
|
91
|
+
console.log('\nPlease check the individual report files for details.');
|
|
92
|
+
print.enterToContinue();
|
|
93
|
+
}
|
|
82
94
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
console.log(
|
|
87
|
-
console.log(
|
|
88
|
-
console.log(`
|
|
89
|
-
console.log('
|
|
95
|
+
// Clear and print title
|
|
96
|
+
clear();
|
|
97
|
+
print.title('Testing Finished');
|
|
98
|
+
console.log('');
|
|
99
|
+
console.log('Open the report (cmd + double click) the link below:');
|
|
100
|
+
console.log(`file://${path.join(outputDir, 'index.html')}`);
|
|
101
|
+
console.log('');
|
|
102
|
+
console.log('Save and share the report by zipping and sharing this folder:');
|
|
103
|
+
console.log(outputDir);
|
|
104
|
+
process.exit(0);
|
|
90
105
|
};
|
|
91
106
|
|
|
92
107
|
export default executeAllHeadlessCombinations;
|
|
@@ -104,10 +104,17 @@ const generateReportHomepage = (
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
const allTestsPassed = (
|
|
108
|
+
typeof report.totalTests === 'number'
|
|
109
|
+
&& typeof report.passedTests === 'number'
|
|
110
|
+
&& report.passedTests === report.totalTests
|
|
111
|
+
);
|
|
112
|
+
|
|
107
113
|
return {
|
|
108
114
|
...report,
|
|
109
115
|
relativeReportPath,
|
|
110
116
|
screenshots,
|
|
117
|
+
allTestsPassed,
|
|
111
118
|
};
|
|
112
119
|
});
|
|
113
120
|
|
|
@@ -121,9 +128,9 @@ const generateReportHomepage = (
|
|
|
121
128
|
});
|
|
122
129
|
|
|
123
130
|
// Calculate summary stats
|
|
124
|
-
const totalRuns =
|
|
125
|
-
const passedRuns =
|
|
126
|
-
const failedRuns =
|
|
131
|
+
const totalRuns = templateReports.length;
|
|
132
|
+
const passedRuns = templateReports.filter((r) => { return r.allTestsPassed; }).length;
|
|
133
|
+
const failedRuns = totalRuns - passedRuns;
|
|
127
134
|
const profileCount = Object.keys(reportsByProfile).length;
|
|
128
135
|
|
|
129
136
|
// Load and render EJS template
|
|
@@ -179,10 +179,20 @@
|
|
|
179
179
|
background: #115293;
|
|
180
180
|
border-color: #115293;
|
|
181
181
|
}
|
|
182
|
+
.screenshots-header {
|
|
183
|
+
margin-top: 0.875rem;
|
|
184
|
+
font-weight: 600;
|
|
185
|
+
}
|
|
182
186
|
.screenshot-list {
|
|
183
|
-
|
|
184
|
-
padding-
|
|
185
|
-
|
|
187
|
+
padding-left: 1.25rem;
|
|
188
|
+
padding-right: 0.5rem;
|
|
189
|
+
}
|
|
190
|
+
.screenshot-list li {
|
|
191
|
+
padding-bottom: 0.5rem;
|
|
192
|
+
overflow-wrap: anywhere;
|
|
193
|
+
}
|
|
194
|
+
.screenshot-list a {
|
|
195
|
+
color: #1976d2;
|
|
186
196
|
}
|
|
187
197
|
.no-report {
|
|
188
198
|
color: #999;
|
|
@@ -240,10 +250,10 @@
|
|
|
240
250
|
<h2 class="profile-title">📋 Profile: <%= profileName %></h2>
|
|
241
251
|
<div class="report-grid">
|
|
242
252
|
<% profileReports.forEach((report) => { %>
|
|
243
|
-
<div class="report-card <%= report.
|
|
253
|
+
<div class="report-card <%= report.allTestsPassed ? 'success' : 'failed' %>">
|
|
244
254
|
<div class="browser-name">🌐 <%= report.browser %></div>
|
|
245
|
-
<span class="status <%= report.
|
|
246
|
-
<%= report.
|
|
255
|
+
<span class="status <%= report.allTestsPassed ? 'success' : 'failed' %>">
|
|
256
|
+
<%= report.allTestsPassed ? 'Passed' : 'Failed' %>
|
|
247
257
|
</span>
|
|
248
258
|
<% if (report.totalTests !== undefined && report.passedTests !== undefined) { %>
|
|
249
259
|
<div class="timestamp"><%= report.passedTests %>/<%= report.totalTests %> tests passing</div>
|
|
@@ -255,9 +265,10 @@
|
|
|
255
265
|
<p class="no-report">Report not available</p>
|
|
256
266
|
<% } %>
|
|
257
267
|
<% if (report.screenshots && report.screenshots.length > 0) { %>
|
|
268
|
+
<div class="screenshots-header">📸 Screenshots from failed tests</div>
|
|
258
269
|
<ul class="screenshot-list">
|
|
259
270
|
<% report.screenshots.forEach((screenshot) => { %>
|
|
260
|
-
<li><a href="<%= screenshot.href %>"
|
|
271
|
+
<li><a href="<%= screenshot.href %>" target="_blank"><%= screenshot.name %></a></li>
|
|
261
272
|
<% }) %>
|
|
262
273
|
</ul>
|
|
263
274
|
<% } %>
|
package/start/index.ts
CHANGED
|
@@ -131,16 +131,43 @@ if (isHeadless && selectedBrowsers.length === 0) {
|
|
|
131
131
|
};
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
+
// Add "All" option if there are multiple browsers
|
|
135
|
+
if (choosableBrowsers.length > 1) {
|
|
136
|
+
options.unshift({
|
|
137
|
+
tag: 'A',
|
|
138
|
+
description: 'All browsers',
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
134
142
|
const choices = showChooser({
|
|
135
143
|
question: 'Choose browser(s) (commas for multiple: C,F)',
|
|
136
144
|
options,
|
|
137
|
-
title: 'Select
|
|
145
|
+
title: 'Select Browser(s)',
|
|
138
146
|
allowMulti: true,
|
|
139
147
|
});
|
|
140
148
|
|
|
141
|
-
|
|
142
|
-
return
|
|
149
|
+
const allBrowsersChosen = choices.some((choice) => {
|
|
150
|
+
return choice.tag === 'A';
|
|
143
151
|
});
|
|
152
|
+
if (allBrowsersChosen) {
|
|
153
|
+
selectedBrowsers = choosableBrowsers.map((b) => {
|
|
154
|
+
return b.name;
|
|
155
|
+
});
|
|
156
|
+
} else {
|
|
157
|
+
selectedBrowsers = (
|
|
158
|
+
choices
|
|
159
|
+
.map((choice) => {
|
|
160
|
+
if (choice.index === undefined) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return choosableBrowsers[choice.index].name;
|
|
165
|
+
})
|
|
166
|
+
.filter((name) => {
|
|
167
|
+
return name !== null;
|
|
168
|
+
})
|
|
169
|
+
);
|
|
170
|
+
}
|
|
144
171
|
}
|
|
145
172
|
|
|
146
173
|
// If no profiles were selected, ask the user to choose
|
|
@@ -163,6 +190,14 @@ if (
|
|
|
163
190
|
};
|
|
164
191
|
});
|
|
165
192
|
|
|
193
|
+
// If there are multiple profiles, add an "All" option for headless mode
|
|
194
|
+
if (isHeadless && choosableProfiles.length > 1) {
|
|
195
|
+
options.unshift({
|
|
196
|
+
tag: 'A',
|
|
197
|
+
description: 'All profiles',
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
166
201
|
const choices = showChooser({
|
|
167
202
|
question: (
|
|
168
203
|
isHeadless
|
|
@@ -174,7 +209,25 @@ if (
|
|
|
174
209
|
allowMulti: isHeadless,
|
|
175
210
|
});
|
|
176
211
|
|
|
177
|
-
|
|
212
|
+
const allProfilesChosen = choices.some((choice) => {
|
|
213
|
+
return choice.tag === 'A';
|
|
214
|
+
});
|
|
215
|
+
if (allProfilesChosen) {
|
|
216
|
+
selectedProfiles = choosableProfiles;
|
|
217
|
+
} else {
|
|
218
|
+
selectedProfiles = (
|
|
219
|
+
choices
|
|
220
|
+
.map((choice) => {
|
|
221
|
+
if (choice.index === undefined) {
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
return choosableProfiles[choice.index];
|
|
225
|
+
})
|
|
226
|
+
.filter((profile) => {
|
|
227
|
+
return profile !== null;
|
|
228
|
+
})
|
|
229
|
+
);
|
|
230
|
+
}
|
|
178
231
|
}
|
|
179
232
|
|
|
180
233
|
// Execute Cypress with selected configuration
|
|
@@ -9,7 +9,8 @@ type ReportInfo = {
|
|
|
9
9
|
browser: string;
|
|
10
10
|
// Path to the generated HTML report file
|
|
11
11
|
reportPath: string;
|
|
12
|
-
// True if the
|
|
12
|
+
// True if the cypress-parallel process completed cleanly and the report was
|
|
13
|
+
// generated. This does NOT mean every test passed.
|
|
13
14
|
success: boolean;
|
|
14
15
|
// Human-readable timestamp of when the report was generated
|
|
15
16
|
timestamp: string;
|
|
@@ -11,6 +11,8 @@ type TemplateReportInfo = ReportInfo & {
|
|
|
11
11
|
relativeReportPath: string | null;
|
|
12
12
|
// List of screenshots captured during this test run
|
|
13
13
|
screenshots: ScreenshotInfo[];
|
|
14
|
+
// True if every test in the merged Mochawesome report passed
|
|
15
|
+
allTestsPassed: boolean;
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
export default TemplateReportInfo;
|