@empiricalrun/playwright-utils 0.30.0 → 0.31.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 +22 -0
- package/dist/email.d.ts +4 -14
- package/dist/email.d.ts.map +1 -1
- package/dist/email.js +14 -52
- package/dist/mailosaur-client.d.ts +34 -0
- package/dist/mailosaur-client.d.ts.map +1 -0
- package/dist/mailosaur-client.js +131 -0
- package/dist/reporter/util.d.ts +1 -1
- package/dist/reporter/util.d.ts.map +1 -1
- package/dist/reporter/util.js +1 -1
- package/docs/video-labels.md +4 -10
- package/package.json +3 -4
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.31.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5639645: refactor: replace Mailosaur SDK with direct REST API calls
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [25962dc]
|
|
12
|
+
- @empiricalrun/llm@0.25.1
|
|
13
|
+
- @empiricalrun/test-gen@0.78.2
|
|
14
|
+
|
|
15
|
+
## 0.30.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [29eaffb]
|
|
20
|
+
- Updated dependencies [897486a]
|
|
21
|
+
- Updated dependencies [758c41a]
|
|
22
|
+
- @empiricalrun/test-gen@0.78.1
|
|
23
|
+
- @empiricalrun/llm@0.25.0
|
|
24
|
+
|
|
3
25
|
## 0.30.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/dist/email.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
type
|
|
3
|
-
text?: string;
|
|
4
|
-
href?: string;
|
|
5
|
-
};
|
|
6
|
-
export type Email = {
|
|
7
|
-
subject?: string;
|
|
8
|
-
text?: string;
|
|
9
|
-
html?: string;
|
|
10
|
-
links: Link[];
|
|
11
|
-
codes: string[];
|
|
12
|
-
};
|
|
1
|
+
import { type MailosaurEmail } from "./mailosaur-client";
|
|
2
|
+
export type Email = MailosaurEmail;
|
|
13
3
|
type QueryFilter = {
|
|
14
4
|
from?: string;
|
|
15
5
|
subject?: string;
|
|
@@ -21,12 +11,12 @@ type EmailClientOptions = {
|
|
|
21
11
|
};
|
|
22
12
|
export declare class EmailClient {
|
|
23
13
|
address: string;
|
|
24
|
-
client: MailosaurClient;
|
|
25
14
|
timeout: number;
|
|
26
15
|
serverId: string;
|
|
16
|
+
private client;
|
|
27
17
|
constructor(opts?: EmailClientOptions);
|
|
28
18
|
getAddress(): string;
|
|
29
|
-
waitForEmail(filter?: QueryFilter): Promise<Email
|
|
19
|
+
waitForEmail(filter?: QueryFilter): Promise<Email>;
|
|
30
20
|
}
|
|
31
21
|
export {};
|
|
32
22
|
//# sourceMappingURL=email.d.ts.map
|
package/dist/email.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE1E,MAAM,MAAM,KAAK,GAAG,cAAc,CAAC;AAEnC,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAKF,KAAK,kBAAkB,GAAG;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,qBAAa,WAAW;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,SAAa;IACrB,OAAO,CAAC,MAAM,CAAkB;gBAEpB,IAAI,GAAE,kBAAuB;IA2BzC,UAAU,IAAI,MAAM;IAId,YAAY,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC;CAGzD"}
|
package/dist/email.js
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.EmailClient = void 0;
|
|
7
|
-
const
|
|
4
|
+
const mailosaur_client_1 = require("./mailosaur-client");
|
|
8
5
|
const DEFAULT_TIMEOUT = 30_000;
|
|
6
|
+
const SERVER_ID = "pnyrwq5o";
|
|
9
7
|
class EmailClient {
|
|
10
8
|
address;
|
|
11
|
-
client;
|
|
12
9
|
timeout;
|
|
13
|
-
serverId =
|
|
10
|
+
serverId = SERVER_ID;
|
|
11
|
+
client;
|
|
14
12
|
constructor(opts = {}) {
|
|
15
|
-
|
|
13
|
+
const apiKey = process.env.MAILOSAUR_API_KEY;
|
|
14
|
+
if (!apiKey) {
|
|
15
|
+
throw new Error("'apiKey' must be set");
|
|
16
|
+
}
|
|
16
17
|
const { timeout = DEFAULT_TIMEOUT, emailId: knownEmailId } = opts;
|
|
17
18
|
this.timeout = timeout;
|
|
19
|
+
this.client = new mailosaur_client_1.MailosaurClient({
|
|
20
|
+
apiKey,
|
|
21
|
+
serverId: this.serverId,
|
|
22
|
+
timeout: this.timeout,
|
|
23
|
+
});
|
|
18
24
|
const emailId = knownEmailId ||
|
|
19
25
|
[...Array(7)].map(() => Math.random().toString(36)[2]).join("");
|
|
20
26
|
if (emailId.includes("@")) {
|
|
21
|
-
// When EmailClient is used as a virtual SMTP server,
|
|
22
|
-
// we can read emails sent to any domain. These can be
|
|
23
|
-
// specified by setting the emailId to a full address.
|
|
24
27
|
this.address = emailId;
|
|
25
28
|
}
|
|
26
29
|
else {
|
|
@@ -32,48 +35,7 @@ class EmailClient {
|
|
|
32
35
|
return this.address;
|
|
33
36
|
}
|
|
34
37
|
async waitForEmail(filter) {
|
|
35
|
-
|
|
36
|
-
const bufferPeriod = 5_000;
|
|
37
|
-
const receivedAfter = new Date(now.getTime() - bufferPeriod);
|
|
38
|
-
try {
|
|
39
|
-
const email = await this.client.messages.get(this.serverId, {
|
|
40
|
-
sentTo: this.address,
|
|
41
|
-
sentFrom: filter?.from,
|
|
42
|
-
subject: filter?.subject,
|
|
43
|
-
body: filter?.body,
|
|
44
|
-
}, {
|
|
45
|
-
timeout: this.timeout,
|
|
46
|
-
receivedAfter,
|
|
47
|
-
});
|
|
48
|
-
const codesAsString = (email.html?.codes || []).map((code) => code.value);
|
|
49
|
-
const allLinks = [
|
|
50
|
-
...(email.html?.links || []),
|
|
51
|
-
...(email.text?.links || []),
|
|
52
|
-
];
|
|
53
|
-
return {
|
|
54
|
-
subject: email.subject,
|
|
55
|
-
text: email.text?.body,
|
|
56
|
-
html: email.html?.body,
|
|
57
|
-
links: allLinks,
|
|
58
|
-
codes: codesAsString,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
if (error.errorType) {
|
|
63
|
-
const mailosaurError = error;
|
|
64
|
-
if (mailosaurError.errorType === "authentication_error") {
|
|
65
|
-
throw new Error("Email provider error: Authentication error");
|
|
66
|
-
}
|
|
67
|
-
else if (mailosaurError.errorType === "search_timeout") {
|
|
68
|
-
throw new Error(`Email not received at ${this.address} within ${this.timeout}ms`);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
console.error(`Mailosaur error: ${mailosaurError.httpResponseBody}`);
|
|
72
|
-
throw new Error(`Unknown error: ${mailosaurError.errorType}`);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
throw error;
|
|
76
|
-
}
|
|
38
|
+
return this.client.waitForEmail(this.address, filter);
|
|
77
39
|
}
|
|
78
40
|
}
|
|
79
41
|
exports.EmailClient = EmailClient;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type Link = {
|
|
2
|
+
text?: string;
|
|
3
|
+
href?: string;
|
|
4
|
+
};
|
|
5
|
+
export type MailosaurEmail = {
|
|
6
|
+
subject?: string;
|
|
7
|
+
text?: string;
|
|
8
|
+
html?: string;
|
|
9
|
+
links: Link[];
|
|
10
|
+
codes: string[];
|
|
11
|
+
};
|
|
12
|
+
type MailosaurClientOptions = {
|
|
13
|
+
apiKey: string;
|
|
14
|
+
serverId: string;
|
|
15
|
+
timeout: number;
|
|
16
|
+
};
|
|
17
|
+
export declare class MailosaurClient {
|
|
18
|
+
private apiKey;
|
|
19
|
+
private serverId;
|
|
20
|
+
private timeout;
|
|
21
|
+
constructor(opts: MailosaurClientOptions);
|
|
22
|
+
waitForEmail(address: string, filter?: {
|
|
23
|
+
from?: string;
|
|
24
|
+
subject?: string;
|
|
25
|
+
body?: string;
|
|
26
|
+
}): Promise<MailosaurEmail>;
|
|
27
|
+
private searchWithPolling;
|
|
28
|
+
private getMessageById;
|
|
29
|
+
private handleMailosaurError;
|
|
30
|
+
private parseEmailResponse;
|
|
31
|
+
private sleep;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=mailosaur-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailosaur-client.d.ts","sourceRoot":"","sources":["../src/mailosaur-client.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AA6BF,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,OAAO,CAAS;gBAEZ,IAAI,EAAE,sBAAsB;IAMlC,YAAY,CAChB,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1D,OAAO,CAAC,cAAc,CAAC;YAqBZ,iBAAiB;YAyEjB,cAAc;YAuBd,oBAAoB;IAqBlC,OAAO,CAAC,kBAAkB;IAmB1B,OAAO,CAAC,KAAK;CAGd"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MailosaurClient = void 0;
|
|
4
|
+
const MAILOSAUR_BASE_URL = "https://mailosaur.com/api";
|
|
5
|
+
const DEFAULT_POLL_DELAY = 1000;
|
|
6
|
+
class MailosaurClient {
|
|
7
|
+
apiKey;
|
|
8
|
+
serverId;
|
|
9
|
+
timeout;
|
|
10
|
+
constructor(opts) {
|
|
11
|
+
this.apiKey = opts.apiKey;
|
|
12
|
+
this.serverId = opts.serverId;
|
|
13
|
+
this.timeout = opts.timeout;
|
|
14
|
+
}
|
|
15
|
+
async waitForEmail(address, filter) {
|
|
16
|
+
const now = new Date();
|
|
17
|
+
const bufferPeriod = 5_000;
|
|
18
|
+
const receivedAfter = new Date(now.getTime() - bufferPeriod);
|
|
19
|
+
const searchCriteria = {
|
|
20
|
+
sentTo: address,
|
|
21
|
+
...(filter?.from && { sentFrom: filter.from }),
|
|
22
|
+
...(filter?.subject && { subject: filter.subject }),
|
|
23
|
+
...(filter?.body && { body: filter.body }),
|
|
24
|
+
};
|
|
25
|
+
const messageId = await this.searchWithPolling(searchCriteria, receivedAfter, address);
|
|
26
|
+
const message = await this.getMessageById(messageId);
|
|
27
|
+
return this.parseEmailResponse(message);
|
|
28
|
+
}
|
|
29
|
+
async searchWithPolling(criteria, receivedAfter, address) {
|
|
30
|
+
const startTime = Date.now();
|
|
31
|
+
let pollCount = 0;
|
|
32
|
+
while (true) {
|
|
33
|
+
const searchParams = new URLSearchParams({
|
|
34
|
+
server: this.serverId,
|
|
35
|
+
page: "0",
|
|
36
|
+
itemsPerPage: "1",
|
|
37
|
+
receivedAfter: receivedAfter.toISOString(),
|
|
38
|
+
});
|
|
39
|
+
const url = `${MAILOSAUR_BASE_URL}/messages/search?${searchParams.toString()}`;
|
|
40
|
+
let response;
|
|
41
|
+
try {
|
|
42
|
+
response = await fetch(url, {
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers: {
|
|
45
|
+
Authorization: `Basic ${Buffer.from(`${this.apiKey}:`).toString("base64")}`,
|
|
46
|
+
"Content-Type": "application/json",
|
|
47
|
+
},
|
|
48
|
+
body: JSON.stringify(criteria),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
console.error("Mailosaur network error during search:", err);
|
|
53
|
+
throw new Error("Email provider error: Network request failed");
|
|
54
|
+
}
|
|
55
|
+
if (!response.ok) {
|
|
56
|
+
await this.handleMailosaurError(response, "search");
|
|
57
|
+
}
|
|
58
|
+
const body = (await response.json());
|
|
59
|
+
if (body.items && body.items.length > 0 && body.items[0]?.id) {
|
|
60
|
+
return body.items[0].id;
|
|
61
|
+
}
|
|
62
|
+
// Parse delay from response header, filtering out invalid values
|
|
63
|
+
const header = response.headers.get("x-ms-delay");
|
|
64
|
+
let delay = DEFAULT_POLL_DELAY;
|
|
65
|
+
if (header) {
|
|
66
|
+
const pattern = header
|
|
67
|
+
.split(",")
|
|
68
|
+
.map((x) => parseInt(x, 10))
|
|
69
|
+
.filter((n) => Number.isFinite(n) && n > 0);
|
|
70
|
+
if (pattern.length > 0) {
|
|
71
|
+
const index = Math.min(pollCount, pattern.length - 1);
|
|
72
|
+
delay = pattern[index] ?? DEFAULT_POLL_DELAY;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
pollCount += 1;
|
|
76
|
+
// Check if we'll exceed timeout
|
|
77
|
+
const elapsed = Date.now() - startTime;
|
|
78
|
+
if (elapsed + delay > this.timeout) {
|
|
79
|
+
throw new Error(`Email not received at ${address} within ${this.timeout}ms`);
|
|
80
|
+
}
|
|
81
|
+
await this.sleep(delay);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async getMessageById(messageId) {
|
|
85
|
+
const url = `${MAILOSAUR_BASE_URL}/messages/${messageId}`;
|
|
86
|
+
let response;
|
|
87
|
+
try {
|
|
88
|
+
response = await fetch(url, {
|
|
89
|
+
method: "GET",
|
|
90
|
+
headers: {
|
|
91
|
+
Authorization: `Basic ${Buffer.from(`${this.apiKey}:`).toString("base64")}`,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
console.error("Mailosaur network error during getMessageById:", err);
|
|
97
|
+
throw new Error("Email provider error: Network request failed");
|
|
98
|
+
}
|
|
99
|
+
if (!response.ok) {
|
|
100
|
+
await this.handleMailosaurError(response, "getMessageById");
|
|
101
|
+
}
|
|
102
|
+
return (await response.json());
|
|
103
|
+
}
|
|
104
|
+
async handleMailosaurError(response, context) {
|
|
105
|
+
const errorBody = await response.text().catch(() => "");
|
|
106
|
+
console.error(`Mailosaur error in ${context}:`, errorBody || response.statusText);
|
|
107
|
+
if (response.status === 401) {
|
|
108
|
+
throw new Error("Email provider error: Authentication error");
|
|
109
|
+
}
|
|
110
|
+
throw new Error(`Email provider error (${context}): HTTP ${response.status}${errorBody ? ` - ${errorBody}` : ""}`);
|
|
111
|
+
}
|
|
112
|
+
parseEmailResponse(email) {
|
|
113
|
+
const codesAsString = email.html?.codes
|
|
114
|
+
?.map((code) => code.value)
|
|
115
|
+
.filter((v) => typeof v === "string") ?? [];
|
|
116
|
+
const htmlLinks = email.html?.links ?? [];
|
|
117
|
+
const textLinks = email.text?.links ?? [];
|
|
118
|
+
const allLinks = [...htmlLinks, ...textLinks];
|
|
119
|
+
return {
|
|
120
|
+
subject: email.subject,
|
|
121
|
+
text: email.text?.body,
|
|
122
|
+
html: email.html?.body,
|
|
123
|
+
links: allLinks,
|
|
124
|
+
codes: codesAsString,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
sleep(ms) {
|
|
128
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.MailosaurClient = MailosaurClient;
|
package/dist/reporter/util.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GenericPlaywrightAttachment, TestCaseRunEndEventV2 } from "@empiricalrun/shared-types";
|
|
1
|
+
import { GenericPlaywrightAttachment, TestCaseRunEndEventV2 } from "@empiricalrun/shared-types/playwright-utils";
|
|
2
2
|
import { JSONReportSpec, JSONReport as PlaywrightJSONReport, TestCase } from "@playwright/test/reporter";
|
|
3
3
|
export declare function getPackageJsonPath(folderPath: string): string;
|
|
4
4
|
export declare function resolveReporterOutputPath(defaultValue: string, configDir: string, configValue: string | undefined): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/reporter/util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACtB,MAAM,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/reporter/util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACtB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,cAAc,EAGd,UAAU,IAAI,oBAAoB,EAElC,QAAQ,EACT,MAAM,2BAA2B,CAAC;AAoBnC,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAmB7D;AAED,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAAG,SAAS,UAMhC;AAED,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAC5E,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,CAyCD;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,QAAQ;;;EAwBrD;AAED,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAyDf;AAED,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,GAAG,EACR,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GACnC,GAAG,CAIL;AAED,wBAAsB,gCAAgC,CACpD,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,iBAuFjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,GAAG,EACb,iBAAiB,EAAE,GAAG,CACpB,MAAM,EACN;IAAE,WAAW,EAAE,2BAA2B,EAAE,CAAA;CAAE,EAAE,CACjD,QA+BF;AAGD,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,oBAAoB,EACjC,MAAM,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,QAavC;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,OAAe,GAC9B,GAAG,CAAC,MAAM,EAAE;IAAE,WAAW,EAAE,2BAA2B,EAAE,CAAA;CAAE,EAAE,CAAC,CA4C/D;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO7E;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gCAAgC,CACpD,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,6CAoClB"}
|
package/dist/reporter/util.js
CHANGED
|
@@ -126,7 +126,7 @@ async function sendTestCaseUpdateToDashboard(params) {
|
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
if (!process.env.EMPIRICALRUN_API_KEY) {
|
|
129
|
-
console.
|
|
129
|
+
console.log("No API token found. Skipping send message to dashboard.");
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
await (0, async_retry_1.default)(async () => {
|
package/docs/video-labels.md
CHANGED
|
@@ -10,7 +10,7 @@ To solve this, you should set video labels for pages. This will enable you to id
|
|
|
10
10
|
## Usage
|
|
11
11
|
|
|
12
12
|
```typescript
|
|
13
|
-
import { setVideoLabel } from 'playwright-utils/test';
|
|
13
|
+
import { setVideoLabel } from '@empiricalrun/playwright-utils/test';
|
|
14
14
|
|
|
15
15
|
test('my test', async ({ page }) => {
|
|
16
16
|
setVideoLabel(page, 'checkout-flow');
|
|
@@ -30,13 +30,7 @@ test('multi-user scenario', async ({ page, customContextPageProvider }) => {
|
|
|
30
30
|
});
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## Notes
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
- `customContextPageProvider`: `video-0.webm`, `video-1.webm`, etc.
|
|
38
|
-
|
|
39
|
-
## Note
|
|
40
|
-
|
|
41
|
-
If setVideoLabel is called twice for the same page:
|
|
42
|
-
- The last label will be set
|
|
35
|
+
- The default behavior is to label videos for multiple pages as: `video-0.webm`, `video-1.webm`, etc.
|
|
36
|
+
- If setVideoLabel is called twice for the same page, the last label will be set
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -40,12 +40,11 @@
|
|
|
40
40
|
"async-retry": "^1.3.3",
|
|
41
41
|
"authenticator": "^1.1.5",
|
|
42
42
|
"console-log-level": "^1.4.1",
|
|
43
|
-
"mailosaur": "^8.6.1",
|
|
44
43
|
"puppeteer-extra-plugin-recaptcha": "^3.6.8",
|
|
45
44
|
"rimraf": "^6.0.1",
|
|
46
|
-
"@empiricalrun/llm": "^0.
|
|
45
|
+
"@empiricalrun/llm": "^0.25.1",
|
|
47
46
|
"@empiricalrun/r2-uploader": "^0.4.0",
|
|
48
|
-
"@empiricalrun/test-gen": "^0.78.
|
|
47
|
+
"@empiricalrun/test-gen": "^0.78.2"
|
|
49
48
|
},
|
|
50
49
|
"scripts": {
|
|
51
50
|
"dev": "tsc --build --watch",
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/email.ts","./src/index.ts","./src/logger.ts","./src/playwright-extensions.ts","./src/auth/google.ts","./src/auth/index.ts","./src/auth/types.ts","./src/captcha/index.ts","./src/captcha/vision.ts","./src/config/index.ts","./src/config/devices/types.ts","./src/overlay-tests/cache.spec.ts","./src/overlay-tests/click.spec.ts","./src/overlay-tests/fixtures.ts","./src/overlay-tests/patch.spec.ts","./src/reporter/empirical-reporter.ts","./src/reporter/uploader.ts","./src/reporter/util.ts","./src/test/constants.ts","./src/test/expect.ts","./src/test/index.ts","./src/test/types.ts","./src/test/video-labels.ts","./src/test/scripts/agent-capabilities.ts","./src/test/scripts/index.ts","./src/test/scripts/locator-highlights.ts","./src/test/scripts/locator-vision.ts","./src/test/scripts/mouse-pointer.ts","./src/test/scripts/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/cache.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/index.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/prompt.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/utils.ts","./src/test/scripts/pw-locator-patch/highlight/click.ts","./src/test/scripts/pw-locator-patch/highlight/expect.ts","./src/test/scripts/pw-locator-patch/highlight/hover.ts","./src/test/scripts/pw-locator-patch/highlight/inner-text.ts","./src/test/scripts/pw-locator-patch/highlight/input-value.ts","./src/test/scripts/pw-locator-patch/highlight/is-checked.ts","./src/test/scripts/pw-locator-patch/highlight/is-disabled.ts","./src/test/scripts/pw-locator-patch/highlight/is-editable.ts","./src/test/scripts/pw-locator-patch/highlight/text-content.ts","./src/test/scripts/pw-locator-patch/utils/index.ts","./src/test/scripts/pw-locator-patch/vision/query.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["./src/email.ts","./src/index.ts","./src/logger.ts","./src/mailosaur-client.ts","./src/playwright-extensions.ts","./src/auth/google.ts","./src/auth/index.ts","./src/auth/types.ts","./src/captcha/index.ts","./src/captcha/vision.ts","./src/config/index.ts","./src/config/devices/types.ts","./src/overlay-tests/cache.spec.ts","./src/overlay-tests/click.spec.ts","./src/overlay-tests/fixtures.ts","./src/overlay-tests/patch.spec.ts","./src/reporter/empirical-reporter.ts","./src/reporter/uploader.ts","./src/reporter/util.ts","./src/test/constants.ts","./src/test/expect.ts","./src/test/index.ts","./src/test/types.ts","./src/test/video-labels.ts","./src/test/scripts/agent-capabilities.ts","./src/test/scripts/index.ts","./src/test/scripts/locator-highlights.ts","./src/test/scripts/locator-vision.ts","./src/test/scripts/mouse-pointer.ts","./src/test/scripts/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/cache.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/index.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/prompt.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/utils.ts","./src/test/scripts/pw-locator-patch/highlight/click.ts","./src/test/scripts/pw-locator-patch/highlight/expect.ts","./src/test/scripts/pw-locator-patch/highlight/hover.ts","./src/test/scripts/pw-locator-patch/highlight/inner-text.ts","./src/test/scripts/pw-locator-patch/highlight/input-value.ts","./src/test/scripts/pw-locator-patch/highlight/is-checked.ts","./src/test/scripts/pw-locator-patch/highlight/is-disabled.ts","./src/test/scripts/pw-locator-patch/highlight/is-editable.ts","./src/test/scripts/pw-locator-patch/highlight/text-content.ts","./src/test/scripts/pw-locator-patch/utils/index.ts","./src/test/scripts/pw-locator-patch/vision/query.ts"],"version":"5.8.3"}
|