@empiricalrun/playwright-utils 0.20.10 → 0.20.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @empiricalrun/playwright-utils
2
2
 
3
+ ## 0.20.12
4
+
5
+ ### Patch Changes
6
+
7
+ - bc52ebf: test: failing test for overlay
8
+ - a0dd85c: feat: email client returns links from html/text body
9
+
10
+ ## 0.20.11
11
+
12
+ ### Patch Changes
13
+
14
+ - 089977f: test: added test for no overlay scenarios
15
+ - 3ffd03c: feat: enable key moments feature flag
16
+
3
17
  ## 0.20.10
4
18
 
5
19
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,WAAW,CAAC;AAGxC,KAAK,IAAI,GAAG;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAIF,KAAK,kBAAkB,GAAG;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,qBAAa,WAAW;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,SAAc;gBAEV,IAAI,GAAE,kBAAuB;IAmBzC,UAAU;IAIJ,YAAY,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC;CA6CrE"}
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,WAAW,CAAC;AAGxC,KAAK,IAAI,GAAG;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAIF,KAAK,kBAAkB,GAAG;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,qBAAa,WAAW;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,SAAc;gBAEV,IAAI,GAAE,kBAAuB;IAmBzC,UAAU;IAIJ,YAAY,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC;CAiDrE"}
package/dist/email.js CHANGED
@@ -46,11 +46,15 @@ class EmailClient {
46
46
  receivedAfter,
47
47
  });
48
48
  const codesAsString = (email.html?.codes || []).map((code) => code.value);
49
+ const allLinks = [
50
+ ...(email.html?.links || []),
51
+ ...(email.text?.links || []),
52
+ ];
49
53
  return {
50
54
  subject: email.subject,
51
55
  text: email.text?.body,
52
56
  html: email.html?.body,
53
- links: email.html?.links || [],
57
+ links: allLinks,
54
58
  codes: codesAsString,
55
59
  };
56
60
  }
@@ -102,3 +102,8 @@ test_1.test.beforeEach(async ({ page }) => {
102
102
  (0, test_1.expect)(firstLineThatStartsWithAt).toBeDefined();
103
103
  (0, test_1.expect)(firstLineThatStartsWithAt).toContain("overlay-tests/click.spec.ts:106");
104
104
  });
105
+ test_1.test.fail("should return from master agent planner", async ({ page }) => {
106
+ await page.goto(`http://localhost:${PORT}/no-overlay.html`);
107
+ // Deliberately click on a button that doesn't exist
108
+ await page.getByRole("button", { name: "Bottom Button" }).click();
109
+ });
@@ -19,7 +19,7 @@ exports.addLocatorHighlights = addLocatorHighlights;
19
19
  function applyHighlights(page, testFn) {
20
20
  const LocatorClass = page.locator("").constructor;
21
21
  (0, hover_1.patchHover)(LocatorClass, testFn);
22
- (0, expect_1.patchExpect)(LocatorClass, testFn);
22
+ (0, expect_1.patchExpect)(LocatorClass);
23
23
  (0, input_value_1.patchInputValue)(LocatorClass, testFn);
24
24
  (0, is_checked_1.patchIsChecked)(LocatorClass, testFn);
25
25
  (0, is_editable_1.patchIsEditable)(LocatorClass, testFn);
@@ -1,6 +1,5 @@
1
1
  import type { Locator } from "@playwright/test";
2
- import { TestFn } from "../../types";
3
2
  export declare function patchExpect(LocatorClass: Function & {
4
3
  prototype: Locator;
5
- }, testFn: TestFn): void;
4
+ }): void;
6
5
  //# sourceMappingURL=expect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAKrC,wBAAgB,WAAW,CACzB,YAAY,EAAE,QAAQ,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,EAC/C,MAAM,EAAE,MAAM,QAkCf"}
1
+ {"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAMhD,wBAAgB,WAAW,CAAC,YAAY,EAAE,QAAQ,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QAoB1E"}
@@ -3,30 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.patchExpect = void 0;
4
4
  const utils_1 = require("../utils");
5
5
  const isExpectPatched = new WeakMap();
6
- function patchExpect(LocatorClass, testFn) {
6
+ function patchExpect(LocatorClass) {
7
7
  if (isExpectPatched.get(LocatorClass)) {
8
8
  return;
9
9
  }
10
10
  const originalExpect = LocatorClass.prototype._expect;
11
+ // No need to add test.step in this patch as its already an internal method and is not part of stack trace
12
+ // if added then its tracked as a separate step in playwright trace
11
13
  // @ts-ignore _expect is a private method in playwright
12
14
  // https://github.com/microsoft/playwright/blob/69287f26bc514b740eac40160503d6fac8185d37/packages/playwright-core/src/client/locator.ts#L352
13
15
  LocatorClass.prototype._expect = async function (expression, options) {
14
- let result;
15
- const stepName = `locator._expect(${(0, utils_1.description)(this)})`;
16
- await testFn.step(stepName, async () => {
17
- try {
18
- result = await originalExpect.apply(this, [expression, options]);
19
- }
20
- catch (error) {
21
- if (error instanceof Error) {
22
- Error.captureStackTrace(error, LocatorClass.prototype._expect);
23
- }
24
- throw error;
25
- }
26
- if (result.matches) {
27
- await (0, utils_1.scrollAndHighlight)(this);
28
- }
29
- }, { box: true });
16
+ const result = await originalExpect.apply(this, [expression, options]);
17
+ if (result.matches) {
18
+ await (0, utils_1.scrollAndHighlight)(this);
19
+ }
30
20
  return result;
31
21
  };
32
22
  isExpectPatched.set(LocatorClass, true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/playwright-utils",
3
- "version": "0.20.10",
3
+ "version": "0.20.12",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -42,8 +42,8 @@
42
42
  "playwright-core": "1.47.1",
43
43
  "puppeteer-extra-plugin-recaptcha": "^3.6.8",
44
44
  "rimraf": "^6.0.1",
45
- "@empiricalrun/llm": "^0.9.35",
46
45
  "@empiricalrun/r2-uploader": "^0.3.8",
46
+ "@empiricalrun/llm": "^0.9.35",
47
47
  "@empiricalrun/test-gen": "^0.45.0"
48
48
  },
49
49
  "scripts": {