@stablyai/internal-playwright 0.1.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.
Files changed (297) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +5 -0
  3. package/README.md +168 -0
  4. package/ThirdPartyNotices.txt +6277 -0
  5. package/cli.js +19 -0
  6. package/index.d.ts +17 -0
  7. package/index.js +17 -0
  8. package/index.mjs +18 -0
  9. package/jsx-runtime.js +42 -0
  10. package/jsx-runtime.mjs +21 -0
  11. package/lib/agents/generateAgents.js +265 -0
  12. package/lib/agents/generator.md +102 -0
  13. package/lib/agents/healer.md +78 -0
  14. package/lib/agents/planner.md +135 -0
  15. package/lib/cli.js +274 -0
  16. package/lib/common/config.js +274 -0
  17. package/lib/common/config.js.map +7 -0
  18. package/lib/common/configLoader.js +377 -0
  19. package/lib/common/configLoader.js.map +7 -0
  20. package/lib/common/esmLoaderHost.js +102 -0
  21. package/lib/common/esmLoaderHost.js.map +7 -0
  22. package/lib/common/expectBundle.js +52 -0
  23. package/lib/common/expectBundle.js.map +7 -0
  24. package/lib/common/expectBundleImpl.js +389 -0
  25. package/lib/common/expectBundleImpl.js.map +7 -0
  26. package/lib/common/fixtures.js +302 -0
  27. package/lib/common/fixtures.js.map +7 -0
  28. package/lib/common/globals.js +58 -0
  29. package/lib/common/globals.js.map +7 -0
  30. package/lib/common/ipc.js +60 -0
  31. package/lib/common/ipc.js.map +7 -0
  32. package/lib/common/poolBuilder.js +85 -0
  33. package/lib/common/poolBuilder.js.map +7 -0
  34. package/lib/common/process.js +104 -0
  35. package/lib/common/process.js.map +7 -0
  36. package/lib/common/suiteUtils.js +140 -0
  37. package/lib/common/suiteUtils.js.map +7 -0
  38. package/lib/common/test.js +321 -0
  39. package/lib/common/test.js.map +7 -0
  40. package/lib/common/testLoader.js +100 -0
  41. package/lib/common/testLoader.js.map +7 -0
  42. package/lib/common/testType.js +310 -0
  43. package/lib/common/testType.js.map +7 -0
  44. package/lib/fsWatcher.js +67 -0
  45. package/lib/fsWatcher.js.map +7 -0
  46. package/lib/index.js +696 -0
  47. package/lib/index.js.map +7 -0
  48. package/lib/internalsForTest.js +42 -0
  49. package/lib/internalsForTest.js.map +7 -0
  50. package/lib/isomorphic/events.js +77 -0
  51. package/lib/isomorphic/events.js.map +7 -0
  52. package/lib/isomorphic/folders.js +30 -0
  53. package/lib/isomorphic/folders.js.map +7 -0
  54. package/lib/isomorphic/stringInternPool.js +69 -0
  55. package/lib/isomorphic/stringInternPool.js.map +7 -0
  56. package/lib/isomorphic/teleReceiver.js +507 -0
  57. package/lib/isomorphic/teleReceiver.js.map +7 -0
  58. package/lib/isomorphic/teleSuiteUpdater.js +137 -0
  59. package/lib/isomorphic/teleSuiteUpdater.js.map +7 -0
  60. package/lib/isomorphic/testServerConnection.js +211 -0
  61. package/lib/isomorphic/testServerConnection.js.map +7 -0
  62. package/lib/isomorphic/testServerInterface.js +16 -0
  63. package/lib/isomorphic/testServerInterface.js.map +7 -0
  64. package/lib/isomorphic/testTree.js +334 -0
  65. package/lib/isomorphic/testTree.js.map +7 -0
  66. package/lib/isomorphic/types.d.js +16 -0
  67. package/lib/isomorphic/types.d.js.map +7 -0
  68. package/lib/loader/loaderMain.js +59 -0
  69. package/lib/loader/loaderMain.js.map +7 -0
  70. package/lib/matchers/expect.js +325 -0
  71. package/lib/matchers/expect.js.map +7 -0
  72. package/lib/matchers/matcherHint.js +87 -0
  73. package/lib/matchers/matcherHint.js.map +7 -0
  74. package/lib/matchers/matchers.js +366 -0
  75. package/lib/matchers/matchers.js.map +7 -0
  76. package/lib/matchers/toBeTruthy.js +73 -0
  77. package/lib/matchers/toBeTruthy.js.map +7 -0
  78. package/lib/matchers/toEqual.js +99 -0
  79. package/lib/matchers/toEqual.js.map +7 -0
  80. package/lib/matchers/toHaveURL.js +102 -0
  81. package/lib/matchers/toHaveURL.js.map +7 -0
  82. package/lib/matchers/toMatchAriaSnapshot.js +159 -0
  83. package/lib/matchers/toMatchAriaSnapshot.js.map +7 -0
  84. package/lib/matchers/toMatchSnapshot.js +359 -0
  85. package/lib/matchers/toMatchSnapshot.js.map +7 -0
  86. package/lib/matchers/toMatchText.js +99 -0
  87. package/lib/matchers/toMatchText.js.map +7 -0
  88. package/lib/mcp/browser/actions.d.js +16 -0
  89. package/lib/mcp/browser/backend.js +93 -0
  90. package/lib/mcp/browser/backend.js.map +7 -0
  91. package/lib/mcp/browser/browserContextFactory.js +296 -0
  92. package/lib/mcp/browser/browserServerBackend.js +76 -0
  93. package/lib/mcp/browser/codegen.js +66 -0
  94. package/lib/mcp/browser/config.js +385 -0
  95. package/lib/mcp/browser/context.js +287 -0
  96. package/lib/mcp/browser/response.js +228 -0
  97. package/lib/mcp/browser/sessionLog.js +160 -0
  98. package/lib/mcp/browser/tab.js +277 -0
  99. package/lib/mcp/browser/tool.js +30 -0
  100. package/lib/mcp/browser/tool.js.map +7 -0
  101. package/lib/mcp/browser/tools/common.js +63 -0
  102. package/lib/mcp/browser/tools/console.js +44 -0
  103. package/lib/mcp/browser/tools/dialogs.js +60 -0
  104. package/lib/mcp/browser/tools/evaluate.js +70 -0
  105. package/lib/mcp/browser/tools/files.js +58 -0
  106. package/lib/mcp/browser/tools/form.js +74 -0
  107. package/lib/mcp/browser/tools/install.js +69 -0
  108. package/lib/mcp/browser/tools/keyboard.js +85 -0
  109. package/lib/mcp/browser/tools/mouse.js +107 -0
  110. package/lib/mcp/browser/tools/navigate.js +62 -0
  111. package/lib/mcp/browser/tools/network.js +54 -0
  112. package/lib/mcp/browser/tools/pdf.js +59 -0
  113. package/lib/mcp/browser/tools/screenshot.js +88 -0
  114. package/lib/mcp/browser/tools/snapshot.js +182 -0
  115. package/lib/mcp/browser/tools/tabs.js +67 -0
  116. package/lib/mcp/browser/tools/tool.js +49 -0
  117. package/lib/mcp/browser/tools/tracing.js +74 -0
  118. package/lib/mcp/browser/tools/utils.js +100 -0
  119. package/lib/mcp/browser/tools/verify.js +154 -0
  120. package/lib/mcp/browser/tools/wait.js +63 -0
  121. package/lib/mcp/browser/tools.js +80 -0
  122. package/lib/mcp/browser/tools.js.map +7 -0
  123. package/lib/mcp/browser/watchdog.js +44 -0
  124. package/lib/mcp/config.d.js +16 -0
  125. package/lib/mcp/extension/cdpRelay.js +351 -0
  126. package/lib/mcp/extension/extensionContextFactory.js +75 -0
  127. package/lib/mcp/extension/protocol.js +28 -0
  128. package/lib/mcp/index.js +61 -0
  129. package/lib/mcp/log.js +35 -0
  130. package/lib/mcp/program.js +96 -0
  131. package/lib/mcp/sdk/bundle.js +81 -0
  132. package/lib/mcp/sdk/bundle.js.map +7 -0
  133. package/lib/mcp/sdk/call.js +49 -0
  134. package/lib/mcp/sdk/call.js.map +7 -0
  135. package/lib/mcp/sdk/exports.js +32 -0
  136. package/lib/mcp/sdk/exports.js.map +7 -0
  137. package/lib/mcp/sdk/http.js +187 -0
  138. package/lib/mcp/sdk/http.js.map +7 -0
  139. package/lib/mcp/sdk/inProcessTransport.js +71 -0
  140. package/lib/mcp/sdk/inProcessTransport.js.map +7 -0
  141. package/lib/mcp/sdk/mdb.js +206 -0
  142. package/lib/mcp/sdk/mdb.js.map +7 -0
  143. package/lib/mcp/sdk/proxyBackend.js +128 -0
  144. package/lib/mcp/sdk/proxyBackend.js.map +7 -0
  145. package/lib/mcp/sdk/server.js +189 -0
  146. package/lib/mcp/sdk/server.js.map +7 -0
  147. package/lib/mcp/sdk/tool.js +51 -0
  148. package/lib/mcp/sdk/tool.js.map +7 -0
  149. package/lib/mcp/test/backend.js +67 -0
  150. package/lib/mcp/test/backend.js.map +7 -0
  151. package/lib/mcp/test/browserBackend.js +98 -0
  152. package/lib/mcp/test/context.js +48 -0
  153. package/lib/mcp/test/context.js.map +7 -0
  154. package/lib/mcp/test/generatorTools.js +122 -0
  155. package/lib/mcp/test/plannerTools.js +46 -0
  156. package/lib/mcp/test/seed.js +72 -0
  157. package/lib/mcp/test/streams.js +39 -0
  158. package/lib/mcp/test/streams.js.map +7 -0
  159. package/lib/mcp/test/testBackend.js +97 -0
  160. package/lib/mcp/test/testContext.js +176 -0
  161. package/lib/mcp/test/testTool.js +30 -0
  162. package/lib/mcp/test/testTools.js +115 -0
  163. package/lib/mcp/test/tool.js +30 -0
  164. package/lib/mcp/test/tool.js.map +7 -0
  165. package/lib/mcp/test/tools.js +150 -0
  166. package/lib/mcp/test/tools.js.map +7 -0
  167. package/lib/mcp/vscode/host.js +187 -0
  168. package/lib/mcp/vscode/main.js +77 -0
  169. package/lib/mcpBundleImpl.js +41 -0
  170. package/lib/mcpBundleImpl.js.map +7 -0
  171. package/lib/plugins/gitCommitInfoPlugin.js +198 -0
  172. package/lib/plugins/gitCommitInfoPlugin.js.map +7 -0
  173. package/lib/plugins/index.js +28 -0
  174. package/lib/plugins/index.js.map +7 -0
  175. package/lib/plugins/webServerPlugin.js +209 -0
  176. package/lib/plugins/webServerPlugin.js.map +7 -0
  177. package/lib/program.js +412 -0
  178. package/lib/program.js.map +7 -0
  179. package/lib/reporters/base.js +609 -0
  180. package/lib/reporters/base.js.map +7 -0
  181. package/lib/reporters/blob.js +135 -0
  182. package/lib/reporters/blob.js.map +7 -0
  183. package/lib/reporters/dot.js +82 -0
  184. package/lib/reporters/dot.js.map +7 -0
  185. package/lib/reporters/empty.js +32 -0
  186. package/lib/reporters/empty.js.map +7 -0
  187. package/lib/reporters/github.js +128 -0
  188. package/lib/reporters/github.js.map +7 -0
  189. package/lib/reporters/html.js +644 -0
  190. package/lib/reporters/html.js.map +7 -0
  191. package/lib/reporters/internalReporter.js +130 -0
  192. package/lib/reporters/internalReporter.js.map +7 -0
  193. package/lib/reporters/json.js +254 -0
  194. package/lib/reporters/json.js.map +7 -0
  195. package/lib/reporters/junit.js +230 -0
  196. package/lib/reporters/junit.js.map +7 -0
  197. package/lib/reporters/line.js +113 -0
  198. package/lib/reporters/line.js.map +7 -0
  199. package/lib/reporters/list.js +235 -0
  200. package/lib/reporters/list.js.map +7 -0
  201. package/lib/reporters/listModeReporter.js +69 -0
  202. package/lib/reporters/listModeReporter.js.map +7 -0
  203. package/lib/reporters/markdown.js +144 -0
  204. package/lib/reporters/markdown.js.map +7 -0
  205. package/lib/reporters/merge.js +535 -0
  206. package/lib/reporters/merge.js.map +7 -0
  207. package/lib/reporters/multiplexer.js +104 -0
  208. package/lib/reporters/multiplexer.js.map +7 -0
  209. package/lib/reporters/reporterV2.js +102 -0
  210. package/lib/reporters/reporterV2.js.map +7 -0
  211. package/lib/reporters/teleEmitter.js +297 -0
  212. package/lib/reporters/teleEmitter.js.map +7 -0
  213. package/lib/reporters/versions/blobV1.js +16 -0
  214. package/lib/reporters/versions/blobV1.js.map +7 -0
  215. package/lib/runner/dispatcher.js +491 -0
  216. package/lib/runner/dispatcher.js.map +7 -0
  217. package/lib/runner/failureTracker.js +72 -0
  218. package/lib/runner/failureTracker.js.map +7 -0
  219. package/lib/runner/lastRun.js +77 -0
  220. package/lib/runner/lastRun.js.map +7 -0
  221. package/lib/runner/loadUtils.js +333 -0
  222. package/lib/runner/loadUtils.js.map +7 -0
  223. package/lib/runner/loaderHost.js +89 -0
  224. package/lib/runner/loaderHost.js.map +7 -0
  225. package/lib/runner/processHost.js +161 -0
  226. package/lib/runner/processHost.js.map +7 -0
  227. package/lib/runner/projectUtils.js +241 -0
  228. package/lib/runner/projectUtils.js.map +7 -0
  229. package/lib/runner/rebase.js +189 -0
  230. package/lib/runner/rebase.js.map +7 -0
  231. package/lib/runner/reporters.js +137 -0
  232. package/lib/runner/reporters.js.map +7 -0
  233. package/lib/runner/runner.js +173 -0
  234. package/lib/runner/sigIntWatcher.js +96 -0
  235. package/lib/runner/sigIntWatcher.js.map +7 -0
  236. package/lib/runner/taskRunner.js +127 -0
  237. package/lib/runner/taskRunner.js.map +7 -0
  238. package/lib/runner/tasks.js +410 -0
  239. package/lib/runner/tasks.js.map +7 -0
  240. package/lib/runner/testGroups.js +117 -0
  241. package/lib/runner/testGroups.js.map +7 -0
  242. package/lib/runner/testRunner.js +390 -0
  243. package/lib/runner/testRunner.js.map +7 -0
  244. package/lib/runner/testServer.js +264 -0
  245. package/lib/runner/testServer.js.map +7 -0
  246. package/lib/runner/uiMode.js +271 -0
  247. package/lib/runner/uiModeReporter.js +30 -0
  248. package/lib/runner/uiModeReporter.js.map +7 -0
  249. package/lib/runner/vcs.js +72 -0
  250. package/lib/runner/vcs.js.map +7 -0
  251. package/lib/runner/watchMode.js +395 -0
  252. package/lib/runner/watchMode.js.map +7 -0
  253. package/lib/runner/workerHost.js +95 -0
  254. package/lib/runner/workerHost.js.map +7 -0
  255. package/lib/store.js +98 -0
  256. package/lib/third_party/pirates.js +62 -0
  257. package/lib/third_party/pirates.js.map +7 -0
  258. package/lib/third_party/tsconfig-loader.js +103 -0
  259. package/lib/third_party/tsconfig-loader.js.map +7 -0
  260. package/lib/transform/babelBundle.js +43 -0
  261. package/lib/transform/babelBundle.js.map +7 -0
  262. package/lib/transform/babelBundleImpl.js +461 -0
  263. package/lib/transform/babelBundleImpl.js.map +7 -0
  264. package/lib/transform/compilationCache.js +272 -0
  265. package/lib/transform/compilationCache.js.map +7 -0
  266. package/lib/transform/esmLoader.js +104 -0
  267. package/lib/transform/esmLoader.js.map +7 -0
  268. package/lib/transform/esmUtils.js +32 -0
  269. package/lib/transform/portTransport.js +67 -0
  270. package/lib/transform/portTransport.js.map +7 -0
  271. package/lib/transform/transform.js +293 -0
  272. package/lib/transform/transform.js.map +7 -0
  273. package/lib/util.js +403 -0
  274. package/lib/util.js.map +7 -0
  275. package/lib/utilsBundle.js +43 -0
  276. package/lib/utilsBundle.js.map +7 -0
  277. package/lib/utilsBundleImpl.js +100 -0
  278. package/lib/utilsBundleImpl.js.map +7 -0
  279. package/lib/worker/fixtureRunner.js +258 -0
  280. package/lib/worker/fixtureRunner.js.map +7 -0
  281. package/lib/worker/stepContext.js +34 -0
  282. package/lib/worker/testInfo.js +508 -0
  283. package/lib/worker/testInfo.js.map +7 -0
  284. package/lib/worker/testTracing.js +344 -0
  285. package/lib/worker/testTracing.js.map +7 -0
  286. package/lib/worker/timeoutManager.js +174 -0
  287. package/lib/worker/timeoutManager.js.map +7 -0
  288. package/lib/worker/util.js +31 -0
  289. package/lib/worker/util.js.map +7 -0
  290. package/lib/worker/workerMain.js +520 -0
  291. package/lib/worker/workerMain.js.map +7 -0
  292. package/package.json +74 -0
  293. package/test.d.ts +18 -0
  294. package/test.js +24 -0
  295. package/test.mjs +33 -0
  296. package/types/test.d.ts +10217 -0
  297. package/types/testReporter.d.ts +816 -0
