playwright-clipboard-testing 0.3.0 → 0.5.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/dist/index.d.cts CHANGED
@@ -1,15 +1,6 @@
1
- import * as _playwright_test from '@playwright/test';
2
- import { Page, BrowserContext, TestFixture, ExpectMatcherState, MatcherReturnType } from '@playwright/test';
3
-
4
- declare const firefoxClipboardPrefs: {
5
- 'dom.events.testing.asyncClipboard': boolean;
6
- 'dom.events.asyncClipboard.readText': boolean;
7
- 'dom.events.asyncClipboard.writeText': boolean;
8
- 'permissions.default.clipboard-read': number;
9
- 'permissions.default.clipboard-write': number;
10
- };
11
-
12
- type BrowserName = 'chromium' | 'firefox' | 'webkit';
1
+ import { Page, ExpectMatcherState, MatcherReturnType, TestFixture, BrowserContext } from '@playwright/test';
2
+ import * as playwright_test from 'playwright/test';
3
+ import * as playwright_core from 'playwright-core';
13
4
 
14
5
  /**
15
6
  * Playwright-compatible Clipboard utilities.
@@ -24,15 +15,7 @@ type BrowserName = 'chromium' | 'firefox' | 'webkit';
24
15
 
25
16
  declare class ClipboardHandler {
26
17
  private readonly page;
27
- private readonly context;
28
- private readonly browserName;
29
- private isPermissionGranted;
30
- constructor(page: Page, context: BrowserContext, browserName?: BrowserName);
31
- /**
32
- * Grants clipboard permissions to the Chromium browser context if not already granted.
33
- * @private
34
- */
35
- private grantPermissions;
18
+ constructor(page: Page);
36
19
  /**
37
20
  * Reads the current text content from the browser clipboard.
38
21
  * If the content is a JSON-encoded string (e.g., has extra quotes),
@@ -50,90 +33,84 @@ declare class ClipboardHandler {
50
33
  * @throws {Error} If the clipboard content is not a valid JSON string.
51
34
  */
52
35
  readJSON<T = unknown>(): Promise<T>;
36
+ /**
37
+ * Writes the provided string data to the browser clipboard.
38
+ * @param data The data to write to the clipboard.
39
+ */
40
+ write(data: string): Promise<void>;
41
+ /**
42
+ * Writes the provided data to the browser clipboard as a JSON string.
43
+ * @param data The data to write to the clipboard. It will be stringified as JSON.
44
+ */
45
+ writeJSON<T = unknown>(data: T): Promise<void>;
46
+ /**
47
+ * Clears the browser clipboard by writing an empty string to it.
48
+ * This effectively removes any existing content from the clipboard.
49
+ */
50
+ clear(): Promise<void>;
53
51
  }
54
52
 
