@serenity-js/assertions 3.36.1 → 3.37.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/README.md +83 -38
- package/lib/Ensure.d.ts +3 -0
- package/lib/Ensure.d.ts.map +1 -1
- package/lib/Ensure.js +3 -0
- package/lib/Ensure.js.map +1 -1
- package/package.json +3 -3
- package/src/Ensure.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.37.0](https://github.com/serenity-js/serenity-js/compare/v3.36.2...v3.37.0) (2025-12-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @serenity-js/assertions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.36.2](https://github.com/serenity-js/serenity-js/compare/v3.36.1...v3.36.2) (2025-11-26)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @serenity-js/assertions
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [3.36.1](https://github.com/serenity-js/serenity-js/compare/v3.36.0...v3.36.1) (2025-11-16)
|
|
7
23
|
|
|
8
24
|
|
package/README.md
CHANGED
|
@@ -1,39 +1,57 @@
|
|
|
1
|
-
# Serenity/JS
|
|
1
|
+
# Serenity/JS Assertions
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/%40serenity-js%2Fassertions)
|
|
4
|
+
[](https://github.com/serenity-js/serenity-js/actions)
|
|
5
|
+
[](https://qlty.sh/gh/serenity-js/projects/serenity-js)
|
|
6
|
+
[](https://qlty.sh/gh/serenity-js/projects/serenity-js)
|
|
7
|
+
[](https://github.com/serenity-js/serenity-js/graphs/contributors)
|
|
8
|
+
[](https://snyk.io/test/npm/@serenity-js/assertions)
|
|
9
|
+
[](https://github.com/serenity-js/serenity-js)
|
|
2
10
|
|
|
3
11
|
[](https://www.linkedin.com/company/serenity-js)
|
|
4
12
|
[](https://www.youtube.com/@serenity-js)
|
|
5
13
|
[](https://matrix.to/#/#serenity-js:gitter.im)
|
|
6
14
|
[](https://github.com/sponsors/serenity-js)
|
|
7
15
|
|
|
8
|
-
[
|
|
9
|
-
of
|
|
16
|
+
[`@serenity-js/assertions`](https://serenity-js.org/api/assertions/)
|
|
17
|
+
provides a rich set of [Screenplay Pattern](https://serenity-js.org/handbook/design/screenplay-pattern/)-compatible assertions and expectations for verifying the system under test and synchronising the test flow.
|
|
10
18
|
|
|
11
|
-
|
|
12
|
-
- [Serenity/JS web testing tutorial](https://serenity-js.org/handbook/web-testing/your-first-web-scenario)
|
|
13
|
-
- [Serenity/JS Handbook](https://serenity-js.org/handbook)
|
|
14
|
-
- [API documentation](https://serenity-js.org/api/)
|
|
15
|
-
- [Serenity/JS Project Templates](https://serenity-js.org/handbook/project-templates/)
|
|
19
|
+
## Features
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
- Support the project and gain access to [Serenity/JS Playbooks](https://github.com/serenity-js/playbooks) by becoming a [Serenity/JS GitHub Sponsor](https://github.com/sponsors/serenity-js)!
|
|
21
|
+
- **Fluent, expressive assertions** following the [Screenplay Pattern](https://serenity-js.org/handbook/design/screenplay-pattern/) for readable and maintainable tests.
|
|
22
|
+
- **Seamless integration** with all [supported test runners](https://serenity-js.org/handbook/test-runners/).
|
|
23
|
+
- **Rich set of built-in matchers** for common scenarios, with easy support for custom matchers.
|
|
24
|
+
- **TypeScript-first design** with strong typing for safer, more predictable test code.
|
|
22
25
|
|
|
23
|
-
##
|
|
26
|
+
## Installation
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
```sh
|
|
29
|
+
npm install --save-dev @serenity-js/core @serenity-js/assertions
|
|
30
|
+
```
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
See the [Serenity/JS Installation Guide](https://serenity-js.org/handbook/installation/).
|
|
28
33
|
|
|
29
|
-
To install this module, run the following command in your computer terminal:
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { actorCalled } from '@serenity-js/core';
|
|
39
|
+
import { Ensure, equals } from '@serenity-js/assertions';
|
|
40
|
+
|
|
41
|
+
await actorCalled('Alice').attemptsTo(
|
|
42
|
+
Ensure.that(2 + 2, equals(4))
|
|
43
|
+
)
|
|
33
44
|
```
|
|
34
45
|
|
|
46
|
+
Explore practical examples and in-depth explanations in the [Serenity/JS Handbook](https://serenity-js.org/handbook/).
|
|
35
47
|
|
|
36
|
-
|
|
48
|
+
## Usage Examples
|
|
49
|
+
|
|
50
|
+
### Performing assertion
|
|
51
|
+
|
|
52
|
+
To perform an assertion, use the [`Ensure.that`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
53
|
+
or [`Ensure.eventually`](https://serenity-js.org/api/assertions/class/Ensure/#eventually) tasks,
|
|
54
|
+
along with an appropriate [expectation](https://serenity-js.org/api/assertions/):
|
|
37
55
|
|
|
38
56
|
```typescript
|
|
39
57
|
import { Ensure, endsWith } from '@serenity-js/assertions'
|
|
@@ -49,12 +67,14 @@ await actorCalled('Erica').attemptsTo(
|
|
|
49
67
|
)
|
|
50
68
|
```
|
|
51
69
|
|
|
52
|
-
### Controlling execution flow
|
|
70
|
+
### Controlling execution flow
|
|
71
|
+
|
|
72
|
+
To control the execution flow based on certain conditions, use the [`Check.whether`](https://serenity-js.org/api/core/class/Check/) task:
|
|
53
73
|
|
|
54
74
|
```typescript
|
|
55
75
|
import { actorCalled } from '@serenity-js/core'
|
|
56
76
|
import { Check } from '@serenity-js/assertions'
|
|
57
|
-
import { Click, isVisible } from '@serenity-js/
|
|
77
|
+
import { Click, isVisible } from '@serenity-js/web'
|
|
58
78
|
|
|
59
79
|
await actorCalled('Erica').attemptsTo(
|
|
60
80
|
Check.whether(NewsletterModal, isVisible())
|
|
@@ -62,11 +82,14 @@ await actorCalled('Erica').attemptsTo(
|
|
|
62
82
|
)
|
|
63
83
|
```
|
|
64
84
|
|
|
65
|
-
### Synchronising
|
|
85
|
+
### Synchronising execution with the System Under Test
|
|
86
|
+
|
|
87
|
+
To synchronise the test flow with the state of the System Under Test,
|
|
88
|
+
use the [`Wait.until`](https://serenity-js.org/api/core/class/Wait/) task:
|
|
66
89
|
|
|
67
90
|
```typescript
|
|
68
91
|
import { actorCalled } from '@serenity-js/core'
|
|
69
|
-
import { Click, isVisible, Wait } from '@serenity-js/
|
|
92
|
+
import { Click, isVisible, Wait } from '@serenity-js/web'
|
|
70
93
|
|
|
71
94
|
await actorCalled('Erica').attemptsTo(
|
|
72
95
|
Wait.until(CloseModalButton, isVisible()),
|
|
@@ -74,7 +97,10 @@ await actorCalled('Erica').attemptsTo(
|
|
|
74
97
|
)
|
|
75
98
|
```
|
|
76
99
|
|
|
77
|
-
### Defining custom expectations
|
|
100
|
+
### Defining custom expectations
|
|
101
|
+
|
|
102
|
+
To define a custom expectation,
|
|
103
|
+
use the [`Expectation.thatActualShould`](https://serenity-js.org/api/assertions/#defining-custom-expectations-using-expectationthatactualshould) method:
|
|
78
104
|
|
|
79
105
|
```typescript
|
|
80
106
|
import { actorCalled } from '@serenity-js/core'
|
|
@@ -90,7 +116,9 @@ await actorCalled('Erica').attemptsTo(
|
|
|
90
116
|
)
|
|
91
117
|
```
|
|
92
118
|
|
|
93
|
-
### Composing expectations
|
|
119
|
+
### Composing expectations
|
|
120
|
+
|
|
121
|
+
To compose complex expectations, use the [`Expectation.to`](https://serenity-js.org/api/assertions/#composing-expectations-using-expectationto) method:
|
|
94
122
|
|
|
95
123
|
```typescript
|
|
96
124
|
import { actorCalled } from '@serenity-js/core'
|
|
@@ -110,21 +138,38 @@ await actorCalled('Erica').attemptsTo(
|
|
|
110
138
|
)
|
|
111
139
|
```
|
|
112
140
|
|
|
113
|
-
##
|
|
141
|
+
## Documentation
|
|
114
142
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
143
|
+
- [API Reference](https://serenity-js.org/api/)
|
|
144
|
+
- [Screenplay Pattern Guide](https://serenity-js.org/handbook/design/screenplay-pattern/)
|
|
145
|
+
- [Serenity/JS Project Templates](https://serenity-js.org/handbook/project-templates/)
|
|
146
|
+
- [Tutorial: First Web Scenario](https://serenity-js.org/handbook/tutorials/your-first-web-scenario/)
|
|
147
|
+
- [Tutorial: First API Scenario](https://serenity-js.org/handbook/tutorials/your-first-api-scenario/)
|
|
119
148
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
149
|
+
## Contributing
|
|
150
|
+
|
|
151
|
+
Contributions of all kinds are welcome! Get started with the [Contributing Guide](https://serenity-js.org/community/contributing/).
|
|
152
|
+
|
|
153
|
+
## Community
|
|
154
|
+
|
|
155
|
+
- [Community Chat](https://matrix.to/#/#serenity-js:gitter.im)
|
|
156
|
+
- [Discussions Forum](https://github.com/orgs/serenity-js/discussions)
|
|
157
|
+
- Visit the [💡How to... ?](https://github.com/orgs/serenity-js/discussions/categories/how-to) section for answers to common questions
|
|
158
|
+
|
|
159
|
+
If you enjoy using Serenity/JS, make sure to star ⭐️ [Serenity/JS on GitHub](https://github.com/serenity-js/serenity-js) to help others discover the framework!
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
The Serenity/JS code base is licensed under the [Apache-2.0](https://opensource.org/license/apache-2-0) license,
|
|
164
|
+
while its documentation and the [Serenity/JS Handbook](https://serenity-js.org/handbook/) are licensed under the [Creative Commons BY-NC-SA 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/).
|
|
165
|
+
|
|
166
|
+
See the [Serenity/JS License](https://serenity-js.org/legal/license/).
|
|
124
167
|
|
|
125
|
-
##
|
|
168
|
+
## Support
|
|
126
169
|
|
|
127
|
-
|
|
170
|
+
Support ongoing development through [GitHub Sponsors](https://github.com/sponsors/serenity-js). Sponsors gain access to [Serenity/JS Playbooks](https://github.com/serenity-js/playbooks)
|
|
171
|
+
and priority help in the [Discussions Forum](https://github.com/orgs/serenity-js/discussions).
|
|
128
172
|
|
|
129
|
-
[
|
|
173
|
+
For corporate sponsorship or commercial support, please contact [Jan Molak](https://www.linkedin.com/in/janmolak/).
|
|
130
174
|
|
|
175
|
+
[](https://github.com/sponsors/serenity-js).
|
package/lib/Ensure.d.ts
CHANGED
|
@@ -71,6 +71,9 @@ export declare class Ensure<Actual> extends Interaction {
|
|
|
71
71
|
* which verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
|
|
72
72
|
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) within the expected timeframe.
|
|
73
73
|
*
|
|
74
|
+
* After the first try, it waits longer and longer between checks, following a simple exponential backoff pattern (2^try * 100). So 0ms the first
|
|
75
|
+
* time, then 200ms, 400ms, 800ms, 1600ms, 3200ms and so on.
|
|
76
|
+
*
|
|
74
77
|
* If the expectation is not met by the time the timeout expires, the interaction throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
|
|
75
78
|
*
|
|
76
79
|
* @param {Answerable<Actual_Type>} actual
|
package/lib/Ensure.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ensure.d.ts","sourceRoot":"","sources":["../src/Ensure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAMH,WAAW,EAKd,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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E,KAAK,KAAK,YAAY,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW;CAgB7H"}
|
package/lib/Ensure.js
CHANGED
|
@@ -75,6 +75,9 @@ class Ensure extends core_1.Interaction {
|
|
|
75
75
|
* which verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
|
|
76
76
|
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) within the expected timeframe.
|
|
77
77
|
*
|
|
78
|
+
* After the first try, it waits longer and longer between checks, following a simple exponential backoff pattern (2^try * 100). So 0ms the first
|
|
79
|
+
* time, then 200ms, 400ms, 800ms, 1600ms, 3200ms and so on.
|
|
80
|
+
*
|
|
78
81
|
* If the expectation is not met by the time the timeout expires, the interaction throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
|
|
79
82
|
*
|
|
80
83
|
* @param {Answerable<Actual_Type>} actual
|
package/lib/Ensure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ensure.js","sourceRoot":"","sources":["../src/Ensure.ts"],"names":[],"mappings":";;;AAQA,4CAW2B;AAG3B,yDAAsD;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAa,MAAe,SAAQ,kBAAW;
|
|
1
|
+
{"version":3,"file":"Ensure.js","sourceRoot":"","sources":["../src/Ensure.ts"],"names":[],"mappings":";;;AAQA,4CAW2B;AAG3B,yDAAsD;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAa,MAAe,SAAQ,kBAAW;IAgDpB;IACA;IA/CvB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAI,CAAc,MAA+B,EAAE,WAAqC;QAC3F,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,eAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC;I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CAAC,OAAO,YAAY,qBAAc,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,iBAAU,CAAC,IAAA,QAAC,EAAA,wFAAyF,OAAQ,EAAE,CAAC,CAAC;QAC/H,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,iBAAiB,CAAC,kBAAwE,EAAE,OAAgB;QACxG,MAAM,QAAQ,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAE9C,OAAO,kBAAW,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAC,KAAK,EAAC,EAAE;YACpD,IAAI,CAAC;gBACD,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;YACD,OAAO,KAAK,EAAE,CAAC;gBACX,MAAM,kBAAW,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE;oBACnD,OAAO,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO;oBACjC,QAAQ;oBACR,KAAK,EAAE,KAAK;iBACf,CAAC,CAAC;YACP,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA3GD,wBA2GC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/assertions",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.37.0",
|
|
4
4
|
"description": "Serenity/JS universal assertion library supporting all types of functional tests, including both web and REST API scenarios",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"node": "^20 || ^22 || ^24"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@serenity-js/core": "3.
|
|
51
|
+
"@serenity-js/core": "3.37.0",
|
|
52
52
|
"tiny-types": "1.24.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"ts-node": "10.9.2",
|
|
62
62
|
"typescript": "5.9.3"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "dae146cd99a04f09b5926fb9d3205af562fa2927"
|
|
65
65
|
}
|
package/src/Ensure.ts
CHANGED
|
@@ -94,6 +94,9 @@ export class Ensure<Actual> extends Interaction {
|
|
|
94
94
|
* which verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
|
|
95
95
|
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) within the expected timeframe.
|
|
96
96
|
*
|
|
97
|
+
* After the first try, it waits longer and longer between checks, following a simple exponential backoff pattern (2^try * 100). So 0ms the first
|
|
98
|
+
* time, then 200ms, 400ms, 800ms, 1600ms, 3200ms and so on.
|
|
99
|
+
*
|
|
97
100
|
* If the expectation is not met by the time the timeout expires, the interaction throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
|
|
98
101
|
*
|
|
99
102
|
* @param {Answerable<Actual_Type>} actual
|