@@ -0,0 +1,366 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var matchers_exports = {};
20
+ __export(matchers_exports, {
21
+ toBeAttached: () => toBeAttached,
22
+ toBeChecked: () => toBeChecked,
23
+ toBeDisabled: () => toBeDisabled,
24
+ toBeEditable: () => toBeEditable,
25
+ toBeEmpty: () => toBeEmpty,
26
+ toBeEnabled: () => toBeEnabled,
27
+ toBeFocused: () => toBeFocused,
28
+ toBeHidden: () => toBeHidden,
29
+ toBeInViewport: () => toBeInViewport,
30
+ toBeOK: () => toBeOK,
31
+ toBeVisible: () => toBeVisible,
32
+ toContainClass: () => toContainClass,
33
+ toContainText: () => toContainText,
34
+ toHaveAccessibleDescription: () => toHaveAccessibleDescription,
35
+ toHaveAccessibleErrorMessage: () => toHaveAccessibleErrorMessage,
36
+ toHaveAccessibleName: () => toHaveAccessibleName,
37
+ toHaveAttribute: () => toHaveAttribute,
38
+ toHaveCSS: () => toHaveCSS,
39
+ toHaveClass: () => toHaveClass,
40
+ toHaveCount: () => toHaveCount,
41
+ toHaveId: () => toHaveId,
42
+ toHaveJSProperty: () => toHaveJSProperty,
43
+ toHaveRole: () => toHaveRole,
44
+ toHaveText: () => toHaveText,
45
+ toHaveTitle: () => toHaveTitle,
46
+ toHaveURL: () => toHaveURL,
47
+ toHaveValue: () => toHaveValue,
48
+ toHaveValues: () => toHaveValues,
49
+ toPass: () => toPass
50
+ });
51
+ module.exports = __toCommonJS(matchers_exports);
52
+ var import_utils = require("playwright-core/lib/utils");
53
+ var import_utils2 = require("playwright-core/lib/utils");
54
+ var import_util = require("../util");
55
+ var import_toBeTruthy = require("./toBeTruthy");
56
+ var import_toEqual = require("./toEqual");
57
+ var import_toHaveURL = require("./toHaveURL");
58
+ var import_toMatchText = require("./toMatchText");
59
+ var import_config = require("../common/config");
60
+ var import_globals = require("../common/globals");
61
+ var import_testInfo = require("../worker/testInfo");
62
+ var import_matcherHint = require("./matcherHint");
63
+ function toBeAttached(locator, options) {
64
+ const attached = !options || options.attached === void 0 || options.attached;
65
+ const expected = attached ? "attached" : "detached";
66
+ const arg = attached ? "" : "{ attached: false }";
67
+ return import_toBeTruthy.toBeTruthy.call(this, "toBeAttached", locator, "Locator", expected, arg, async (isNot, timeout) => {
68
+ return await locator._expect(attached ? "to.be.attached" : "to.be.detached", { isNot, timeout });
69
+ }, options);
70
+ }
71
+ function toBeChecked(locator, options) {
72
+ const checked = options?.checked;
73
+ const indeterminate = options?.indeterminate;
74
+ const expectedValue = {
75
+ checked,
76
+ indeterminate
77
+ };
78
+ let expected;
79
+ let arg;
80
+ if (options?.indeterminate) {
81
+ expected = "indeterminate";
82
+ arg = `{ indeterminate: true }`;
83
+ } else {
84
+ expected = options?.checked === false ? "unchecked" : "checked";
85
+ arg = options?.checked === false ? `{ checked: false }` : "";
86
+ }
87
+ return import_toBeTruthy.toBeTruthy.call(this, "toBeChecked", locator, "Locator", expected, arg, async (isNot, timeout) => {
88
+ return await locator._expect("to.be.checked", { isNot, timeout, expectedValue });
89
+ }, options);
90
+ }
91
+ function toBeDisabled(locator, options) {
92
+ return import_toBeTruthy.toBeTruthy.call(this, "toBeDisabled", locator, "Locator", "disabled", "", async (isNot, timeout) => {
93
+ return await locator._expect("to.be.disabled", { isNot, timeout });
94
+ }, options);
95
+ }
96
+ function toBeEditable(locator, options) {
97
+ const editable = !options || options.editable === void 0 || options.editable;
98
+ const expected = editable ? "editable" : "readOnly";
99
+ const arg = editable ? "" : "{ editable: false }";
100
+ return import_toBeTruthy.toBeTruthy.call(this, "toBeEditable", locator, "Locator", expected, arg, async (isNot, timeout) => {
101
+ return await locator._expect(editable ? "to.be.editable" : "to.be.readonly", { isNot, timeout });
102
+ }, options);
103
+ }
104
+ function toBeEmpty(locator, options) {
105
+ return import_toBeTruthy.toBeTruthy.call(this, "toBeEmpty", locator, "Locator", "empty", "", async (isNot, timeout) => {
106
+ return await locator._expect("to.be.empty", { isNot, timeout });
107
+ }, options);
108
+ }
109
+ function toBeEnabled(locator, options) {
110
+ const enabled = !options || options.enabled === void 0 || options.enabled;
111
+ const expected = enabled ? "enabled" : "disabled";
112
+ const arg = enabled ? "" : "{ enabled: false }";
113
+ return import_toBeTruthy.toBeTruthy.call(this, "toBeEnabled", locator, "Locator", expected, arg, async (isNot, timeout) => {
114
+ return await locator._expect(enabled ? "to.be.enabled" : "to.be.disabled", { isNot, timeout });
115
+ }, options);
116
+ }
117
+ function toBeFocused(locator, options) {
118
+ return import_toBeTruthy.toBeTruthy.call(this, "toBeFocused", locator, "Locator", "focused", "", async (isNot, timeout) => {
119
+ return await locator._expect("to.be.focused", { isNot, timeout });
120
+ }, options);
121
+ }
122
+ function toBeHidden(locator, options) {
123
+ return import_toBeTruthy.toBeTruthy.call(this, "toBeHidden", locator, "Locator", "hidden", "", async (isNot, timeout) => {
124
+ return await locator._expect("to.be.hidden", { isNot, timeout });
125
+ }, options);
126
+ }
127
+ function toBeVisible(locator, options) {
128
+ const visible = !options || options.visible === void 0 || options.visible;
129
+ const expected = visible ? "visible" : "hidden";
130
+ const arg = visible ? "" : "{ visible: false }";
131
+ return import_toBeTruthy.toBeTruthy.call(this, "toBeVisible", locator, "Locator", expected, arg, async (isNot, timeout) => {
132
+ return await locator._expect(visible ? "to.be.visible" : "to.be.hidden", { isNot, timeout });
133
+ }, options);
134
+ }
135
+ function toBeInViewport(locator, options) {
136
+ return import_toBeTruthy.toBeTruthy.call(this, "toBeInViewport", locator, "Locator", "in viewport", "", async (isNot, timeout) => {
137
+ return await locator._expect("to.be.in.viewport", { isNot, expectedNumber: options?.ratio, timeout });
138
+ }, options);
139
+ }
140
+ function toContainText(locator, expected, options = {}) {
141
+ if (Array.isArray(expected)) {
142
+ return import_toEqual.toEqual.call(this, "toContainText", locator, "Locator", async (isNot, timeout) => {
143
+ const expectedText = (0, import_utils.serializeExpectedTextValues)(expected, { matchSubstring: true, normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });
144
+ return await locator._expect("to.contain.text.array", { expectedText, isNot, useInnerText: options.useInnerText, timeout });
145
+ }, expected, { ...options, contains: true });
146
+ } else {
147
+ return import_toMatchText.toMatchText.call(this, "toContainText", locator, "Locator", async (isNot, timeout) => {
148
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected], { matchSubstring: true, normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });
149
+ return await locator._expect("to.have.text", { expectedText, isNot, useInnerText: options.useInnerText, timeout });
150
+ }, expected, { ...options, matchSubstring: true });
151
+ }
152
+ }
153
+ function toHaveAccessibleDescription(locator, expected, options) {
154
+ return import_toMatchText.toMatchText.call(this, "toHaveAccessibleDescription", locator, "Locator", async (isNot, timeout) => {
155
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });
156
+ return await locator._expect("to.have.accessible.description", { expectedText, isNot, timeout });
157
+ }, expected, options);
158
+ }
159
+ function toHaveAccessibleName(locator, expected, options) {
160
+ return import_toMatchText.toMatchText.call(this, "toHaveAccessibleName", locator, "Locator", async (isNot, timeout) => {
161
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });
162
+ return await locator._expect("to.have.accessible.name", { expectedText, isNot, timeout });
163
+ }, expected, options);
164
+ }
165
+ function toHaveAccessibleErrorMessage(locator, expected, options) {
166
+ return import_toMatchText.toMatchText.call(this, "toHaveAccessibleErrorMessage", locator, "Locator", async (isNot, timeout) => {
167
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });
168
+ return await locator._expect("to.have.accessible.error.message", { expectedText, isNot, timeout });
169
+ }, expected, options);
170
+ }
171
+ function toHaveAttribute(locator, name, expected, options) {
172
+ if (!options) {
173
+ if (typeof expected === "object" && !(0, import_utils.isRegExp)(expected)) {
174
+ options = expected;
175
+ expected = void 0;
176
+ }
177
+ }
178
+ if (expected === void 0) {
179
+ return import_toBeTruthy.toBeTruthy.call(this, "toHaveAttribute", locator, "Locator", "have attribute", "", async (isNot, timeout) => {
180
+ return await locator._expect("to.have.attribute", { expressionArg: name, isNot, timeout });
181
+ }, options);
182
+ }
183
+ return import_toMatchText.toMatchText.call(this, "toHaveAttribute", locator, "Locator", async (isNot, timeout) => {
184
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected], { ignoreCase: options?.ignoreCase });
185
+ return await locator._expect("to.have.attribute.value", { expressionArg: name, expectedText, isNot, timeout });
186
+ }, expected, options);
187
+ }
188
+ function toHaveClass(locator, expected, options) {
189
+ if (Array.isArray(expected)) {
190
+ return import_toEqual.toEqual.call(this, "toHaveClass", locator, "Locator", async (isNot, timeout) => {
191
+ const expectedText = (0, import_utils.serializeExpectedTextValues)(expected);
192
+ return await locator._expect("to.have.class.array", { expectedText, isNot, timeout });
193
+ }, expected, options);
194
+ } else {
195
+ return import_toMatchText.toMatchText.call(this, "toHaveClass", locator, "Locator", async (isNot, timeout) => {
196
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected]);
197
+ return await locator._expect("to.have.class", { expectedText, isNot, timeout });
198
+ }, expected, options);
199
+ }
200
+ }
201
+ function toContainClass(locator, expected, options) {
202
+ if (Array.isArray(expected)) {
203
+ if (expected.some((e) => (0, import_utils.isRegExp)(e)))
204
+ throw new Error(`"expected" argument in toContainClass cannot contain RegExp values`);
205
+ return import_toEqual.toEqual.call(this, "toContainClass", locator, "Locator", async (isNot, timeout) => {
206
+ const expectedText = (0, import_utils.serializeExpectedTextValues)(expected);
207
+ return await locator._expect("to.contain.class.array", { expectedText, isNot, timeout });
208
+ }, expected, options);
209
+ } else {
210
+ if ((0, import_utils.isRegExp)(expected))
211
+ throw new Error(`"expected" argument in toContainClass cannot be a RegExp value`);
212
+ return import_toMatchText.toMatchText.call(this, "toContainClass", locator, "Locator", async (isNot, timeout) => {
213
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected]);
214
+ return await locator._expect("to.contain.class", { expectedText, isNot, timeout });
215
+ }, expected, options);
216
+ }
217
+ }
218
+ function toHaveCount(locator, expected, options) {
219
+ return import_toEqual.toEqual.call(this, "toHaveCount", locator, "Locator", async (isNot, timeout) => {
220
+ return await locator._expect("to.have.count", { expectedNumber: expected, isNot, timeout });
221
+ }, expected, options);
222
+ }
223
+ function toHaveCSS(locator, name, expected, options) {
224
+ return import_toMatchText.toMatchText.call(this, "toHaveCSS", locator, "Locator", async (isNot, timeout) => {
225
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected]);
226
+ return await locator._expect("to.have.css", { expressionArg: name, expectedText, isNot, timeout });
227
+ }, expected, options);
228
+ }
229
+ function toHaveId(locator, expected, options) {
230
+ return import_toMatchText.toMatchText.call(this, "toHaveId", locator, "Locator", async (isNot, timeout) => {
231
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected]);
232
+ return await locator._expect("to.have.id", { expectedText, isNot, timeout });
233
+ }, expected, options);
234
+ }
235
+ function toHaveJSProperty(locator, name, expected, options) {
236
+ return import_toEqual.toEqual.call(this, "toHaveJSProperty", locator, "Locator", async (isNot, timeout) => {
237
+ return await locator._expect("to.have.property", { expressionArg: name, expectedValue: expected, isNot, timeout });
238
+ }, expected, options);
239
+ }
240
+ function toHaveRole(locator, expected, options) {
241
+ if (!(0, import_utils.isString)(expected))
242
+ throw new Error(`"role" argument in toHaveRole must be a string`);
243
+ return import_toMatchText.toMatchText.call(this, "toHaveRole", locator, "Locator", async (isNot, timeout) => {
244
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected]);
245
+ return await locator._expect("to.have.role", { expectedText, isNot, timeout });
246
+ }, expected, options);
247
+ }
248
+ function toHaveText(locator, expected, options = {}) {
249
+ if (Array.isArray(expected)) {
250
+ return import_toEqual.toEqual.call(this, "toHaveText", locator, "Locator", async (isNot, timeout) => {
251
+ const expectedText = (0, import_utils.serializeExpectedTextValues)(expected, { normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });
252
+ return await locator._expect("to.have.text.array", { expectedText, isNot, useInnerText: options?.useInnerText, timeout });
253
+ }, expected, options);
254
+ } else {
255
+ return import_toMatchText.toMatchText.call(this, "toHaveText", locator, "Locator", async (isNot, timeout) => {
256
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected], { normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });
257
+ return await locator._expect("to.have.text", { expectedText, isNot, useInnerText: options?.useInnerText, timeout });
258
+ }, expected, options);
259
+ }
260
+ }
261
+ function toHaveValue(locator, expected, options) {
262
+ return import_toMatchText.toMatchText.call(this, "toHaveValue", locator, "Locator", async (isNot, timeout) => {
263
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected]);
264
+ return await locator._expect("to.have.value", { expectedText, isNot, timeout });
265
+ }, expected, options);
266
+ }
267
+ function toHaveValues(locator, expected, options) {
268
+ return import_toEqual.toEqual.call(this, "toHaveValues", locator, "Locator", async (isNot, timeout) => {
269
+ const expectedText = (0, import_utils.serializeExpectedTextValues)(expected);
270
+ return await locator._expect("to.have.values", { expectedText, isNot, timeout });
271
+ }, expected, options);
272
+ }
273
+ function toHaveTitle(page, expected, options = {}) {
274
+ return import_toMatchText.toMatchText.call(this, "toHaveTitle", page, "Page", async (isNot, timeout) => {
275
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected], { normalizeWhiteSpace: true });
276
+ return await page.mainFrame()._expect("to.have.title", { expectedText, isNot, timeout });
277
+ }, expected, options);
278
+ }
279
+ function toHaveURL(page, expected, options) {
280
+ if (typeof expected === "function")
281
+ return import_toHaveURL.toHaveURLWithPredicate.call(this, page, expected, options);
282
+ const baseURL = page.context()._options.baseURL;
283
+ expected = typeof expected === "string" ? (0, import_utils.constructURLBasedOnBaseURL)(baseURL, expected) : expected;
284
+ return import_toMatchText.toMatchText.call(this, "toHaveURL", page, "Page", async (isNot, timeout) => {
285
+ const expectedText = (0, import_utils.serializeExpectedTextValues)([expected], { ignoreCase: options?.ignoreCase });
286
+ return await page.mainFrame()._expect("to.have.url", { expectedText, isNot, timeout });
287
+ }, expected, options);
288
+ }
289
+ async function toBeOK(response) {
290
+ const matcherName = "toBeOK";
291
+ (0, import_util.expectTypes)(response, ["APIResponse"], matcherName);
292
+ const contentType = response.headers()["content-type"];
293
+ const isTextEncoding = contentType && (0, import_utils.isTextualMimeType)(contentType);
294
+ const [log, text] = this.isNot === response.ok() ? await Promise.all([
295
+ response._fetchLog(),
296
+ isTextEncoding ? response.text() : null
297
+ ]) : [];
298
+ const message = () => (0, import_matcherHint.formatMatcherMessage)(this, {
299
+ matcherName,
300
+ receiver: "response",
301
+ expectation: "",
302
+ log
303
+ }) + (text === null ? "" : `
304
+ Response text:
305
+ ${import_utils2.colors.dim(text?.substring(0, 1e3) || "")}`);
306
+ const pass = response.ok();
307
+ return { message, pass };
308
+ }
309
+ async function toPass(callback, options = {}) {
310
+ const testInfo = (0, import_globals.currentTestInfo)();
311
+ const timeout = (0, import_config.takeFirst)(options.timeout, testInfo?._projectInternal.expect?.toPass?.timeout, 0);
312
+ const intervals = (0, import_config.takeFirst)(options.intervals, testInfo?._projectInternal.expect?.toPass?.intervals, [100, 250, 500, 1e3]);
313
+ const { deadline, timeoutMessage } = testInfo ? testInfo._deadlineForMatcher(timeout) : import_testInfo.TestInfoImpl._defaultDeadlineForMatcher(timeout);
314
+ const result = await (0, import_utils.pollAgainstDeadline)(async () => {
315
+ if (testInfo && (0, import_globals.currentTestInfo)() !== testInfo)
316
+ return { continuePolling: false, result: void 0 };
317
+ try {
318
+ await callback();
319
+ return { continuePolling: !!this.isNot, result: void 0 };
320
+ } catch (e) {
321
+ return { continuePolling: !this.isNot, result: e };
322
+ }
323
+ }, deadline, intervals);
324
+ if (result.timedOut) {
325
+ const message = result.result ? [
326
+ result.result.message,
327
+ "",
328
+ `Call Log:`,
329
+ `- ${timeoutMessage}`
330
+ ].join("\n") : timeoutMessage;
331
+ return { message: () => message, pass: !!this.isNot };
332
+ }
333
+ return { pass: !this.isNot, message: () => "" };
334
+ }
335
+ // Annotate the CommonJS export names for ESM import in node:
336
+ 0 && (module.exports = {
337
+ toBeAttached,
338
+ toBeChecked,
339
+ toBeDisabled,
340
+ toBeEditable,
341
+ toBeEmpty,
342
+ toBeEnabled,
343
+ toBeFocused,
344
+ toBeHidden,
345
+ toBeInViewport,
346
+ toBeOK,
347
+ toBeVisible,
348
+ toContainClass,
349
+ toContainText,
350
+ toHaveAccessibleDescription,
351
+ toHaveAccessibleErrorMessage,
352
+ toHaveAccessibleName,
353
+ toHaveAttribute,
354
+ toHaveCSS,
355
+ toHaveClass,
356
+ toHaveCount,
357
+ toHaveId,
358
+ toHaveJSProperty,
359
+ toHaveRole,
360
+ toHaveText,
361
+ toHaveTitle,
362
+ toHaveURL,
363
+ toHaveValue,
364
+ toHaveValues,
365
+ toPass
366
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/matchers/matchers.ts"],
4
+ "sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { constructURLBasedOnBaseURL, isRegExp, isString, isTextualMimeType, pollAgainstDeadline, serializeExpectedTextValues } from 'playwright-core/lib/utils';\nimport { colors } from 'playwright-core/lib/utils';\n\nimport { callLogText, expectTypes } from '../util';\nimport { toBeTruthy } from './toBeTruthy';\nimport { toEqual } from './toEqual';\nimport { toHaveURLWithPredicate } from './toHaveURL';\nimport { toMatchText } from './toMatchText';\nimport { takeFirst } from '../common/config';\nimport { currentTestInfo } from '../common/globals';\nimport { TestInfoImpl } from '../worker/testInfo';\n\nimport type { ExpectMatcherState } from '../../types/test';\nimport type { TestStepInfoImpl } from '../worker/testInfo';\nimport type { APIResponse, Locator, Frame, Page } from 'playwright-core';\nimport type { FrameExpectParams } from 'playwright-core/lib/client/types';\n\nexport type ExpectMatcherStateInternal = ExpectMatcherState & { _stepInfo?: TestStepInfoImpl };\n\nexport interface LocatorEx extends Locator {\n _expect(expression: string, options: FrameExpectParams): Promise<{ matches: boolean, received?: any, log?: string[], timedOut?: boolean }>;\n}\n\nexport interface FrameEx extends Frame {\n _expect(expression: string, options: FrameExpectParams): Promise<{ matches: boolean, received?: any, log?: string[], timedOut?: boolean }>;\n}\n\ninterface APIResponseEx extends APIResponse {\n _fetchLog(): Promise<string[]>;\n}\n\nexport function toBeAttached(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { attached?: boolean, timeout?: number },\n) {\n const attached = !options || options.attached === undefined || options.attached;\n const expected = attached ? 'attached' : 'detached';\n const arg = attached ? '' : '{ attached: false }';\n return toBeTruthy.call(this, 'toBeAttached', locator, 'Locator', expected, arg, async (isNot, timeout) => {\n return await locator._expect(attached ? 'to.be.attached' : 'to.be.detached', { isNot, timeout });\n }, options);\n}\n\nexport function toBeChecked(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { checked?: boolean, indeterminate?: boolean, timeout?: number },\n) {\n const checked = options?.checked;\n const indeterminate = options?.indeterminate;\n const expectedValue = {\n checked,\n indeterminate,\n };\n let expected: string;\n let arg: string;\n if (options?.indeterminate) {\n expected = 'indeterminate';\n arg = `{ indeterminate: true }`;\n } else {\n expected = options?.checked === false ? 'unchecked' : 'checked';\n arg = options?.checked === false ? `{ checked: false }` : '';\n }\n return toBeTruthy.call(this, 'toBeChecked', locator, 'Locator', expected, arg, async (isNot, timeout) => {\n return await locator._expect('to.be.checked', { isNot, timeout, expectedValue });\n }, options);\n}\n\nexport function toBeDisabled(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { timeout?: number },\n) {\n return toBeTruthy.call(this, 'toBeDisabled', locator, 'Locator', 'disabled', '', async (isNot, timeout) => {\n return await locator._expect('to.be.disabled', { isNot, timeout });\n }, options);\n}\n\nexport function toBeEditable(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { editable?: boolean, timeout?: number },\n) {\n const editable = !options || options.editable === undefined || options.editable;\n const expected = editable ? 'editable' : 'readOnly';\n const arg = editable ? '' : '{ editable: false }';\n return toBeTruthy.call(this, 'toBeEditable', locator, 'Locator', expected, arg, async (isNot, timeout) => {\n return await locator._expect(editable ? 'to.be.editable' : 'to.be.readonly', { isNot, timeout });\n }, options);\n}\n\nexport function toBeEmpty(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { timeout?: number },\n) {\n return toBeTruthy.call(this, 'toBeEmpty', locator, 'Locator', 'empty', '', async (isNot, timeout) => {\n return await locator._expect('to.be.empty', { isNot, timeout });\n }, options);\n}\n\nexport function toBeEnabled(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { enabled?: boolean, timeout?: number },\n) {\n const enabled = !options || options.enabled === undefined || options.enabled;\n const expected = enabled ? 'enabled' : 'disabled';\n const arg = enabled ? '' : '{ enabled: false }';\n return toBeTruthy.call(this, 'toBeEnabled', locator, 'Locator', expected, arg, async (isNot, timeout) => {\n return await locator._expect(enabled ? 'to.be.enabled' : 'to.be.disabled', { isNot, timeout });\n }, options);\n}\n\nexport function toBeFocused(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { timeout?: number },\n) {\n return toBeTruthy.call(this, 'toBeFocused', locator, 'Locator', 'focused', '', async (isNot, timeout) => {\n return await locator._expect('to.be.focused', { isNot, timeout });\n }, options);\n}\n\nexport function toBeHidden(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { timeout?: number },\n) {\n return toBeTruthy.call(this, 'toBeHidden', locator, 'Locator', 'hidden', '', async (isNot, timeout) => {\n return await locator._expect('to.be.hidden', { isNot, timeout });\n }, options);\n}\n\nexport function toBeVisible(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { visible?: boolean, timeout?: number },\n) {\n const visible = !options || options.visible === undefined || options.visible;\n const expected = visible ? 'visible' : 'hidden';\n const arg = visible ? '' : '{ visible: false }';\n return toBeTruthy.call(this, 'toBeVisible', locator, 'Locator', expected, arg, async (isNot, timeout) => {\n return await locator._expect(visible ? 'to.be.visible' : 'to.be.hidden', { isNot, timeout });\n }, options);\n}\n\nexport function toBeInViewport(\n this: ExpectMatcherState,\n locator: LocatorEx,\n options?: { timeout?: number, ratio?: number },\n) {\n return toBeTruthy.call(this, 'toBeInViewport', locator, 'Locator', 'in viewport', '', async (isNot, timeout) => {\n return await locator._expect('to.be.in.viewport', { isNot, expectedNumber: options?.ratio, timeout });\n }, options);\n}\n\nexport function toContainText(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp | (string | RegExp)[],\n options: { timeout?: number, useInnerText?: boolean, ignoreCase?: boolean } = {},\n) {\n if (Array.isArray(expected)) {\n return toEqual.call(this, 'toContainText', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues(expected, { matchSubstring: true, normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });\n return await locator._expect('to.contain.text.array', { expectedText, isNot, useInnerText: options.useInnerText, timeout });\n }, expected, { ...options, contains: true });\n } else {\n return toMatchText.call(this, 'toContainText', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { matchSubstring: true, normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });\n return await locator._expect('to.have.text', { expectedText, isNot, useInnerText: options.useInnerText, timeout });\n }, expected, options);\n }\n}\n\nexport function toHaveAccessibleDescription(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp,\n options?: { timeout?: number, ignoreCase?: boolean },\n) {\n return toMatchText.call(this, 'toHaveAccessibleDescription', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });\n return await locator._expect('to.have.accessible.description', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveAccessibleName(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp,\n options?: { timeout?: number, ignoreCase?: boolean },\n) {\n return toMatchText.call(this, 'toHaveAccessibleName', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });\n return await locator._expect('to.have.accessible.name', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveAccessibleErrorMessage(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp,\n options?: { timeout?: number; ignoreCase?: boolean },\n) {\n return toMatchText.call(this, 'toHaveAccessibleErrorMessage', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });\n return await locator._expect('to.have.accessible.error.message', { expectedText: expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveAttribute(\n this: ExpectMatcherState,\n locator: LocatorEx,\n name: string,\n expected: string | RegExp | undefined | { timeout?: number },\n options?: { timeout?: number, ignoreCase?: boolean },\n) {\n if (!options) {\n // Update params for the case toHaveAttribute(name, options);\n if (typeof expected === 'object' && !isRegExp(expected)) {\n options = expected;\n expected = undefined;\n }\n }\n if (expected === undefined) {\n return toBeTruthy.call(this, 'toHaveAttribute', locator, 'Locator', 'have attribute', '', async (isNot, timeout) => {\n return await locator._expect('to.have.attribute', { expressionArg: name, isNot, timeout });\n }, options);\n }\n return toMatchText.call(this, 'toHaveAttribute', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected as (string | RegExp)], { ignoreCase: options?.ignoreCase });\n return await locator._expect('to.have.attribute.value', { expressionArg: name, expectedText, isNot, timeout });\n }, expected as (string | RegExp), options);\n}\n\nexport function toHaveClass(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp | (string | RegExp)[],\n options?: { timeout?: number },\n) {\n if (Array.isArray(expected)) {\n return toEqual.call(this, 'toHaveClass', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues(expected);\n return await locator._expect('to.have.class.array', { expectedText, isNot, timeout });\n }, expected, options, true);\n } else {\n return toMatchText.call(this, 'toHaveClass', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected]);\n return await locator._expect('to.have.class', { expectedText, isNot, timeout });\n }, expected, options);\n }\n}\n\nexport function toContainClass(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | string[],\n options?: { timeout?: number },\n) {\n if (Array.isArray(expected)) {\n if (expected.some(e => isRegExp(e)))\n throw new Error(`\"expected\" argument in toContainClass cannot contain RegExp values`);\n return toEqual.call(this, 'toContainClass', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues(expected);\n return await locator._expect('to.contain.class.array', { expectedText, isNot, timeout });\n }, expected, options, true);\n } else {\n if (isRegExp(expected))\n throw new Error(`\"expected\" argument in toContainClass cannot be a RegExp value`);\n return toMatchText.call(this, 'toContainClass', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected]);\n return await locator._expect('to.contain.class', { expectedText, isNot, timeout });\n }, expected, options);\n }\n}\n\nexport function toHaveCount(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: number,\n options?: { timeout?: number },\n) {\n return toEqual.call(this, 'toHaveCount', locator, 'Locator', async (isNot, timeout) => {\n return await locator._expect('to.have.count', { expectedNumber: expected, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveCSS(\n this: ExpectMatcherState,\n locator: LocatorEx,\n name: string,\n expected: string | RegExp,\n options?: { timeout?: number },\n) {\n return toMatchText.call(this, 'toHaveCSS', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected]);\n return await locator._expect('to.have.css', { expressionArg: name, expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveId(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp,\n options?: { timeout?: number },\n) {\n return toMatchText.call(this, 'toHaveId', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected]);\n return await locator._expect('to.have.id', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveJSProperty(\n this: ExpectMatcherState,\n locator: LocatorEx,\n name: string,\n expected: any,\n options?: { timeout?: number },\n) {\n return toEqual.call(this, 'toHaveJSProperty', locator, 'Locator', async (isNot, timeout) => {\n return await locator._expect('to.have.property', { expressionArg: name, expectedValue: expected, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveRole(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string,\n options?: { timeout?: number, ignoreCase?: boolean },\n) {\n if (!isString(expected))\n throw new Error(`\"role\" argument in toHaveRole must be a string`);\n return toMatchText.call(this, 'toHaveRole', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected]);\n return await locator._expect('to.have.role', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveText(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp | (string | RegExp)[],\n options: { timeout?: number, useInnerText?: boolean, ignoreCase?: boolean } = {},\n) {\n if (Array.isArray(expected)) {\n return toEqual.call(this, 'toHaveText', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues(expected, { normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });\n return await locator._expect('to.have.text.array', { expectedText, isNot, useInnerText: options?.useInnerText, timeout });\n }, expected, options);\n } else {\n return toMatchText.call(this, 'toHaveText', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });\n return await locator._expect('to.have.text', { expectedText, isNot, useInnerText: options?.useInnerText, timeout });\n }, expected, options);\n }\n}\n\nexport function toHaveValue(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: string | RegExp,\n options?: { timeout?: number },\n) {\n return toMatchText.call(this, 'toHaveValue', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected]);\n return await locator._expect('to.have.value', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveValues(\n this: ExpectMatcherState,\n locator: LocatorEx,\n expected: (string | RegExp)[],\n options?: { timeout?: number },\n) {\n return toEqual.call(this, 'toHaveValues', locator, 'Locator', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues(expected);\n return await locator._expect('to.have.values', { expectedText, isNot, timeout });\n }, expected, options);\n}\n\nexport function toHaveTitle(\n this: ExpectMatcherState,\n page: Page,\n expected: string | RegExp,\n options: { timeout?: number } = {},\n) {\n return toMatchText.call(this, 'toHaveTitle', page, 'Page', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { normalizeWhiteSpace: true });\n return await (page.mainFrame() as FrameEx)._expect('to.have.title', { expectedText, isNot, timeout });\n }, expected, { receiverLabel: 'page', ...options });\n}\n\nexport function toHaveURL(\n this: ExpectMatcherState,\n page: Page,\n expected: string | RegExp | ((url: URL) => boolean),\n options?: { ignoreCase?: boolean; timeout?: number },\n) {\n // Ports don't support predicates. Keep separate server and client codepaths\n if (typeof expected === 'function')\n return toHaveURLWithPredicate.call(this, page, expected, options);\n\n const baseURL = (page.context() as any)._options.baseURL;\n expected = typeof expected === 'string' ? constructURLBasedOnBaseURL(baseURL, expected) : expected;\n return toMatchText.call(this, 'toHaveURL', page, 'Page', async (isNot, timeout) => {\n const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase });\n return await (page.mainFrame() as FrameEx)._expect('to.have.url', { expectedText, isNot, timeout });\n }, expected, { receiverLabel: 'page', ...options });\n}\n\nexport async function toBeOK(\n this: ExpectMatcherState,\n response: APIResponseEx\n) {\n const matcherName = 'toBeOK';\n expectTypes(response, ['APIResponse'], matcherName);\n\n const contentType = response.headers()['content-type'];\n const isTextEncoding = contentType && isTextualMimeType(contentType);\n const [log, text] = (this.isNot === response.ok()) ? await Promise.all([\n response._fetchLog(),\n isTextEncoding ? response.text() : null\n ]) : [];\n\n const message = () => this.utils.matcherHint(matcherName, undefined, '', { isNot: this.isNot }) +\n callLogText(log) +\n (text === null ? '' : `\\nResponse text:\\n${colors.dim(text?.substring(0, 1000) || '')}`);\n\n const pass = response.ok();\n return { message, pass };\n}\n\nexport async function toPass(\n this: ExpectMatcherState,\n callback: () => any,\n options: {\n intervals?: number[];\n timeout?: number,\n } = {},\n) {\n const testInfo = currentTestInfo();\n const timeout = takeFirst(options.timeout, testInfo?._projectInternal.expect?.toPass?.timeout, 0);\n const intervals = takeFirst(options.intervals, testInfo?._projectInternal.expect?.toPass?.intervals, [100, 250, 500, 1000]);\n\n const { deadline, timeoutMessage } = testInfo ? testInfo._deadlineForMatcher(timeout) : TestInfoImpl._defaultDeadlineForMatcher(timeout);\n const result = await pollAgainstDeadline<Error|undefined>(async () => {\n if (testInfo && currentTestInfo() !== testInfo)\n return { continuePolling: false, result: undefined };\n try {\n await callback();\n return { continuePolling: !!this.isNot, result: undefined };\n } catch (e) {\n return { continuePolling: !this.isNot, result: e };\n }\n }, deadline, intervals);\n\n if (result.timedOut) {\n const message = result.result ? [\n result.result.message,\n '',\n `Call Log:`,\n `- ${timeoutMessage}`,\n ].join('\\n') : timeoutMessage;\n return { message: () => message, pass: !!this.isNot };\n }\n return { pass: !this.isNot, message: () => '' };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,mBAAoI;AACpI,IAAAA,gBAAuB;AAEvB,kBAAyC;AACzC,wBAA2B;AAC3B,qBAAwB;AACxB,uBAAuC;AACvC,yBAA4B;AAC5B,oBAA0B;AAC1B,qBAAgC;AAChC,sBAA6B;AAqBtB,SAAS,aAEd,SACA,SACA;AACA,QAAM,WAAW,CAAC,WAAW,QAAQ,aAAa,UAAa,QAAQ;AACvE,QAAM,WAAW,WAAW,aAAa;AACzC,QAAM,MAAM,WAAW,KAAK;AAC5B,SAAO,6BAAW,KAAK,MAAM,gBAAgB,SAAS,WAAW,UAAU,KAAK,OAAO,OAAO,YAAY;AACxG,WAAO,MAAM,QAAQ,QAAQ,WAAW,mBAAmB,kBAAkB,EAAE,OAAO,QAAQ,CAAC;AAAA,EACjG,GAAG,OAAO;AACZ;AAEO,SAAS,YAEd,SACA,SACA;AACA,QAAM,UAAU,S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AU,GAAG,GAAI,KAAK,EAAE,CAAC;AAEvF,QAAM,OAAO,SAAS,GAAG;AACzB,SAAO,EAAE,SAAS,KAAK;AACzB;AAEA,eAAsB,OAEpB,UACA,UAGI,CAAC,GACL;AACA,QAAM,eAAW,gCAAgB;AACjC,QAAM,cAAU,yBAAU,QAAQ,SAAS,UAAU,iBAAiB,QAAQ,QAAQ,SAAS,CAAC;AAChG,QAAM,gBAAY,yBAAU,QAAQ,WAAW,UAAU,iBAAiB,QAAQ,QAAQ,WAAW,CAAC,KAAK,KAAK,KAAK,GAAI,CAAC;AAE1H,QAAM,EAAE,UAAU,eAAe,IAAI,WAAW,SAAS,oBAAoB,OAAO,IAAI,6BAAa,2BAA2B,OAAO;AACvI,QAAM,SAAS,UAAM,kCAAqC,YAAY;AACpE,QAAI,gBAAY,gCAAgB,MAAM;AACpC,aAAO,EAAE,iBAAiB,OAAO,QAAQ,OAAU;AACrD,QAAI;AACF,YAAM,SAAS;AACf,aAAO,EAAE,iBAAiB,CAAC,CAAC,KAAK,OAAO,QAAQ,OAAU;AAAA,IAC5D,SAAS,GAAG;AACV,aAAO,EAAE,iBAAiB,CAAC,KAAK,OAAO,QAAQ,EAAE;AAAA,IACnD;AAAA,EACF,GAAG,UAAU,SAAS;AAEtB,MAAI,OAAO,UAAU;AACnB,UAAM,UAAU,OAAO,SAAS;AAAA,MAC9B,OAAO,OAAO;AAAA,MACd;AAAA,MACA;AAAA,MACA,KAAK,cAAc;AAAA,IACrB,EAAE,KAAK,IAAI,IAAI;AACf,WAAO,EAAE,SAAS,MAAM,SAAS,MAAM,CAAC,CAAC,KAAK,MAAM;AAAA,EACtD;AACA,SAAO,EAAE,MAAM,CAAC,KAAK,OAAO,SAAS,MAAM,GAAG;AAChD;",
6
+ "names": ["import_utils"]
7
+ }
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var toBeTruthy_exports = {};
20
+ __export(toBeTruthy_exports, {
21
+ toBeTruthy: () => toBeTruthy
22
+ });
23
+ module.exports = __toCommonJS(toBeTruthy_exports);
24
+ var import_util = require("../util");
25
+ var import_matcherHint = require("./matcherHint");
26
+ async function toBeTruthy(matcherName, locator, receiverType, expected, arg, query, options = {}) {
27
+ (0, import_util.expectTypes)(locator, [receiverType], matcherName);
28
+ const timeout = options.timeout ?? this.timeout;
29
+ const { matches: pass, log, timedOut, received, errorMessage } = await query(!!this.isNot, timeout);
30
+ if (pass === !this.isNot) {
31
+ return {
32
+ name: matcherName,
33
+ message: () => "",
34
+ pass,
35
+ expected
36
+ };
37
+ }
38
+ let printedReceived;
39
+ let printedExpected;
40
+ if (pass) {
41
+ printedExpected = `Expected: not ${expected}`;
42
+ printedReceived = errorMessage ? "" : `Received: ${expected}`;
43
+ } else {
44
+ printedExpected = `Expected: ${expected}`;
45
+ printedReceived = errorMessage ? "" : `Received: ${received}`;
46
+ }
47
+ const message = () => {
48
+ return (0, import_matcherHint.formatMatcherMessage)(this, {
49
+ matcherName,
50
+ expectation: arg,
51
+ locator,
52
+ timeout,
53
+ timedOut,
54
+ printedExpected,
55
+ printedReceived,
56
+ errorMessage,
57
+ log
58
+ });
59
+ };
60
+ return {
61
+ message,
62
+ pass,
63
+ actual: received,
64
+ name: matcherName,
65
+ expected,
66
+ log,
67
+ timeout: timedOut ? timeout : void 0
68
+ };
69
+ }
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ toBeTruthy
73
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/matchers/toBeTruthy.ts"],
4
+ "sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { callLogText, expectTypes } from '../util';\nimport { kNoElementsFoundError, matcherHint } from './matcherHint';\nimport { runBrowserBackendOnError } from '../mcp/browser/backend';\n\nimport type { MatcherResult } from './matcherHint';\nimport type { ExpectMatcherState } from '../../types/test';\nimport type { Locator } from 'playwright-core';\n\nexport async function toBeTruthy(\n this: ExpectMatcherState,\n matcherName: string,\n receiver: Locator,\n receiverType: string,\n expected: string,\n arg: string,\n query: (isNot: boolean, timeout: number) => Promise<{ matches: boolean, log?: string[], received?: any, timedOut?: boolean }>,\n options: { timeout?: number } = {},\n): Promise<MatcherResult<any, any>> {\n expectTypes(receiver, [receiverType], matcherName);\n\n const matcherOptions = {\n isNot: this.isNot,\n promise: this.promise,\n };\n\n const timeout = options.timeout ?? this.timeout;\n\n const { matches: pass, log, timedOut, received } = await query(!!this.isNot, timeout).catch(async error => {\n // FIXME: query should not throw, but it does for strict mode violations for example.\n await runBrowserBackendOnError(receiver.page(), () => error.message);\n throw error;\n });\n\n if (pass === !this.isNot) {\n return {\n name: matcherName,\n message: () => '',\n pass,\n expected\n };\n }\n\n const notFound = received === kNoElementsFoundError ? received : undefined;\n let printedReceived: string | undefined;\n let printedExpected: string | undefined;\n if (pass) {\n printedExpected = `Expected: not ${expected}`;\n printedReceived = `Received: ${notFound ? kNoElementsFoundError : expected}`;\n } else {\n printedExpected = `Expected: ${expected}`;\n printedReceived = `Received: ${notFound ? kNoElementsFoundError : received}`;\n }\n const message = () => {\n const header = matcherHint(this, receiver, matcherName, 'locator', arg, matcherOptions, timedOut ? timeout : undefined, `${printedExpected}\\n${printedReceived}`);\n const logText = callLogText(log);\n return `${header}${logText}`;\n };\n\n await runBrowserBackendOnError(receiver.page(), message);\n\n return {\n message,\n pass,\n actual: received,\n name: matcherName,\n expected,\n log,\n timeout: timedOut ? timeout : undefined,\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,kBAAyC;AACzC,yBAAmD;AACnD,qBAAyC;AAMzC,eAAsB,WAEpB,aACA,UACA,cACA,UACA,KACA,OACA,UAAgC,CAAC,GACC;AAClC,+BAAY,UAAU,CAAC,YAAY,GAAG,WAAW;AAEjD,QAAM,iBAAiB;AAAA,IACrB,OAAO,KAAK;AAAA,IACZ,SAAS,KAAK;AAAA,EAChB;AAEA,QAAM,UAAU,QAAQ,WAAW,KAAK;AAExC,QAAM,EAAE,SAAS,MAAM,KAAK,UAAU,SAAS,IAAI,MAAM,MAAM,CAAC,CAAC,KAAK,OAAO,OAAO,EAAE,MAAM,OAAM,UAAS;AAEzG,cAAM,yCAAyB,SAAS,KAAK,GAAG,MAAM,MAAM,OAAO;AACnE,UAAM;AAAA,EACR,CAAC;AAED,MAAI,SAAS,CAAC,KAAK,OAAO;AACxB,WAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS,MAAM;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,WAAW,aAAa,2CAAwB,WAAW;AACjE,MAAI;AACJ,MAAI;AACJ,MAAI,MAAM;AACR,sBAAkB,iBAAiB,QAAQ;AAC3C,sBAAkB,aAAa,WAAW,2CAAwB,QAAQ;AAAA,EAC5E,OAAO;AACL,sBAAkB,aAAa,QAAQ;AACvC,sBAAkB,aAAa,WAAW,2CAAwB,QAAQ;AAAA,EAC5E;AACA,QAAM,UAAU,MAAM;AACpB,UAAM,aAAS,gCAAY,MAAM,UAAU,aAAa,WAAW,KAAK,gBAAgB,WAAW,UAAU,QAAW,GAAG,eAAe;AAAA,EAAK,eAAe,EAAE;AAChK,UAAM,cAAU,yBAAY,GAAG;AAC/B,WAAO,GAAG,MAAM,GAAG,OAAO;AAAA,EAC5B;AAEA,YAAM,yCAAyB,SAAS,KAAK,GAAG,OAAO;AAEvD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,SAAS,WAAW,UAAU;AAAA,EAChC;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var toEqual_exports = {};
20
+ __export(toEqual_exports, {
21
+ toEqual: () => toEqual
22
+ });
23
+ module.exports = __toCommonJS(toEqual_exports);
24
+ var import_utils = require("playwright-core/lib/utils");
25
+ var import_util = require("../util");
26
+ var import_matcherHint = require("./matcherHint");
27
+ const EXPECTED_LABEL = "Expected";
28
+ const RECEIVED_LABEL = "Received";
29
+ async function toEqual(matcherName, locator, receiverType, query, expected, options = {}) {
30
+ (0, import_util.expectTypes)(locator, [receiverType], matcherName);
31
+ const timeout = options.timeout ?? this.timeout;
32
+ const { matches: pass, received, log, timedOut, errorMessage } = await query(!!this.isNot, timeout);
33
+ if (pass === !this.isNot) {
34
+ return {
35
+ name: matcherName,
36
+ message: () => "",
37
+ pass,
38
+ expected
39
+ };
40
+ }
41
+ let printedReceived;
42
+ let printedExpected;
43
+ let printedDiff;
44
+ if (pass) {
45
+ printedExpected = `Expected: not ${this.utils.printExpected(expected)}`;
46
+ printedReceived = errorMessage ? "" : `Received: ${this.utils.printReceived(received)}`;
47
+ } else if (errorMessage) {
48
+ printedExpected = `Expected: ${this.utils.printExpected(expected)}`;
49
+ } else if (Array.isArray(expected) && Array.isArray(received)) {
50
+ const normalizedExpected = expected.map((exp, index) => {
51
+ const rec = received[index];
52
+ if ((0, import_utils.isRegExp)(exp))
53
+ return exp.test(rec) ? rec : exp;
54
+ return exp;
55
+ });
56
+ printedDiff = this.utils.printDiffOrStringify(
57
+ normalizedExpected,
58
+ received,
59
+ EXPECTED_LABEL,
60
+ RECEIVED_LABEL,
61
+ false
62
+ );
63
+ } else {
64
+ printedDiff = this.utils.printDiffOrStringify(
65
+ expected,
66
+ received,
67
+ EXPECTED_LABEL,
68
+ RECEIVED_LABEL,
69
+ false
70
+ );
71
+ }
72
+ const message = () => {
73
+ return (0, import_matcherHint.formatMatcherMessage)(this, {
74
+ matcherName,
75
+ expectation: "expected",
76
+ locator,
77
+ timeout,
78
+ timedOut,
79
+ printedExpected,
80
+ printedReceived,
81
+ printedDiff,
82
+ errorMessage,
83
+ log
84
+ });
85
+ };
86
+ return {
87
+ actual: received,
88
+ expected,
89
+ message,
90
+ name: matcherName,
91
+ pass,
92
+ log,
93
+ timeout: timedOut ? timeout : void 0
94
+ };
95
+ }
96
+ // Annotate the CommonJS export names for ESM import in node:
97
+ 0 && (module.exports = {
98
+ toEqual
99
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/matchers/toEqual.ts"],
4
+ "sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isRegExp } from 'playwright-core/lib/utils';\n\nimport { callLogText, expectTypes } from '../util';\nimport { matcherHint } from './matcherHint';\nimport { runBrowserBackendOnError } from '../mcp/browser/backend';\n\nimport type { MatcherResult } from './matcherHint';\nimport type { ExpectMatcherState } from '../../types/test';\nimport type { Locator } from 'playwright-core';\n\n// Omit colon and one or more spaces, so can call getLabelPrinter.\nconst EXPECTED_LABEL = 'Expected';\nconst RECEIVED_LABEL = 'Received';\n\nexport async function toEqual<T>(\n this: ExpectMatcherState,\n matcherName: string,\n receiver: Locator,\n receiverType: string,\n query: (isNot: boolean, timeout: number) => Promise<{ matches: boolean, received?: any, log?: string[], timedOut?: boolean }>,\n expected: T,\n options: { timeout?: number, contains?: boolean } = {},\n messagePreventExtraStatIndent?: boolean\n): Promise<MatcherResult<any, any>> {\n expectTypes(receiver, [receiverType], matcherName);\n\n const matcherOptions = {\n comment: options.contains ? '' : 'deep equality',\n isNot: this.isNot,\n promise: this.promise,\n };\n\n const timeout = options.timeout ?? this.timeout;\n\n const { matches: pass, received, log, timedOut } = await query(!!this.isNot, timeout).catch(async error => {\n // FIXME: query should not throw, but it does for strict mode violations for example.\n await runBrowserBackendOnError(receiver.page(), () => error.message);\n throw error;\n });\n\n if (pass === !this.isNot) {\n return {\n name: matcherName,\n message: () => '',\n pass,\n expected\n };\n }\n\n let printedReceived: string | undefined;\n let printedExpected: string | undefined;\n let printedDiff: string | undefined;\n if (pass) {\n printedExpected = `Expected: not ${this.utils.printExpected(expected)}`;\n printedReceived = `Received: ${this.utils.printReceived(received)}`;\n } else if (Array.isArray(expected) && Array.isArray(received)) {\n const normalizedExpected = expected.map((exp, index) => {\n const rec = received[index];\n if (isRegExp(exp))\n return exp.test(rec) ? rec : exp;\n\n return exp;\n });\n printedDiff = this.utils.printDiffOrStringify(\n normalizedExpected,\n received,\n EXPECTED_LABEL,\n RECEIVED_LABEL,\n false,\n );\n } else {\n printedDiff = this.utils.printDiffOrStringify(\n expected,\n received,\n EXPECTED_LABEL,\n RECEIVED_LABEL,\n false,\n );\n }\n const message = () => {\n const details = printedDiff || `${printedExpected}\\n${printedReceived}`;\n const header = matcherHint(this, receiver, matcherName, 'locator', undefined, matcherOptions, timedOut ? timeout : undefined, details, messagePreventExtraStatIndent);\n return `${header}${callLogText(log)}`;\n };\n\n await runBrowserBackendOnError(receiver.page(), message);\n\n // Passing the actual and expected objects so that a custom reporter\n // could access them, for example in order to display a custom visual diff,\n // or create a different error message\n return {\n actual: received,\n expected, message,\n name: matcherName,\n pass,\n log,\n timeout: timedOut ? timeout : undefined,\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,mBAAyB;AAEzB,kBAAyC;AACzC,yBAA4B;AAC5B,qBAAyC;AAOzC,MAAM,iBAAiB;AACvB,MAAM,iBAAiB;AAEvB,eAAsB,QAEpB,aACA,UACA,cACA,OACA,UACA,UAAoD,CAAC,GACrD,+BACkC;AAClC,+BAAY,UAAU,CAAC,YAAY,GAAG,WAAW;AAEjD,QAAM,iBAAiB;AAAA,IACrB,SAAS,QAAQ,WAAW,KAAK;AAAA,IACjC,OAAO,KAAK;AAAA,IACZ,SAAS,KAAK;AAAA,EAChB;AAEA,QAAM,UAAU,QAAQ,WA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