@siteimprove/alfa-cypress 0.78.1 → 0.79.0
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/CHANGELOG.md +16 -0
- package/dist/cypress.d.ts +2 -1
- package/dist/cypress.js +3 -2
- package/package.json +20 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @siteimprove/alfa-cypress
|
|
2
2
|
|
|
3
|
+
## 0.79.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **Added:** `.toPage`, `.toNode`, or `#scrape` now accept a `dom.Native.Options` parameter; currently to enforce anonymous cross-origin on `<link>` elements before scraping the page. CLI now accepts a `--enforce-anonymous-cross-origin` flag to enforce this behavior. ([#144](https://github.com/Siteimprove/alfa-integrations/pull/144))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- **Changed:** Update Alfa to 0.102.0. ([#146](https://github.com/Siteimprove/alfa-integrations/pull/146))
|
|
12
|
+
|
|
13
|
+
## 0.78.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- **Changed:** Update Alfa to ^0.101.0. ([#143](https://github.com/Siteimprove/alfa-integrations/pull/143))
|
|
18
|
+
|
|
3
19
|
## 0.78.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cypress.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { Hashable } from "@siteimprove/alfa-hash";
|
|
|
7
7
|
import type { Mapper } from "@siteimprove/alfa-mapper";
|
|
8
8
|
import { Page } from "@siteimprove/alfa-web";
|
|
9
9
|
import type * as act from "@siteimprove/alfa-act";
|
|
10
|
+
import * as dom from "@siteimprove/alfa-dom/native";
|
|
10
11
|
declare global {
|
|
11
12
|
namespace Chai {
|
|
12
13
|
interface Assertion {
|
|
@@ -26,7 +27,7 @@ declare global {
|
|
|
26
27
|
export declare namespace Cypress {
|
|
27
28
|
function createPlugin<T extends Hashable, Q extends Question.Metadata = {}, S = T>(rules: Iterable<act.Rule<Page, T, Q, S>>, handlers?: Iterable<Handler<Page, T, Q, S>>, options?: Asserter.Options<Page, T, Q, S>): globalThis.Chai.ChaiPlugin;
|
|
28
29
|
type Type = globalThis.Node | globalThis.JQuery;
|
|
29
|
-
function toPage(value: Type): Promise<Page>;
|
|
30
|
+
function toPage(value: Type, options?: dom.Native.Options): Promise<Page>;
|
|
30
31
|
namespace Handler {
|
|
31
32
|
/**
|
|
32
33
|
* @remarks
|
package/dist/cypress.js
CHANGED
|
@@ -38,11 +38,11 @@ export var Cypress;
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
Cypress.createPlugin = createPlugin;
|
|
41
|
-
async function toPage(value) {
|
|
41
|
+
async function toPage(value, options) {
|
|
42
42
|
if ("jquery" in value) {
|
|
43
43
|
value = value.get(0);
|
|
44
44
|
}
|
|
45
|
-
const nodeJSON = await dom.Native.fromNode(value);
|
|
45
|
+
const nodeJSON = await dom.Native.fromNode(value, options);
|
|
46
46
|
// This escapes shadow DOM, but not iframes!
|
|
47
47
|
const root = value.getRootNode({ composed: true });
|
|
48
48
|
// If the root is a document, we can get its window for building the
|
|
@@ -71,6 +71,7 @@ export var Cypress;
|
|
|
71
71
|
const request = Request.of("GET", url);
|
|
72
72
|
const response = Response.of(url, 200, Headers.of([Header.of("Content-Type", "text/html")]));
|
|
73
73
|
return Page.of(request, response, nodeJSON.type === "document"
|
|
74
|
+
// The type is ensured by the previous test.
|
|
74
75
|
? Document.from(nodeJSON, pageDevice)
|
|
75
76
|
: Document.of([Node.from(nodeJSON, pageDevice)]), pageDevice);
|
|
76
77
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json.schemastore.org/package",
|
|
3
3
|
"name": "@siteimprove/alfa-cypress",
|
|
4
4
|
"homepage": "https://alfa.siteimprove.com",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.79.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "Integrations and utilities for the Cypress testing framework",
|
|
8
8
|
"repository": {
|
|
@@ -25,28 +25,28 @@
|
|
|
25
25
|
"test": "cypress run"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@siteimprove/alfa-act": "^0.
|
|
29
|
-
"@siteimprove/alfa-assert": "^0.
|
|
30
|
-
"@siteimprove/alfa-device": "^0.
|
|
31
|
-
"@siteimprove/alfa-dom": "^0.
|
|
32
|
-
"@siteimprove/alfa-formatter": "^0.
|
|
33
|
-
"@siteimprove/alfa-formatter-earl": "^0.
|
|
34
|
-
"@siteimprove/alfa-hash": "^0.
|
|
35
|
-
"@siteimprove/alfa-http": "^0.
|
|
36
|
-
"@siteimprove/alfa-mapper": "^0.
|
|
37
|
-
"@siteimprove/alfa-url": "^0.
|
|
38
|
-
"@siteimprove/alfa-web": "^0.
|
|
28
|
+
"@siteimprove/alfa-act": "^0.102.0",
|
|
29
|
+
"@siteimprove/alfa-assert": "^0.79.0",
|
|
30
|
+
"@siteimprove/alfa-device": "^0.102.0",
|
|
31
|
+
"@siteimprove/alfa-dom": "^0.102.0",
|
|
32
|
+
"@siteimprove/alfa-formatter": "^0.79.0",
|
|
33
|
+
"@siteimprove/alfa-formatter-earl": "^0.79.0",
|
|
34
|
+
"@siteimprove/alfa-hash": "^0.102.0",
|
|
35
|
+
"@siteimprove/alfa-http": "^0.102.0",
|
|
36
|
+
"@siteimprove/alfa-mapper": "^0.102.0",
|
|
37
|
+
"@siteimprove/alfa-url": "^0.102.0",
|
|
38
|
+
"@siteimprove/alfa-web": "^0.102.0",
|
|
39
39
|
"cypress": "^14.0.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@siteimprove/alfa-act": "^0.
|
|
43
|
-
"@siteimprove/alfa-device": "^0.
|
|
44
|
-
"@siteimprove/alfa-dom": "^0.
|
|
45
|
-
"@siteimprove/alfa-hash": "^0.
|
|
46
|
-
"@siteimprove/alfa-http": "^0.
|
|
47
|
-
"@siteimprove/alfa-mapper": "^0.
|
|
48
|
-
"@siteimprove/alfa-url": "^0.
|
|
49
|
-
"@siteimprove/alfa-web": "^0.
|
|
42
|
+
"@siteimprove/alfa-act": "^0.102.0",
|
|
43
|
+
"@siteimprove/alfa-device": "^0.102.0",
|
|
44
|
+
"@siteimprove/alfa-dom": "^0.102.0",
|
|
45
|
+
"@siteimprove/alfa-hash": "^0.102.0",
|
|
46
|
+
"@siteimprove/alfa-http": "^0.102.0",
|
|
47
|
+
"@siteimprove/alfa-mapper": "^0.102.0",
|
|
48
|
+
"@siteimprove/alfa-url": "^0.102.0",
|
|
49
|
+
"@siteimprove/alfa-web": "^0.102.0",
|
|
50
50
|
"cypress": "^14.0.0"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|