chrome-e2e-sdk 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +739 -2
- package/dist/assertion/Assertion.d.ts +87 -0
- package/dist/assertion/Assertion.d.ts.map +1 -0
- package/dist/assertion/Assertion.js +459 -0
- package/dist/assertion/Assertion.js.map +1 -0
- package/dist/assertion/recorder.d.ts +41 -0
- package/dist/assertion/recorder.d.ts.map +1 -0
- package/dist/assertion/recorder.js +37 -0
- package/dist/assertion/recorder.js.map +1 -0
- package/dist/browser/Browser.d.ts +44 -0
- package/dist/browser/Browser.d.ts.map +1 -0
- package/dist/browser/Browser.js +167 -0
- package/dist/browser/Browser.js.map +1 -0
- package/dist/browser/Locator.d.ts +94 -0
- package/dist/browser/Locator.d.ts.map +1 -0
- package/dist/browser/Locator.js +533 -0
- package/dist/browser/Locator.js.map +1 -0
- package/dist/browser/Page.d.ts +272 -0
- package/dist/browser/Page.d.ts.map +1 -0
- package/dist/browser/Page.js +979 -0
- package/dist/browser/Page.js.map +1 -0
- package/dist/client/MCPClient.d.ts +72 -0
- package/dist/client/MCPClient.d.ts.map +1 -0
- package/dist/client/MCPClient.js +302 -0
- package/dist/client/MCPClient.js.map +1 -0
- package/dist/client/MCPCommand.d.ts +51 -0
- package/dist/client/MCPCommand.d.ts.map +1 -0
- package/dist/client/MCPCommand.js +74 -0
- package/dist/client/MCPCommand.js.map +1 -0
- package/dist/env/loadEnv.d.ts +8 -0
- package/dist/env/loadEnv.d.ts.map +1 -0
- package/dist/env/loadEnv.js +19 -0
- package/dist/env/loadEnv.js.map +1 -0
- package/dist/errors/E2EError.d.ts +50 -0
- package/dist/errors/E2EError.d.ts.map +1 -0
- package/dist/errors/E2EError.js +90 -0
- package/dist/errors/E2EError.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +12 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +57 -0
- package/dist/logger.js.map +1 -0
- package/dist/network/Network.d.ts +72 -0
- package/dist/network/Network.d.ts.map +1 -0
- package/dist/network/Network.js +236 -0
- package/dist/network/Network.js.map +1 -0
- package/dist/test/HtmlReport.d.ts +26 -0
- package/dist/test/HtmlReport.d.ts.map +1 -0
- package/dist/test/HtmlReport.js +653 -0
- package/dist/test/HtmlReport.js.map +1 -0
- package/dist/test/Runner.d.ts +146 -0
- package/dist/test/Runner.d.ts.map +1 -0
- package/dist/test/Runner.js +390 -0
- package/dist/test/Runner.js.map +1 -0
- package/dist/test/index.d.ts +4 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +3 -0
- package/dist/test/index.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/package.json +63 -4
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { E2EError } from '../errors/E2EError.js';
|
|
2
|
+
export interface ExpectOptions {
|
|
3
|
+
timeout?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare class AssertionError extends E2EError {
|
|
6
|
+
constructor(message: string, details?: Record<string, unknown>);
|
|
7
|
+
}
|
|
8
|
+
export declare class Expect {
|
|
9
|
+
private actual;
|
|
10
|
+
private options;
|
|
11
|
+
private negated;
|
|
12
|
+
private readonly logger;
|
|
13
|
+
constructor(actual: unknown, options?: ExpectOptions);
|
|
14
|
+
private createLogger;
|
|
15
|
+
/**
|
|
16
|
+
* Negates the assertion. A new `Expect` is returned so the negation survives
|
|
17
|
+
* chained calls: `expect(x).not.toBe(1).toBe(2)` stays negated throughout.
|
|
18
|
+
*/
|
|
19
|
+
get not(): Expect;
|
|
20
|
+
toHaveURL(expected: string | RegExp, options?: ExpectOptions): Promise<void>;
|
|
21
|
+
toHaveURLContaining(expected: string, options?: ExpectOptions): Promise<void>;
|
|
22
|
+
toHaveTitle(expected: string | RegExp, options?: ExpectOptions): Promise<void>;
|
|
23
|
+
toHaveTitleContaining(expected: string, options?: ExpectOptions): Promise<void>;
|
|
24
|
+
/** Assert on the console messages recorded since the last navigation. */
|
|
25
|
+
toHaveConsoleMessage(expected?: {
|
|
26
|
+
type?: string;
|
|
27
|
+
text?: string | RegExp;
|
|
28
|
+
}, options?: ExpectOptions): Promise<void>;
|
|
29
|
+
/** Assert that no console error was recorded since the last navigation. */
|
|
30
|
+
toHaveConsoleError(expected?: string | RegExp, options?: ExpectOptions): Promise<void>;
|
|
31
|
+
toHaveNoConsoleErrors(options?: ExpectOptions): Promise<void>;
|
|
32
|
+
toBeVisible(options?: ExpectOptions): Promise<void>;
|
|
33
|
+
toBeHidden(options?: ExpectOptions): Promise<void>;
|
|
34
|
+
toBeEnabled(options?: ExpectOptions): Promise<void>;
|
|
35
|
+
toBeDisabled(options?: ExpectOptions): Promise<void>;
|
|
36
|
+
toBeChecked(options?: ExpectOptions): Promise<void>;
|
|
37
|
+
toHaveText(expected: string | RegExp, options?: ExpectOptions): Promise<void>;
|
|
38
|
+
toContainText(expected: string | RegExp, options?: ExpectOptions): Promise<void>;
|
|
39
|
+
toHaveValue(expected: string, options?: ExpectOptions): Promise<void>;
|
|
40
|
+
toHaveAttribute(name: string, expected?: string, options?: ExpectOptions): Promise<void>;
|
|
41
|
+
toHaveClass(expected: string, options?: ExpectOptions): Promise<void>;
|
|
42
|
+
toHaveCount(expected: number, options?: ExpectOptions): Promise<void>;
|
|
43
|
+
toBe(expected: unknown): void;
|
|
44
|
+
toEqual(expected: unknown): void;
|
|
45
|
+
toBeTruthy(): void;
|
|
46
|
+
toBeFalsy(): void;
|
|
47
|
+
toBeNull(): void;
|
|
48
|
+
toBeUndefined(): void;
|
|
49
|
+
toBeDefined(): void;
|
|
50
|
+
toContain(expected: unknown): void;
|
|
51
|
+
toHaveLength(expected: number): void;
|
|
52
|
+
toBeGreaterThan(expected: number): void;
|
|
53
|
+
toBeLessThan(expected: number): void;
|
|
54
|
+
toBeCloseTo(expected: number, precision?: number): void;
|
|
55
|
+
resolves(): Promise<Expect>;
|
|
56
|
+
rejects(): Promise<Expect>;
|
|
57
|
+
private derive;
|
|
58
|
+
/**
|
|
59
|
+
* Polls a Locator-backed condition until it matches or the timeout elapses.
|
|
60
|
+
* At least one attempt always runs, so `timeout: 0` performs a single check
|
|
61
|
+
* instead of skipping the check entirely.
|
|
62
|
+
*/
|
|
63
|
+
private assertLocator;
|
|
64
|
+
/**
|
|
65
|
+
* Same polling contract as `assertLocator`, for assertions that read page
|
|
66
|
+
* level state (URL, title, console) rather than a single element.
|
|
67
|
+
*/
|
|
68
|
+
private assertPage;
|
|
69
|
+
private deepEqual;
|
|
70
|
+
private format;
|
|
71
|
+
private sleep;
|
|
72
|
+
}
|
|
73
|
+
export declare function expect(actual: unknown, options?: ExpectOptions): Expect;
|
|
74
|
+
/**
|
|
75
|
+
* Collects assertion failures instead of throwing on the first one.
|
|
76
|
+
*
|
|
77
|
+
* Both synchronous and Locator-backed assertions are supported; Locator
|
|
78
|
+
* assertions keep their normal timeout and retry behaviour.
|
|
79
|
+
*/
|
|
80
|
+
export declare class SoftAssertions {
|
|
81
|
+
private errors;
|
|
82
|
+
expect(actual: unknown, options?: ExpectOptions): Expect;
|
|
83
|
+
getErrors(): AssertionError[];
|
|
84
|
+
hasErrors(): boolean;
|
|
85
|
+
private collect;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=Assertion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Assertion.d.ts","sourceRoot":"","sources":["../../src/assertion/Assertion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAgB,MAAM,uBAAuB,CAAA;AAG9D,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAKD,qBAAa,cAAe,SAAQ,QAAQ;gBAC9B,OAAO,EAAE,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AAE,MAAM,GAAG,IAAI;IAUvC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAUpC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,SAAI,GAAG,IAAI;IAY5C,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAQ3B,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAahC,OAAO,CAAC,MAAM;IAMd;;;;OAIG;YACW,aAAa;IAmD3B;;;OAGG;YACW,UAAU;IA0CxB,OAAO,CAAC,SAAS;IAmBjB,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,KAAK;CAGd;AAcD,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAEvE;AAED;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAuB;IAErC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM;IA4BxD,SAAS,IAAI,cAAc,EAAE;IAI7B,SAAS,IAAI,OAAO;IAIpB,OAAO,CAAC,OAAO;CAOhB"}
|
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import { Locator } from '../browser/Locator.js';
|
|
2
|
+
import { Page } from '../browser/Page.js';
|
|
3
|
+
import { DEFAULT_TIMEOUT_MS } from '../client/MCPCommand.js';
|
|
4
|
+
import { E2EError, E2EErrorCode } from '../errors/E2EError.js';
|
|
5
|
+
import { recordCheck } from './recorder.js';
|
|
6
|
+
const DEFAULT_TIMEOUT = DEFAULT_TIMEOUT_MS;
|
|
7
|
+
const POLL_INTERVAL = 100;
|
|
8
|
+
export class AssertionError extends E2EError {
|
|
9
|
+
constructor(message, details) {
|
|
10
|
+
super(E2EErrorCode.ASSERTION_ERROR, message, { details });
|
|
11
|
+
this.name = 'AssertionError';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class Expect {
|
|
15
|
+
actual;
|
|
16
|
+
options;
|
|
17
|
+
negated = false;
|
|
18
|
+
logger;
|
|
19
|
+
constructor(actual, options = {}) {
|
|
20
|
+
this.actual = actual;
|
|
21
|
+
this.options = options;
|
|
22
|
+
this.logger = this.createLogger();
|
|
23
|
+
}
|
|
24
|
+
createLogger() {
|
|
25
|
+
return (level, message) => {
|
|
26
|
+
if (process.env['DEBUG']?.includes('chrome-e2e')) {
|
|
27
|
+
console.error(`[ChromeE2E:Expect] ${level.toUpperCase()}: ${message}`);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Negates the assertion. A new `Expect` is returned so the negation survives
|
|
33
|
+
* chained calls: `expect(x).not.toBe(1).toBe(2)` stays negated throughout.
|
|
34
|
+
*/
|
|
35
|
+
get not() {
|
|
36
|
+
const negated = new Expect(this.actual, this.options);
|
|
37
|
+
negated.negated = !this.negated;
|
|
38
|
+
return negated;
|
|
39
|
+
}
|
|
40
|
+
// Page assertions
|
|
41
|
+
async toHaveURL(expected, options = {}) {
|
|
42
|
+
await this.assertPage('toHaveURL', async (page) => {
|
|
43
|
+
const url = await page.url();
|
|
44
|
+
return expected instanceof RegExp ? expected.test(url) : url === expected;
|
|
45
|
+
}, `have URL: ${expected}`, options, { expected });
|
|
46
|
+
}
|
|
47
|
+
async toHaveURLContaining(expected, options = {}) {
|
|
48
|
+
await this.assertPage('toHaveURLContaining', async (page) => (await page.url()).includes(expected), `have URL containing: ${expected}`, options, { expected });
|
|
49
|
+
}
|
|
50
|
+
async toHaveTitle(expected, options = {}) {
|
|
51
|
+
await this.assertPage('toHaveTitle', async (page) => {
|
|
52
|
+
const title = await page.title();
|
|
53
|
+
return expected instanceof RegExp ? expected.test(title) : title === expected;
|
|
54
|
+
}, `have title: ${expected}`, options, { expected });
|
|
55
|
+
}
|
|
56
|
+
async toHaveTitleContaining(expected, options = {}) {
|
|
57
|
+
await this.assertPage('toHaveTitleContaining', async (page) => (await page.title()).includes(expected), `have title containing: ${expected}`, options, { expected });
|
|
58
|
+
}
|
|
59
|
+
// Console assertions
|
|
60
|
+
/** Assert on the console messages recorded since the last navigation. */
|
|
61
|
+
async toHaveConsoleMessage(expected = {}, options = {}) {
|
|
62
|
+
await this.assertPage('toHaveConsoleMessage', async (page) => {
|
|
63
|
+
const messages = await page.consoleMessages();
|
|
64
|
+
return messages.some((message) => {
|
|
65
|
+
if (expected.type && message.type !== expected.type)
|
|
66
|
+
return false;
|
|
67
|
+
if (expected.text === undefined)
|
|
68
|
+
return true;
|
|
69
|
+
return expected.text instanceof RegExp
|
|
70
|
+
? expected.text.test(message.text)
|
|
71
|
+
: message.text.includes(expected.text);
|
|
72
|
+
});
|
|
73
|
+
}, `have a console message${expected.type ? ` of type ${expected.type}` : ''}${expected.text !== undefined ? ` matching: ${expected.text}` : ''}`, options, { expected });
|
|
74
|
+
}
|
|
75
|
+
/** Assert that no console error was recorded since the last navigation. */
|
|
76
|
+
async toHaveConsoleError(expected, options = {}) {
|
|
77
|
+
await this.assertPage('toHaveConsoleError', async (page) => {
|
|
78
|
+
const messages = await page.consoleMessages();
|
|
79
|
+
return messages.some((message) => {
|
|
80
|
+
if (message.type !== 'error')
|
|
81
|
+
return false;
|
|
82
|
+
if (expected === undefined)
|
|
83
|
+
return true;
|
|
84
|
+
return expected instanceof RegExp
|
|
85
|
+
? expected.test(message.text)
|
|
86
|
+
: message.text.includes(expected);
|
|
87
|
+
});
|
|
88
|
+
}, expected === undefined
|
|
89
|
+
? 'have a console error'
|
|
90
|
+
: `have a console error matching: ${expected}`, options, { expected });
|
|
91
|
+
}
|
|
92
|
+
async toHaveNoConsoleErrors(options = {}) {
|
|
93
|
+
await this.assertPage('toHaveNoConsoleErrors', async (page) => {
|
|
94
|
+
const messages = await page.consoleMessages();
|
|
95
|
+
return !messages.some((message) => message.type === 'error');
|
|
96
|
+
}, 'have no console errors', options);
|
|
97
|
+
}
|
|
98
|
+
// Locator assertions
|
|
99
|
+
async toBeVisible(options = {}) {
|
|
100
|
+
await this.assertLocator('toBeVisible', async (locator, timeout) => await locator.isVisible({ timeout }), 'be visible', options);
|
|
101
|
+
}
|
|
102
|
+
async toBeHidden(options = {}) {
|
|
103
|
+
await this.assertLocator('toBeHidden', async (locator, timeout) => !(await locator.isVisible({ timeout })), 'be hidden', options);
|
|
104
|
+
}
|
|
105
|
+
async toBeEnabled(options = {}) {
|
|
106
|
+
await this.assertLocator('toBeEnabled', async (locator, timeout) => await locator.isEnabled({ timeout }), 'be enabled', options);
|
|
107
|
+
}
|
|
108
|
+
async toBeDisabled(options = {}) {
|
|
109
|
+
await this.assertLocator('toBeDisabled', async (locator, timeout) => !(await locator.isEnabled({ timeout })), 'be disabled', options);
|
|
110
|
+
}
|
|
111
|
+
async toBeChecked(options = {}) {
|
|
112
|
+
await this.assertLocator('toBeChecked', async (locator, timeout) => await locator.isChecked({ timeout }), 'be checked', options);
|
|
113
|
+
}
|
|
114
|
+
async toHaveText(expected, options = {}) {
|
|
115
|
+
await this.assertLocator('toHaveText', async (locator, timeout) => {
|
|
116
|
+
const text = await locator.textContent({ timeout });
|
|
117
|
+
return expected instanceof RegExp ? expected.test(text) : text === expected;
|
|
118
|
+
}, `have text matching: ${expected}`, options, { expected });
|
|
119
|
+
}
|
|
120
|
+
async toContainText(expected, options = {}) {
|
|
121
|
+
await this.assertLocator('toContainText', async (locator, timeout) => {
|
|
122
|
+
const text = await locator.textContent({ timeout });
|
|
123
|
+
return expected instanceof RegExp ? expected.test(text) : text.includes(expected);
|
|
124
|
+
}, `contain text matching: ${expected}`, options, { expected });
|
|
125
|
+
}
|
|
126
|
+
async toHaveValue(expected, options = {}) {
|
|
127
|
+
await this.assertLocator('toHaveValue', async (locator, timeout) => (await locator.getAttribute('value', { timeout })) === expected, `have value: ${expected}`, options, { expected });
|
|
128
|
+
}
|
|
129
|
+
async toHaveAttribute(name, expected, options = {}) {
|
|
130
|
+
await this.assertLocator('toHaveAttribute', async (locator, timeout) => {
|
|
131
|
+
const value = await locator.getAttribute(name, { timeout });
|
|
132
|
+
return expected === undefined ? value !== null : value === expected;
|
|
133
|
+
}, `have attribute: ${name}${expected === undefined ? '' : ` = ${expected}`}`, options, { attribute: name, expected });
|
|
134
|
+
}
|
|
135
|
+
async toHaveClass(expected, options = {}) {
|
|
136
|
+
await this.assertLocator('toHaveClass', async (locator, timeout) => {
|
|
137
|
+
const className = await locator.getAttribute('class', { timeout });
|
|
138
|
+
return (className?.split(/\s+/) ?? []).includes(expected);
|
|
139
|
+
}, `have class: ${expected}`, options, { expected });
|
|
140
|
+
}
|
|
141
|
+
async toHaveCount(expected, options = {}) {
|
|
142
|
+
await this.assertLocator('toHaveCount', async (locator, timeout) => (await locator.count({ timeout })) === expected, `have count: ${expected}`, options, { expected });
|
|
143
|
+
}
|
|
144
|
+
// Generic value assertions
|
|
145
|
+
toBe(expected) {
|
|
146
|
+
const matches = Object.is(this.actual, expected);
|
|
147
|
+
if (matches === this.negated) {
|
|
148
|
+
throw new AssertionError(this.negated ? `Expected not to be: ${this.format(expected)}` : `Expected to be: ${this.format(expected)}`, { actual: this.actual, expected });
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
toEqual(expected) {
|
|
152
|
+
const matches = this.deepEqual(this.actual, expected);
|
|
153
|
+
if (matches === this.negated) {
|
|
154
|
+
throw new AssertionError(this.negated ? `Expected not to equal: ${this.format(expected)}` : `Expected to equal: ${this.format(expected)}`, { actual: this.actual, expected });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
toBeTruthy() {
|
|
158
|
+
const matches = !!this.actual;
|
|
159
|
+
if (matches === this.negated) {
|
|
160
|
+
throw new AssertionError(this.negated ? `Expected to be falsy` : `Expected to be truthy`, { actual: this.actual });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
toBeFalsy() {
|
|
164
|
+
const matches = !this.actual;
|
|
165
|
+
if (matches === this.negated) {
|
|
166
|
+
throw new AssertionError(this.negated ? `Expected to be truthy` : `Expected to be falsy`, { actual: this.actual });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
toBeNull() {
|
|
170
|
+
const matches = this.actual === null;
|
|
171
|
+
if (matches === this.negated) {
|
|
172
|
+
throw new AssertionError(this.negated ? `Expected not to be null` : `Expected to be null`, { actual: this.actual });
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
toBeUndefined() {
|
|
176
|
+
const matches = this.actual === undefined;
|
|
177
|
+
if (matches === this.negated) {
|
|
178
|
+
throw new AssertionError(this.negated ? `Expected not to be undefined` : `Expected to be undefined`, { actual: this.actual });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
toBeDefined() {
|
|
182
|
+
const matches = this.actual !== undefined;
|
|
183
|
+
if (matches === this.negated) {
|
|
184
|
+
throw new AssertionError(this.negated ? `Expected to be undefined` : `Expected to be defined`, { actual: this.actual });
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
toContain(expected) {
|
|
188
|
+
let matches = false;
|
|
189
|
+
if (Array.isArray(this.actual)) {
|
|
190
|
+
matches = this.actual.some((item) => this.deepEqual(item, expected));
|
|
191
|
+
}
|
|
192
|
+
else if (typeof this.actual === 'string' && typeof expected === 'string') {
|
|
193
|
+
matches = this.actual.includes(expected);
|
|
194
|
+
}
|
|
195
|
+
else if (this.actual && typeof this.actual === 'object') {
|
|
196
|
+
matches = Object.values(this.actual).some((v) => this.deepEqual(v, expected));
|
|
197
|
+
}
|
|
198
|
+
if (matches === this.negated) {
|
|
199
|
+
throw new AssertionError(this.negated ? `Expected not to contain: ${this.format(expected)}` : `Expected to contain: ${this.format(expected)}`, { actual: this.actual, expected });
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
toHaveLength(expected) {
|
|
203
|
+
const length = Array.isArray(this.actual) ? this.actual.length : typeof this.actual === 'string' ? this.actual.length : undefined;
|
|
204
|
+
const matches = length === expected;
|
|
205
|
+
if (matches === this.negated) {
|
|
206
|
+
throw new AssertionError(this.negated ? `Expected not to have length: ${expected}` : `Expected to have length: ${expected}`, { actual: this.actual, expected });
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// Number assertions
|
|
210
|
+
toBeGreaterThan(expected) {
|
|
211
|
+
const matches = typeof this.actual === 'number' && this.actual > expected;
|
|
212
|
+
if (matches === this.negated) {
|
|
213
|
+
throw new AssertionError(this.negated ? `Expected not to be greater than: ${expected}` : `Expected to be greater than: ${expected}`, { actual: this.actual, expected });
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
toBeLessThan(expected) {
|
|
217
|
+
const matches = typeof this.actual === 'number' && this.actual < expected;
|
|
218
|
+
if (matches === this.negated) {
|
|
219
|
+
throw new AssertionError(this.negated ? `Expected not to be less than: ${expected}` : `Expected to be less than: ${expected}`, { actual: this.actual, expected });
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
toBeCloseTo(expected, precision = 2) {
|
|
223
|
+
const matches = typeof this.actual === 'number' && Math.abs(this.actual - expected) < Math.pow(10, -precision) / 2;
|
|
224
|
+
if (matches === this.negated) {
|
|
225
|
+
throw new AssertionError(this.negated ? `Expected not to be close to: ${expected}` : `Expected to be close to: ${expected}`, { actual: this.actual, expected, precision });
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
// Promise assertions
|
|
229
|
+
async resolves() {
|
|
230
|
+
if (!(this.actual instanceof Promise)) {
|
|
231
|
+
throw new AssertionError('resolves() can only be used with Promise');
|
|
232
|
+
}
|
|
233
|
+
const resolved = await this.actual;
|
|
234
|
+
return this.derive(resolved);
|
|
235
|
+
}
|
|
236
|
+
async rejects() {
|
|
237
|
+
if (!(this.actual instanceof Promise)) {
|
|
238
|
+
throw new AssertionError('rejects() can only be used with Promise');
|
|
239
|
+
}
|
|
240
|
+
try {
|
|
241
|
+
await this.actual;
|
|
242
|
+
throw new AssertionError('Expected promise to reject');
|
|
243
|
+
}
|
|
244
|
+
catch (err) {
|
|
245
|
+
if (err instanceof AssertionError)
|
|
246
|
+
throw err;
|
|
247
|
+
return this.derive(err);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
derive(actual) {
|
|
251
|
+
const derived = new Expect(actual, this.options);
|
|
252
|
+
derived.negated = this.negated;
|
|
253
|
+
return derived;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Polls a Locator-backed condition until it matches or the timeout elapses.
|
|
257
|
+
* At least one attempt always runs, so `timeout: 0` performs a single check
|
|
258
|
+
* instead of skipping the check entirely.
|
|
259
|
+
*/
|
|
260
|
+
async assertLocator(method, check, expectation, options, details = {}) {
|
|
261
|
+
if (!(this.actual instanceof Locator)) {
|
|
262
|
+
throw new AssertionError(`${method}() can only be used with Locator`);
|
|
263
|
+
}
|
|
264
|
+
const locator = this.actual;
|
|
265
|
+
const timeout = options.timeout ?? this.options.timeout ?? DEFAULT_TIMEOUT;
|
|
266
|
+
const deadline = Date.now() + timeout;
|
|
267
|
+
this.logger('debug', `${method}: ${locator.describe()} (timeout: ${timeout}ms)`);
|
|
268
|
+
for (;;) {
|
|
269
|
+
let matched = false;
|
|
270
|
+
try {
|
|
271
|
+
matched = await check(locator, Math.max(0, deadline - Date.now()));
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
// Element not reachable yet, keep polling until the deadline.
|
|
275
|
+
if (isFatal(error)) {
|
|
276
|
+
throw error;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (matched !== this.negated) {
|
|
280
|
+
recordCheck({
|
|
281
|
+
method,
|
|
282
|
+
expectation,
|
|
283
|
+
target: locator.describe(),
|
|
284
|
+
negated: this.negated
|
|
285
|
+
});
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
if (Date.now() >= deadline) {
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
await this.sleep(Math.min(POLL_INTERVAL, Math.max(0, deadline - Date.now())));
|
|
292
|
+
}
|
|
293
|
+
throw new AssertionError(`Expected element ${this.negated ? 'not ' : ''}to ${expectation}: ${locator.describe()}`, { selector: locator.getSelector(), negated: this.negated, timeout, ...details });
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Same polling contract as `assertLocator`, for assertions that read page
|
|
297
|
+
* level state (URL, title, console) rather than a single element.
|
|
298
|
+
*/
|
|
299
|
+
async assertPage(method, check, expectation, options, details = {}) {
|
|
300
|
+
if (!(this.actual instanceof Page)) {
|
|
301
|
+
throw new AssertionError(`${method}() can only be used with Page`);
|
|
302
|
+
}
|
|
303
|
+
const timeout = options.timeout ?? this.options.timeout ?? DEFAULT_TIMEOUT;
|
|
304
|
+
const deadline = Date.now() + timeout;
|
|
305
|
+
for (;;) {
|
|
306
|
+
let matched = false;
|
|
307
|
+
try {
|
|
308
|
+
matched = await check(this.actual);
|
|
309
|
+
}
|
|
310
|
+
catch (error) {
|
|
311
|
+
if (isFatal(error)) {
|
|
312
|
+
throw error;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (matched !== this.negated) {
|
|
316
|
+
recordCheck({ method, expectation, negated: this.negated });
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
if (Date.now() >= deadline) {
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
await this.sleep(Math.min(POLL_INTERVAL, Math.max(0, deadline - Date.now())));
|
|
323
|
+
}
|
|
324
|
+
throw new AssertionError(`Expected page ${this.negated ? 'not ' : ''}to ${expectation}`, { negated: this.negated, timeout, ...details });
|
|
325
|
+
}
|
|
326
|
+
deepEqual(a, b) {
|
|
327
|
+
if (Object.is(a, b))
|
|
328
|
+
return true;
|
|
329
|
+
if (a === null || b === null)
|
|
330
|
+
return a === b;
|
|
331
|
+
if (typeof a !== 'object' || typeof b !== 'object')
|
|
332
|
+
return false;
|
|
333
|
+
if (Array.isArray(a) !== Array.isArray(b))
|
|
334
|
+
return false;
|
|
335
|
+
if (Array.isArray(a)) {
|
|
336
|
+
const arrA = a;
|
|
337
|
+
const arrB = b;
|
|
338
|
+
if (arrA.length !== arrB.length)
|
|
339
|
+
return false;
|
|
340
|
+
return arrA.every((item, i) => this.deepEqual(item, arrB[i]));
|
|
341
|
+
}
|
|
342
|
+
const keysA = Object.keys(a);
|
|
343
|
+
const keysB = Object.keys(b);
|
|
344
|
+
if (keysA.length !== keysB.length)
|
|
345
|
+
return false;
|
|
346
|
+
return keysA.every((key) => this.deepEqual(a[key], b[key]));
|
|
347
|
+
}
|
|
348
|
+
format(value) {
|
|
349
|
+
if (value === null)
|
|
350
|
+
return 'null';
|
|
351
|
+
if (value === undefined)
|
|
352
|
+
return 'undefined';
|
|
353
|
+
if (typeof value === 'string')
|
|
354
|
+
return `"${value}"`;
|
|
355
|
+
if (typeof value === 'function')
|
|
356
|
+
return '[Function]';
|
|
357
|
+
if (value instanceof RegExp)
|
|
358
|
+
return value.toString();
|
|
359
|
+
if (Array.isArray(value))
|
|
360
|
+
return `[${value.map((v) => this.format(v)).join(', ')}]`;
|
|
361
|
+
if (typeof value === 'object')
|
|
362
|
+
return JSON.stringify(value);
|
|
363
|
+
return String(value);
|
|
364
|
+
}
|
|
365
|
+
sleep(ms) {
|
|
366
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Errors that must not be swallowed by an assertion retry loop: retrying them
|
|
371
|
+
* would hide real failures behind a timeout.
|
|
372
|
+
*/
|
|
373
|
+
function isFatal(error) {
|
|
374
|
+
if (!(error instanceof E2EError)) {
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
return error.code !== E2EErrorCode.ELEMENT_NOT_FOUND && error.code !== E2EErrorCode.TIMEOUT;
|
|
378
|
+
}
|
|
379
|
+
// Main expect function
|
|
380
|
+
export function expect(actual, options) {
|
|
381
|
+
return new Expect(actual, options);
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Collects assertion failures instead of throwing on the first one.
|
|
385
|
+
*
|
|
386
|
+
* Both synchronous and Locator-backed assertions are supported; Locator
|
|
387
|
+
* assertions keep their normal timeout and retry behaviour.
|
|
388
|
+
*/
|
|
389
|
+
export class SoftAssertions {
|
|
390
|
+
errors = [];
|
|
391
|
+
expect(actual, options) {
|
|
392
|
+
const assertion = new Expect(actual, options);
|
|
393
|
+
for (const method of softAssertableMethods()) {
|
|
394
|
+
const original = assertion[method];
|
|
395
|
+
assertion[method] = (...args) => {
|
|
396
|
+
const run = () => original.apply(assertion, args);
|
|
397
|
+
if (isAsyncMethod(method)) {
|
|
398
|
+
return run().catch((error) => {
|
|
399
|
+
this.collect(error);
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
try {
|
|
403
|
+
return run();
|
|
404
|
+
}
|
|
405
|
+
catch (error) {
|
|
406
|
+
this.collect(error);
|
|
407
|
+
return undefined;
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
return assertion;
|
|
412
|
+
}
|
|
413
|
+
getErrors() {
|
|
414
|
+
return this.errors;
|
|
415
|
+
}
|
|
416
|
+
hasErrors() {
|
|
417
|
+
return this.errors.length > 0;
|
|
418
|
+
}
|
|
419
|
+
collect(error) {
|
|
420
|
+
if (error instanceof AssertionError) {
|
|
421
|
+
this.errors.push(error);
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
throw error;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
const ASYNC_METHODS = new Set([
|
|
428
|
+
'toHaveURL',
|
|
429
|
+
'toHaveURLContaining',
|
|
430
|
+
'toHaveTitle',
|
|
431
|
+
'toHaveTitleContaining',
|
|
432
|
+
'toHaveConsoleMessage',
|
|
433
|
+
'toHaveConsoleError',
|
|
434
|
+
'toHaveNoConsoleErrors',
|
|
435
|
+
'toBeVisible',
|
|
436
|
+
'toBeHidden',
|
|
437
|
+
'toBeEnabled',
|
|
438
|
+
'toBeDisabled',
|
|
439
|
+
'toBeChecked',
|
|
440
|
+
'toHaveText',
|
|
441
|
+
'toContainText',
|
|
442
|
+
'toHaveValue',
|
|
443
|
+
'toHaveAttribute',
|
|
444
|
+
'toHaveClass',
|
|
445
|
+
'toHaveCount',
|
|
446
|
+
'resolves',
|
|
447
|
+
'rejects'
|
|
448
|
+
]);
|
|
449
|
+
let cachedMethodNames;
|
|
450
|
+
function softAssertableMethods() {
|
|
451
|
+
if (!cachedMethodNames) {
|
|
452
|
+
cachedMethodNames = Object.getOwnPropertyNames(Expect.prototype).filter((name) => name !== 'constructor' && typeof Expect.prototype[name] === 'function');
|
|
453
|
+
}
|
|
454
|
+
return cachedMethodNames;
|
|
455
|
+
}
|
|
456
|
+
function isAsyncMethod(name) {
|
|
457
|
+
return ASYNC_METHODS.has(name);
|
|
458
|
+
}
|
|
459
|
+
//# sourceMappingURL=Assertion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Assertion.js","sourceRoot":"","sources":["../../src/assertion/Assertion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAM3C,MAAM,eAAe,GAAG,kBAAkB,CAAA;AAC1C,MAAM,aAAa,GAAG,GAAG,CAAA;AAEzB,MAAM,OAAO,cAAe,SAAQ,QAAQ;IAC1C,YAAY,OAAe,EAAE,OAAiC;QAC5D,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;QACzD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAA;IAC9B,CAAC;CACF;AAKD,MAAM,OAAO,MAAM;IACT,MAAM,CAAS;IACf,OAAO,CAAe;IACtB,OAAO,GAAG,KAAK,CAAA;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
|
+
/**
|
|
2
|
+
* One assertion that passed.
|
|
3
|
+
*
|
|
4
|
+
* `expectation` is the same phrase the failure message uses ("have value:
|
|
5
|
+
* chrome e2e"), so a green row reads in the same terms as a red one. There is
|
|
6
|
+
* no `actual` here on purpose: the check functions reduce the page to a boolean,
|
|
7
|
+
* and for most assertions that boolean genuinely is all there is to say.
|
|
8
|
+
*/
|
|
9
|
+
export interface RecordedCheck {
|
|
10
|
+
method: string;
|
|
11
|
+
expectation: string;
|
|
12
|
+
/** How the target was addressed, e.g. `role=combobox` or `css=textarea`. */
|
|
13
|
+
target?: string;
|
|
14
|
+
negated: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Records a passing assertion, if a test is currently collecting.
|
|
18
|
+
*
|
|
19
|
+
* A no-op outside a collected run, so `expect()` stays usable on its own -
|
|
20
|
+
* from a script, or from a test written against a different runner.
|
|
21
|
+
*/
|
|
22
|
+
export declare function recordCheck(check: RecordedCheck): void;
|
|
23
|
+
/**
|
|
24
|
+
* Runs `fn` with a fresh list and returns what it recorded, plus whatever it
|
|
25
|
+
* threw.
|
|
26
|
+
*
|
|
27
|
+
* The error is returned rather than propagated because a test that fails on its
|
|
28
|
+
* tenth assertion still made nine passes worth showing, and losing them would
|
|
29
|
+
* hide exactly the context the report exists to give. A caller that only wants
|
|
30
|
+
* the checks can ignore it.
|
|
31
|
+
*
|
|
32
|
+
* AsyncLocalStorage rather than a module-level variable: the list has to
|
|
33
|
+
* survive every `await` inside the test body while staying invisible to a
|
|
34
|
+
* second test running concurrently, and nothing about the public assertion API
|
|
35
|
+
* should have to change to carry it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function collectChecks(fn: () => Promise<void>): Promise<{
|
|
38
|
+
error: unknown;
|
|
39
|
+
checks: RecordedCheck[];
|
|
40
|
+
}>;
|
|
41
|
+
//# sourceMappingURL=recorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../src/assertion/recorder.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;CACjB;AAID;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAEtD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,aAAa,CACjC,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GACtB,OAAO,CAAC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,aAAa,EAAE,CAAA;CAAE,CAAC,CAWtD"}
|