55
- /**
56
- * A fixture that provides an instance of the Clipboard utility for interacting with the system clipboard.
57
- * It allows reading from the clipboard during tests.
58
- */
59
- declare const clipboardFixture: TestFixture<ClipboardHandler, {
60
- page: Page;
61
- context: BrowserContext;
62
- browserName: BrowserName;
63
- }>;
64
-
65
- type MatcherOptions = {
53
+ type TimeoutMatcherOptions = {
66
54
  timeout?: number;
67
55
  };
56
+ type IgnoreCaseMatcherOptions = {
57
+ ignoreCase?: boolean;
58
+ };
59
+ type TrimMatcherOptions = {
60
+ trim?: boolean;
61
+ };
68
62
  declare global {
69
63
  namespace PlaywrightTest {
70
64
  interface Matchers<R> {
71
65
  /**
72
- * Asserts that the clipboard content matches the expected text.
66
+ * Asserts that the clipboard content is empty.
73
67
  * Uses smart polling to wait for the clipboard to be updated.
74
68
  *
75
- * @param expected The string to compare against the clipboard content.
76
69
  * @param options Matcher options.
77
70
  * @returns A Promise that resolves when the assertion completes.
78
71
  *
79
72
  * @example
80
- * await expect(clipboard).toHaveText('Copied value');
73
+ * await expect(clipboard).toBeBlank();
81
74
  */
82
- toHaveText(expected: string, options?: MatcherOptions): Promise<R>;
75
+ toBeBlank(options?: TimeoutMatcherOptions & TrimMatcherOptions): Promise<R>;
83
76
  /**
84
- * Asserts that the clipboard content matches the expected JSON value.
77
+ * Asserts that the clipboard content matches the expected text.
85
78
  * Uses smart polling to wait for the clipboard to be updated.
86
79
  *
87
- * @param expected The JSON value to compare against the clipboard content.
80
+ * @param expected The string or regular expression to compare against the clipboard content.
88
81
  * @param options Matcher options.
89
82
  * @returns A Promise that resolves when the assertion completes.
90
83
  *
91
84
  * @example
92
- * await expect(clipboard).toHaveJSON({ id: 123, status: 'success' });
85
+ * await expect(clipboard).toHaveTextContent('Copied value');
93
86
  */
94
- toHaveJSON(expected: unknown, options?: MatcherOptions): Promise<R>;
87
+ toHaveTextContent(expected: string | RegExp, options?: TimeoutMatcherOptions & IgnoreCaseMatcherOptions & TrimMatcherOptions): Promise<R>;
95
88
  /**
96
- * Asserts that the clipboard content matches the expected value.
89
+ * Asserts that the clipboard content matches the expected JSON value.
97
90
  * Uses smart polling to wait for the clipboard to be updated.
98
- * If the `expected` value is an object, it attempts to parse the clipboard
99
- * content as JSON before comparing.
100
- *
101
- * @deprecated Use `toHaveText` or `toHaveJSON` instead. This matcher will be removed in future versions.
102
91
  *
103
- * @param expected The string or object to compare against the clipboard content.
104
- * @param options Optional settings for the matcher, such as timeout.
92
+ * @param expected The JSON value to compare against the clipboard content.
93
+ * @param options Matcher options.
105
94
  * @returns A Promise that resolves when the assertion completes.
106
95
  *
107
96
  * @example
108
- * await expect(clipboard).toHaveData('Copied value');
109
- * await expect(clipboard).toHaveData({ id: 123, status: 'success' });
97
+ * await expect(clipboard).toHaveJSONContent({ id: 123, status: 'success' });
110
98
  */
111
- toHaveData(expected: unknown, options?: MatcherOptions): Promise<R>;
99
+ toHaveJSONContent(expected: unknown, options?: TimeoutMatcherOptions): Promise<R>;
112
100
  }
113
101
  }
114
102
  }
115
103
 
116
104
  /**
117
- * Asserts that the clipboard content matches the expected value.
118
- * Uses smart polling to wait for the clipboard to be updated.
119
- * If the `expected` value is an object, it attempts to parse the clipboard
120
- * content as JSON before comparing.
105
+ * Asserts that the clipboard content matches the expected text value.
121
106
  *
122
107
  * @this ExpectMatcherState
123
108
  * @param clipboard The Clipboard utility instance.
124
- * @param expected The string or object to compare against the clipboard content.
125
- * @param options Optional settings for the matcher, such as timeout.
109
+ * @param expected The expected text value.
110
+ * @param options Matcher options.
126
111
  * @returns A Promise that resolves to a MatcherReturnType object.
127
112
  */
128
- declare function toHaveData(this: ExpectMatcherState, clipboard: ClipboardHandler, expected: unknown, options?: MatcherOptions): Promise<{
129
- name: string;
130
- message: () => string;
131
- pass: boolean;
132
- expected?: unknown;
133
- actual?: any;
134
- log?: string[];
135
- timeout?: number;
136
- }>;
113
+ declare function toHaveTextContent(this: ExpectMatcherState, clipboard: ClipboardHandler, expected: string | RegExp, options?: TimeoutMatcherOptions & IgnoreCaseMatcherOptions & TrimMatcherOptions): Promise<MatcherReturnType>;
137
114
 
138
115
  /**
139
116
  * Asserts that the clipboard content matches the expected JSON value.
@@ -144,35 +121,114 @@ declare function toHaveData(this: ExpectMatcherState, clipboard: ClipboardHandle
144
121
  * @param options Matcher options.
145
122
  * @returns A Promise that resolves to a MatcherReturnType object.
146
123
  */
147
- declare function toHaveJSON(this: ExpectMatcherState, clipboard: ClipboardHandler, expected: unknown, options?: MatcherOptions): Promise<MatcherReturnType>;
124
+ declare function toHaveJSONContent(this: ExpectMatcherState, clipboard: ClipboardHandler, expected: unknown, options?: TimeoutMatcherOptions): Promise<MatcherReturnType>;
148
125
 
149
126
  /**
150
- * Asserts that the clipboard content matches the expected text value.
127
+ * Asserts that the clipboard content is blank (empty string).
151
128
  *
152
129
  * @this ExpectMatcherState
153
130
  * @param clipboard The Clipboard utility instance.
154
- * @param expected The expected text value.
155
131
  * @param options Matcher options.
156
132
  * @returns A Promise that resolves to a MatcherReturnType object.
157
133
  */
158
- declare function toHaveText(this: ExpectMatcherState, clipboard: ClipboardHandler, expected: string, options?: MatcherOptions): Promise<MatcherReturnType>;
134
+ declare function toBeBlank(this: ExpectMatcherState, clipboard: ClipboardHandler, options?: TimeoutMatcherOptions & TrimMatcherOptions): Promise<MatcherReturnType>;
159
135
 
160
- declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArgs & _playwright_test.PlaywrightTestOptions & {
136
+ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs & playwright_test.PlaywrightTestOptions & {
161
137
  clipboard: ClipboardHandler;
162
- }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions>;
163
- declare const expect: _playwright_test.Expect<{
164
- toHaveText: typeof toHaveText;
165
- toHaveJSON: typeof toHaveJSON;
166
- toHaveData: typeof toHaveData;
138
+ }, playwright_test.PlaywrightWorkerArgs & playwright_test.PlaywrightWorkerOptions>;
139
+ declare const expect: playwright_test.Expect<{
140
+ toBeBlank: typeof toBeBlank;
141
+ toHaveJSONContent: typeof toHaveJSONContent;
142
+ toHaveTextContent: typeof toHaveTextContent;
167
143
  }>;
168
144
 
145
+ declare const firefoxClipboardPrefs: {
146
+ 'dom.events.testing.asyncClipboard': boolean;
147
+ 'dom.events.asyncClipboard.readText': boolean;
148
+ 'dom.events.asyncClipboard.writeText': boolean;
149
+ 'permissions.default.clipboard-read': number;
150
+ 'permissions.default.clipboard-write': number;
151
+ };
152
+
153
+ type BrowserName = 'chromium' | 'firefox' | 'webkit';
154
+
155
+ /**
156
+ * A fixture that provides an instance of the Clipboard utility for interacting with the system clipboard.
157
+ * It allows reading from the clipboard during tests.
158
+ */
159
+ declare const clipboardFixture: TestFixture<ClipboardHandler, {
160
+ page: Page;
161
+ browserName: BrowserName;
162
+ }>;
163
+
164
+ /**
165
+ * A fixture that provides a BrowserContext with clipboard permissions granted for Chromium browsers.
166
+ */
167
+ declare const contextFixture: TestFixture<BrowserContext, {
168
+ context: BrowserContext;
169
+ browserName: BrowserName;
170
+ }>;
171
+
172
+ /**
173
+ * A collection of fixtures related to clipboard testing, including the clipboard fixture and context fixture.
174
+ * These fixtures can be used in Playwright tests to facilitate clipboard interactions and context management.
175
+ */
176
+ declare const clipboardFixtures: {
177
+ context: playwright_test.TestFixture<playwright_core.BrowserContext, {
178
+ context: playwright_core.BrowserContext;
179
+ browserName: BrowserName;
180
+ }>;
181
+ clipboard: playwright_test.TestFixture<ClipboardHandler, {
182
+ page: playwright_core.Page;
183
+ browserName: BrowserName;
184
+ }>;
185
+ };
186
+
169
187
  /**
170
188
  * Export an object containing all the custom clipboard matchers for Playwright.
171
189
  */
172
190
  declare const clipboardMatchers: {
173
- toHaveText: typeof toHaveText;
174
- toHaveJSON: typeof toHaveJSON;
175
- toHaveData: typeof toHaveData;
191
+ toBeBlank: typeof toBeBlank;
192
+ toHaveJSONContent: typeof toHaveJSONContent;
193
+ toHaveTextContent: typeof toHaveTextContent;
194
+ };
195
+
196
+ /**
197
+ * This module contains regular expression patterns for various common formats.
198
+ * These patterns can be used for validation purposes in applications.
199
+ */
200
+ declare const PATTERNS: {
201
+ /**
202
+ * UUID v1-v5 (example: 123e4567-e89b-12d3-a456-426614174000).
203
+ */
204
+ readonly UUID: RegExp;
205
+ /**
206
+ * Email addresses (example: user@example.com).
207
+ */
208
+ readonly EMAIL: RegExp;
209
+ /**
210
+ * JWT tokens (example: header.payload.signature).
211
+ */
212
+ readonly JWT: RegExp;
213
+ /**
214
+ * Authorization Bearer tokens (example: Bearer <token>).
215
+ */
216
+ readonly BEARER: RegExp;
217
+ /**
218
+ * HEX-colors (example: #FFF, #FFFFFF, #FFFFFFFF).
219
+ */
220
+ readonly HEX_COLOR: RegExp;
221
+ /**
222
+ * IP (IPv4, IPv6 or any).
223
+ */
224
+ readonly IP: {
225
+ /** IPv4 (example: 192.168.1.1 or 127.0.0.1) */
226
+ readonly V4: RegExp;
227
+ /** IPv6 (example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334) */
228
+ readonly V6: RegExp;
229
+ /** Any IP address (IPv4 or IPv6) */
230
+ readonly ANY: RegExp;
231
+ };
176
232
  };
177
233
 
178
- export { ClipboardHandler, clipboardFixture, clipboardMatchers, expect, firefoxClipboardPrefs, test };
234
+ export { ClipboardHandler, PATTERNS, clipboardFixture, clipboardFixtures, clipboardMatchers, contextFixture, expect, firefoxClipboardPrefs, test };
package/dist/index.d.ts CHANGED
@@ -1,15 +1,6 @@
1
- import * as _playwright_test from '@playwright/test';
2
- import { Page, BrowserContext, TestFixture, ExpectMatcherState, MatcherReturnType } from '@playwright/test';
3
-
4
- declare const firefoxClipboardPrefs: {
5
- 'dom.events.testing.asyncClipboard': boolean;
6
- 'dom.events.asyncClipboard.readText': boolean;
7
- 'dom.events.asyncClipboard.writeText': boolean;
8
- 'permissions.default.clipboard-read': number;
9
- 'permissions.default.clipboard-write': number;
10
- };
11
-
12
- type BrowserName = 'chromium' | 'firefox' | 'webkit';
1
+ import { Page, ExpectMatcherState, MatcherReturnType, TestFixture, BrowserContext } from '@playwright/test';
2
+ import * as playwright_test from 'playwright/test';
3
+ import * as playwright_core from 'playwright-core';
13
4
 
14
5
  /**
15
6
  * Playwright-compatible Clipboard utilities.
@@ -24,15 +15,7 @@ type BrowserName = 'chromium' | 'firefox' | 'webkit';
24
15
 
25
16
  declare class ClipboardHandler {
26
17
  private readonly page;
27
- private readonly context;
28
- private readonly browserName;
29
- private isPermissionGranted;
30
- constructor(page: Page, context: BrowserContext, browserName?: BrowserName);
31
- /**
32
- * Grants clipboard permissions to the Chromium browser context if not already granted.
33
- * @private
34
- */
35
- private grantPermissions;
18
+ constructor(page: Page);
36
19
  /**
37
20
  * Reads the current text content from the browser clipboard.
38
21
  * If the content is a JSON-encoded string (e.g., has extra quotes),
@@ -50,90 +33,84 @@ declare class ClipboardHandler {
50
33
  * @throws {Error} If the clipboard content is not a valid JSON string.
51
34
  */
52
35
  readJSON<T = unknown>(): Promise<T>;
36
+ /**
37
+ * Writes the provided string data to the browser clipboard.
38
+ * @param data The data to write to the clipboard.
39
+ */
40
+ write(data: string): Promise<void>;
41
+ /**
42
+ * Writes the provided data to the browser clipboard as a JSON string.
43
+ * @param data The data to write to the clipboard. It will be stringified as JSON.
44
+ */
45
+ writeJSON<T = unknown>(data: T): Promise<void>;
46
+ /**
47
+ * Clears the browser clipboard by writing an empty string to it.
48
+ * This effectively removes any existing content from the clipboard.
49
+ */
50
+ clear(): Promise<void>;
53
51
  }
54
52
 
55
- /**
56
- * A fixture that provides an instance of the Clipboard utility for interacting with the system clipboard.
57
- * It allows reading from the clipboard during tests.
58
- */
59
- declare const clipboardFixture: TestFixture<ClipboardHandler, {
60
- page: Page;
61
- context: BrowserContext;
62
- browserName: BrowserName;
63
- }>;
64
-
65
- type MatcherOptions = {
53
+ type TimeoutMatcherOptions = {
66
54
  timeout?: number;
67
55
  };
56
+ type IgnoreCaseMatcherOptions = {
57
+ ignoreCase?: boolean;
58
+ };
59
+ type TrimMatcherOptions = {
60
+ trim?: boolean;
61
+ };
68
62
  declare global {
69
63
  namespace PlaywrightTest {
70
64
  interface Matchers<R> {
71
65
  /**
72
- * Asserts that the clipboard content matches the expected text.
66
+ * Asserts that the clipboard content is empty.
73
67
  * Uses smart polling to wait for the clipboard to be updated.
74
68
  *
75
- * @param expected The string to compare against the clipboard content.
76
69
  * @param options Matcher options.
77
70
  * @returns A Promise that resolves when the assertion completes.
78
71
  *
79
72
  * @example
80
- * await expect(clipboard).toHaveText('Copied value');
73
+ * await expect(clipboard).toBeBlank();
81
74
  */
82
- toHaveText(expected: string, options?: MatcherOptions): Promise<R>;
75
+ toBeBlank(options?: TimeoutMatcherOptions & TrimMatcherOptions): Promise<R>;
83
76
  /**
84
- * Asserts that the clipboard content matches the expected JSON value.
77
+ * Asserts that the clipboard content matches the expected text.
85
78
  * Uses smart polling to wait for the clipboard to be updated.
86
79
  *
87
- * @param expected The JSON value to compare against the clipboard content.
80
+ * @param expected The string or regular expression to compare against the clipboard content.
88
81
  * @param options Matcher options.
89
82
  * @returns A Promise that resolves when the assertion completes.
90
83
  *
91
84
  * @example
92
- * await expect(clipboard).toHaveJSON({ id: 123, status: 'success' });
85
+ * await expect(clipboard).toHaveTextContent('Copied value');
93
86
  */
94
- toHaveJSON(expected: unknown, options?: MatcherOptions): Promise<R>;
87
+ toHaveTextContent(expected: string | RegExp, options?: TimeoutMatcherOptions & IgnoreCaseMatcherOptions & TrimMatcherOptions): Promise<R>;
95
88
  /**
96
- * Asserts that the clipboard content matches the expected value.
89
+ * Asserts that the clipboard content matches the expected JSON value.
97
90
  * Uses smart polling to wait for the clipboard to be updated.
98
- * If the `expected` value is an object, it attempts to parse the clipboard
99
- * content as JSON before comparing.
100
- *
101
- * @deprecated Use `toHaveText` or `toHaveJSON` instead. This matcher will be removed in future versions.
102
91
  *
103
- * @param expected The string or object to compare against the clipboard content.
104
- * @param options Optional settings for the matcher, such as timeout.
92
+ * @param expected The JSON value to compare against the clipboard content.
93
+ * @param options Matcher options.
105
94
  * @returns A Promise that resolves when the assertion completes.
106
95
  *
107
96
  * @example
108
- * await expect(clipboard).toHaveData('Copied value');
109
- * await expect(clipboard).toHaveData({ id: 123, status: 'success' });
97
+ * await expect(clipboard).toHaveJSONContent({ id: 123, status: 'success' });
110
98
  */
111
- toHaveData(expected: unknown, options?: MatcherOptions): Promise<R>;
99
+ toHaveJSONContent(expected: unknown, options?: TimeoutMatcherOptions): Promise<R>;
112
100
  }
113
101
  }
114
102
  }
115
103
 
116
104
  /**
117
- * Asserts that the clipboard content matches the expected value.
118
- * Uses smart polling to wait for the clipboard to be updated.
119
- * If the `expected` value is an object, it attempts to parse the clipboard
120
- * content as JSON before comparing.
105
+ * Asserts that the clipboard content matches the expected text value.
121
106
  *
122
107
  * @this ExpectMatcherState
123
108
  * @param clipboard The Clipboard utility instance.
124
- * @param expected The string or object to compare against the clipboard content.
125
- * @param options Optional settings for the matcher, such as timeout.
109
+ * @param expected The expected text value.
110
+ * @param options Matcher options.
126
111
  * @returns A Promise that resolves to a MatcherReturnType object.
127
112
  */
128
- declare function toHaveData(this: ExpectMatcherState, clipboard: ClipboardHandler, expected: unknown, options?: MatcherOptions): Promise<{
129
- name: string;
130
- message: () => string;
131
- pass: boolean;
132
- expected?: unknown;
133
- actual?: any;
134
- log?: string[];
135
- timeout?: number;
136
- }>;
113
+ declare function toHaveTextContent(this: ExpectMatcherState, clipboard: ClipboardHandler, expected: string | RegExp, options?: TimeoutMatcherOptions & IgnoreCaseMatcherOptions & TrimMatcherOptions): Promise<MatcherReturnType>;
137
114
 
138
115
  /**
139
116
  * Asserts that the clipboard content matches the expected JSON value.
@@ -144,35 +121,114 @@ declare function toHaveData(this: ExpectMatcherState, clipboard: ClipboardHandle
144
121
  * @param options Matcher options.
145
122
  * @returns A Promise that resolves to a MatcherReturnType object.
146
123
  */
147
- declare function toHaveJSON(this: ExpectMatcherState, clipboard: ClipboardHandler, expected: unknown, options?: MatcherOptions): Promise<MatcherReturnType>;
124
+ declare function toHaveJSONContent(this: ExpectMatcherState, clipboard: ClipboardHandler, expected: unknown, options?: TimeoutMatcherOptions): Promise<MatcherReturnType>;
148
125
 
149
126
  /**
150
- * Asserts that the clipboard content matches the expected text value.
127
+ * Asserts that the clipboard content is blank (empty string).
151
128
  *
152
129
  * @this ExpectMatcherState
153
130
  * @param clipboard The Clipboard utility instance.
154
- * @param expected The expected text value.
155
131
  * @param options Matcher options.
156
132
  * @returns A Promise that resolves to a MatcherReturnType object.
157
133
  */
158
- declare function toHaveText(this: ExpectMatcherState, clipboard: ClipboardHandler, expected: string, options?: MatcherOptions): Promise<MatcherReturnType>;
134
+ declare function toBeBlank(this: ExpectMatcherState, clipboard: ClipboardHandler, options?: TimeoutMatcherOptions & TrimMatcherOptions): Promise<MatcherReturnType>;
159
135
 
160
- declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArgs & _playwright_test.PlaywrightTestOptions & {
136
+ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs & playwright_test.PlaywrightTestOptions & {
161
137
  clipboard: ClipboardHandler;
162
- }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions>;
163
- declare const expect: _playwright_test.Expect<{
164
- toHaveText: typeof toHaveText;
165
- toHaveJSON: typeof toHaveJSON;
166
- toHaveData: typeof toHaveData;
138
+ }, playwright_test.PlaywrightWorkerArgs & playwright_test.PlaywrightWorkerOptions>;
139
+ declare const expect: playwright_test.Expect<{
140
+ toBeBlank: typeof toBeBlank;
141
+ toHaveJSONContent: typeof toHaveJSONContent;
142
+ toHaveTextContent: typeof toHaveTextContent;
167
143
  }>;
168
144
 
145
+ declare const firefoxClipboardPrefs: {
146
+ 'dom.events.testing.asyncClipboard': boolean;
147
+ 'dom.events.asyncClipboard.readText': boolean;
148
+ 'dom.events.asyncClipboard.writeText': boolean;
149
+ 'permissions.default.clipboard-read': number;
150
+ 'permissions.default.clipboard-write': number;
151
+ };
152
+
153
+ type BrowserName = 'chromium' | 'firefox' | 'webkit';
154
+
155
+ /**
156
+ * A fixture that provides an instance of the Clipboard utility for interacting with the system clipboard.
157
+ * It allows reading from the clipboard during tests.
158
+ */
159
+ declare const clipboardFixture: TestFixture<ClipboardHandler, {
160
+ page: Page;
161
+ browserName: BrowserName;
162
+ }>;
163
+
164
+ /**
165
+ * A fixture that provides a BrowserContext with clipboard permissions granted for Chromium browsers.
166
+ */
167
+ declare const contextFixture: TestFixture<BrowserContext, {
168
+ context: BrowserContext;
169
+ browserName: BrowserName;
170
+ }>;
171
+
172
+ /**
173
+ * A collection of fixtures related to clipboard testing, including the clipboard fixture and context fixture.
174
+ * These fixtures can be used in Playwright tests to facilitate clipboard interactions and context management.
175
+ */
176
+ declare const clipboardFixtures: {
177
+ context: playwright_test.TestFixture<playwright_core.BrowserContext, {
178
+ context: playwright_core.BrowserContext;
179
+ browserName: BrowserName;
180
+ }>;
181
+ clipboard: playwright_test.TestFixture<ClipboardHandler, {
182
+ page: playwright_core.Page;
183
+ browserName: BrowserName;
184
+ }>;
185
+ };
186
+
169
187
  /**
170
188
  * Export an object containing all the custom clipboard matchers for Playwright.
171
189
  */
172
190
  declare const clipboardMatchers: {
173
- toHaveText: typeof toHaveText;
174
- toHaveJSON: typeof toHaveJSON;
175
- toHaveData: typeof toHaveData;
191
+ toBeBlank: typeof toBeBlank;
192
+ toHaveJSONContent: typeof toHaveJSONContent;
193
+ toHaveTextContent: typeof toHaveTextContent;
194
+ };
195
+
196
+ /**
197
+ * This module contains regular expression patterns for various common formats.
198
+ * These patterns can be used for validation purposes in applications.
199
+ */
200
+ declare const PATTERNS: {
201
+ /**
202
+ * UUID v1-v5 (example: 123e4567-e89b-12d3-a456-426614174000).
203
+ */
204
+ readonly UUID: RegExp;
205
+ /**
206
+ * Email addresses (example: user@example.com).
207
+ */
208
+ readonly EMAIL: RegExp;
209
+ /**
210
+ * JWT tokens (example: header.payload.signature).
211
+ */
212
+ readonly JWT: RegExp;
213
+ /**
214
+ * Authorization Bearer tokens (example: Bearer <token>).
215
+ */
216
+ readonly BEARER: RegExp;
217
+ /**
218
+ * HEX-colors (example: #FFF, #FFFFFF, #FFFFFFFF).
219
+ */
220
+ readonly HEX_COLOR: RegExp;
221
+ /**
222
+ * IP (IPv4, IPv6 or any).
223
+ */
224
+ readonly IP: {
225
+ /** IPv4 (example: 192.168.1.1 or 127.0.0.1) */
226
+ readonly V4: RegExp;
227
+ /** IPv6 (example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334) */
228
+ readonly V6: RegExp;
229
+ /** Any IP address (IPv4 or IPv6) */
230
+ readonly ANY: RegExp;
231
+ };
176
232
  };
177
233
 
178
- export { ClipboardHandler, clipboardFixture, clipboardMatchers, expect, firefoxClipboardPrefs, test };
234
+ export { ClipboardHandler, PATTERNS, clipboardFixture, clipboardFixtures, clipboardMatchers, contextFixture, expect, firefoxClipboardPrefs, test };