@serenity-js/assertions 3.3.0 → 3.3.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.3.1](https://github.com/serenity-js/serenity-js/compare/v3.3.0...v3.3.1) (2023-06-08)
7
+
8
+ **Note:** Version bump only for package @serenity-js/assertions
9
+
10
+
11
+
12
+
13
+
6
14
  # [3.3.0](https://github.com/serenity-js/serenity-js/compare/v3.2.1...v3.3.0) (2023-06-01)
7
15
 
8
16
  **Note:** Version bump only for package @serenity-js/assertions
@@ -14,6 +14,25 @@ import { Expectation } from '@serenity-js/core';
14
14
  * )
15
15
  * ```
16
16
  *
17
+ * ## Ensuring that page URL includes the expected substring
18
+ *
19
+ * {@apilink Page.url|Page.current().url()} returns a {@apilink QuestionAdapter|`QuestionAdapter<URL>`},
20
+ * a proxy object around the standard Node.js [URL](https://nodejs.org/api/url.html) class,
21
+ * offering access to `string` properties such as [`hostname`](https://nodejs.org/api/url.html#urlobjecthostname),
22
+ * [`pathname`](https://nodejs.org/api/url.html#urlobjectpathname), and so on.
23
+ *
24
+ * ```ts
25
+ * import { actorCalled } from '@serenity-js/core'
26
+ * import { Ensure, includes } from '@serenity-js/assertions'
27
+ * import { Navigate, Page } from '@serenity-js/web'
28
+ *
29
+ * await actorCalled('Ester').attemptsTo(
30
+ * Navigate.to('https://serenity-js.org/handbook'),
31
+ * Ensure.that(Page.current().url().hostname, includes('serenity-js')),
32
+ * Ensure.that(Page.current().url().pathname, includes('book')),
33
+ * )
34
+ * ```
35
+ *
17
36
  * @param expected
18
37
  *
19
38
  * @group Expectations
@@ -1 +1 @@
1
- {"version":3,"file":"includes.d.ts","sourceRoot":"","sources":["../../src/expectations/includes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,QAAQ,mFAIpB,CAAC"}
1
+ {"version":3,"file":"includes.d.ts","sourceRoot":"","sources":["../../src/expectations/includes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,QAAQ,mFAIpB,CAAC"}
@@ -17,6 +17,25 @@ const core_1 = require("@serenity-js/core");
17
17
  * )
18
18
  * ```
19
19
  *
20
+ * ## Ensuring that page URL includes the expected substring
21
+ *
22
+ * {@apilink Page.url|Page.current().url()} returns a {@apilink QuestionAdapter|`QuestionAdapter<URL>`},
23
+ * a proxy object around the standard Node.js [URL](https://nodejs.org/api/url.html) class,
24
+ * offering access to `string` properties such as [`hostname`](https://nodejs.org/api/url.html#urlobjecthostname),
25
+ * [`pathname`](https://nodejs.org/api/url.html#urlobjectpathname), and so on.
26
+ *
27
+ * ```ts
28
+ * import { actorCalled } from '@serenity-js/core'
29
+ * import { Ensure, includes } from '@serenity-js/assertions'
30
+ * import { Navigate, Page } from '@serenity-js/web'
31
+ *
32
+ * await actorCalled('Ester').attemptsTo(
33
+ * Navigate.to('https://serenity-js.org/handbook'),
34
+ * Ensure.that(Page.current().url().hostname, includes('serenity-js')),
35
+ * Ensure.that(Page.current().url().pathname, includes('book')),
36
+ * )
37
+ * ```
38
+ *
20
39
  * @param expected
21
40
  *
22
41
  * @group Expectations
@@ -1 +1 @@
1
- {"version":3,"file":"includes.js","sourceRoot":"","sources":["../../src/expectations/includes.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,QAAQ,GAAG,kBAAW,CAAC,MAAM,CACtC,UAAU,EAAE,SAAS,EACrB,CAAC,MAAc,EAAE,QAAgB,EAAE,EAAE,CACjC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAChC,CAAC"}
1
+ {"version":3,"file":"includes.js","sourceRoot":"","sources":["../../src/expectations/includes.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACU,QAAA,QAAQ,GAAG,kBAAW,CAAC,MAAM,CACtC,UAAU,EAAE,SAAS,EACrB,CAAC,MAAc,EAAE,QAAgB,EAAE,EAAE,CACjC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAChC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serenity-js/assertions",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Screenplay-style assertion library",
5
5
  "author": {
6
6
  "name": "Jan Molak",
@@ -43,18 +43,18 @@
43
43
  "node": "^16.13 || ^18.12 || ^20"
44
44
  },
45
45
  "dependencies": {
46
- "@serenity-js/core": "3.3.0",
46
+ "@serenity-js/core": "3.3.1",
47
47
  "tiny-types": "^1.19.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@integration/testing-tools": "3.0.0",
51
51
  "@types/chai": "^4.3.5",
52
52
  "@types/mocha": "^10.0.1",
53
- "c8": "7.13.0",
53
+ "c8": "7.14.0",
54
54
  "mocha": "^10.2.0",
55
55
  "mocha-multi": "^1.1.7",
56
56
  "ts-node": "^10.9.1",
57
57
  "typescript": "^5.0.4"
58
58
  },
59
- "gitHead": "c4a2bb6aef7b087dc9bc37269fd999d1cdc15088"
59
+ "gitHead": "d036ce75c1eb131d3cde28b04e668dc24f959e2f"
60
60
  }
@@ -15,6 +15,25 @@ import { Expectation } from '@serenity-js/core';
15
15
  * )
16
16
  * ```
17
17
  *
18
+ * ## Ensuring that page URL includes the expected substring
19
+ *
20
+ * {@apilink Page.url|Page.current().url()} returns a {@apilink QuestionAdapter|`QuestionAdapter<URL>`},
21
+ * a proxy object around the standard Node.js [URL](https://nodejs.org/api/url.html) class,
22
+ * offering access to `string` properties such as [`hostname`](https://nodejs.org/api/url.html#urlobjecthostname),
23
+ * [`pathname`](https://nodejs.org/api/url.html#urlobjectpathname), and so on.
24
+ *
25
+ * ```ts
26
+ * import { actorCalled } from '@serenity-js/core'
27
+ * import { Ensure, includes } from '@serenity-js/assertions'
28
+ * import { Navigate, Page } from '@serenity-js/web'
29
+ *
30
+ * await actorCalled('Ester').attemptsTo(
31
+ * Navigate.to('https://serenity-js.org/handbook'),
32
+ * Ensure.that(Page.current().url().hostname, includes('serenity-js')),
33
+ * Ensure.that(Page.current().url().pathname, includes('book')),
34
+ * )
35
+ * ```
36
+ *
18
37
  * @param expected
19
38
  *
20
39
  * @group Expectations