playwright-facteur 2.0.0 → 3.0.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/README.md +11 -1
- package/dist/fixtures.js +4 -7
- package/dist/matchers.d.ts +2 -2
- package/dist/matchers.js +2 -2
- package/dist/wait.js +1 -1
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ The tag in the address is built from four things:
|
|
|
66
66
|
|
|
67
67
|
## How long a test waits
|
|
68
68
|
|
|
69
|
-
A wait lasts as long as what is left of the test's own timeout, less two seconds, with five minutes at most. When the mail does not come, the failure is written by this package, inside the test's timeout, instead of Playwright's message about a slow test:
|
|
69
|
+
The plugin searches for the mail every second. A wait lasts as long as what is left of the test's own timeout, less two seconds, with five minutes at most. A key may send 600 requests a minute: past that, the plugin waits the `Retry-After` of the `429` and goes on, so a suite with many workers slows down instead of failing. When the mail does not come, the failure is written by this package, inside the test's timeout, instead of Playwright's message about a slow test:
|
|
70
70
|
|
|
71
71
|
```
|
|
72
72
|
No message matched {"subject":"Your invoice"} at test+<tag>@<id>.inbox.facteur.eu.
|
|
@@ -99,6 +99,16 @@ Each message `waitFor` returns is attached to the test in the report: `facteur-<
|
|
|
99
99
|
| `FACTEUR_WORKSPACE` | The slug of the workspace in which workers open their inbox. |
|
|
100
100
|
| `FACTEUR_BASE_URL` | The address of the API. Defaults to `https://api.facteur.eu`. |
|
|
101
101
|
|
|
102
|
+
## Versions
|
|
103
|
+
|
|
104
|
+
This package follows semantic versioning. A change that breaks your code only ships in a new major version. It is tested with Playwright 1.60 and accepts any later 1.x release. Playwright 2 will need a new major version of this package.
|
|
105
|
+
|
|
106
|
+
## Support and security
|
|
107
|
+
|
|
108
|
+
Version 3.x receives security fixes until 15 November 2031, five years after 3.0.0 was released. Versions 2.0.0, 1.0.0 and 0.0.0 receive none: they target an API that no longer exists. Upgrade to 3.x.
|
|
109
|
+
|
|
110
|
+
To report a vulnerability, email security@facteur.eu or use the private reporting of the repository, never a public issue. The [security policy](https://github.com/Aliud-Corp/facteur-sdk/blob/main/SECURITY.md) says what happens next. Each [release](https://github.com/Aliud-Corp/facteur-sdk/releases) carries the software bill of materials (CycloneDX) of its version.
|
|
111
|
+
|
|
102
112
|
## Licence
|
|
103
113
|
|
|
104
114
|
MIT.
|
package/dist/fixtures.js
CHANGED
|
@@ -10,15 +10,12 @@ import { boundedWait } from './wait.js';
|
|
|
10
10
|
*/
|
|
11
11
|
const runId = (process.env.FACTEUR_RUN ??= Date.now().toString(36));
|
|
12
12
|
export const test = base.extend({
|
|
13
|
-
// The client, one per worker
|
|
13
|
+
// The client, one per worker.
|
|
14
14
|
facteur: [
|
|
15
15
|
// Playwright reads the fixtures a function needs from its first parameter, which must be a destructuring.
|
|
16
16
|
// eslint-disable-next-line no-empty-pattern
|
|
17
|
-
async ({}, use
|
|
18
|
-
|
|
19
|
-
// the organization's keys: a worker keeps a share of sixteen, at least one.
|
|
20
|
-
const share = Math.max(1, Math.floor(16 / Math.max(1, workerInfo.config.workers)));
|
|
21
|
-
await use(new Facteur({ maxConcurrentWaits: share }));
|
|
17
|
+
async ({}, use) => {
|
|
18
|
+
await use(new Facteur());
|
|
22
19
|
},
|
|
23
20
|
{ scope: 'worker' },
|
|
24
21
|
],
|
|
@@ -65,7 +62,7 @@ export const test = base.extend({
|
|
|
65
62
|
const { timeout, ...search } = criteria;
|
|
66
63
|
const wait = boundedWait(testInfo, startedAt, timeout);
|
|
67
64
|
// `+<tag>@` and not the bare tag: a tag that is the start of another tag does not match it.
|
|
68
|
-
const found = await facteur.messages.waitFor({ ...search, inbox: inboxId, sentTo: `+${tag}@`, wait });
|
|
65
|
+
const found = await facteur.messages.waitFor({ ...search, inbox: inboxId, sentTo: `+${tag}@`, timeout: wait });
|
|
69
66
|
// The search carries the bodies and the headers, as the read of one message does: no second call.
|
|
70
67
|
latest = found;
|
|
71
68
|
await attach(testInfo, found);
|
package/dist/matchers.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export declare const expect: import("@playwright/test").Expect<{
|
|
|
5
5
|
/**
|
|
6
6
|
* `await expect(inbox).toReceiveEmail({ subject: 'code' })`.
|
|
7
7
|
*
|
|
8
|
-
* The
|
|
9
|
-
*
|
|
8
|
+
* The client searches every second until a message matches or the time runs out; the API holds nothing
|
|
9
|
+
* open. The criteria are Facteur's (substrings of the subject, the body, the sender...). The message found is
|
|
10
10
|
* kept on the inbox (`inbox.latest`) and attached to the report.
|
|
11
11
|
*/
|
|
12
12
|
toReceiveEmail(this: ExpectMatcherState, inbox: TestInbox, criteria?: ReceiveCriteria): Promise<MatcherReturnType>;
|
package/dist/matchers.js
CHANGED
|
@@ -26,8 +26,8 @@ export const expect = base.extend({
|
|
|
26
26
|
/**
|
|
27
27
|
* `await expect(inbox).toReceiveEmail({ subject: 'code' })`.
|
|
28
28
|
*
|
|
29
|
-
* The
|
|
30
|
-
*
|
|
29
|
+
* The client searches every second until a message matches or the time runs out; the API holds nothing
|
|
30
|
+
* open. The criteria are Facteur's (substrings of the subject, the body, the sender...). The message found is
|
|
31
31
|
* kept on the inbox (`inbox.latest`) and attached to the report.
|
|
32
32
|
*/
|
|
33
33
|
async toReceiveEmail(inbox, criteria = {}) {
|
package/dist/wait.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** The
|
|
1
|
+
/** The longest wait the plugin keeps searching for, when the test has no timeout of its own: five minutes. */
|
|
2
2
|
const MAX_WAIT_MS = 300_000;
|
|
3
3
|
/** Left to the test after the wait, to write the failure message inside the test's timeout. */
|
|
4
4
|
const MARGIN_MS = 2_000;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-facteur",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Receive email in your Playwright tests: an inbox fixture, matchers for codes, links and attachments, and the message attached to the report.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"test": "vitest run --passWithNoTests"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@facteur-eu/sdk": "^
|
|
52
|
+
"@facteur-eu/sdk": "^3.0.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@playwright/test": ">=1.60.0"
|
|
55
|
+
"@playwright/test": ">=1.60.0 <2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@eslint/js": "10.0.1",
|
|
@@ -62,6 +62,9 @@
|
|
|
62
62
|
"globals": "17.6.0",
|
|
63
63
|
"typescript": "6.0.3",
|
|
64
64
|
"typescript-eslint": "8.59.3",
|
|
65
|
-
"vitest": "4.1.
|
|
65
|
+
"vitest": "4.1.12"
|
|
66
|
+
},
|
|
67
|
+
"overrides": {
|
|
68
|
+
"minimatch": "11.0.8"
|
|
66
69
|
}
|
|
67
70
|
}
|