@thisisagile/easy-playwright 8.4.1 → 8.4.5

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.
@@ -1,8 +1,11 @@
1
1
  import { ElementHandle } from 'playwright';
2
2
  import { TestElement } from '@thisisagile/easy-test-web';
3
+ import { Json } from "@thisisagile/easy";
3
4
  export declare class PlaywrightElement implements TestElement {
4
5
  private readonly handle;
5
6
  constructor(handle: Promise<ElementHandle | null>);
6
7
  click(): Promise<void>;
7
8
  type(text: string): Promise<void>;
9
+ property(property: string): Promise<Json | undefined>;
10
+ exists(): Promise<boolean>;
8
11
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PlaywrightElement = void 0;
4
+ const easy_1 = require("@thisisagile/easy");
4
5
  class PlaywrightElement {
5
6
  constructor(handle) {
6
7
  this.handle = handle;
@@ -11,6 +12,12 @@ class PlaywrightElement {
11
12
  type(text) {
12
13
  return this.handle.then(h => h?.type(text));
13
14
  }
15
+ property(property) {
16
+ return this.handle.then(h => h?.getProperty(property).then(p => p.jsonValue()));
17
+ }
18
+ exists() {
19
+ return this.handle.then(h => (0, easy_1.isNotEmpty)(h));
20
+ }
14
21
  }
15
22
  exports.PlaywrightElement = PlaywrightElement;
16
23
  //# sourceMappingURL=PlaywrightElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlaywrightElement.js","sourceRoot":"","sources":["../src/PlaywrightElement.ts"],"names":[],"mappings":";;;AAGA,MAAa,iBAAiB;IAC5B,YAA6B,MAAqC;QAArC,WAAM,GAAN,MAAM,CAA+B;IAAG,CAAC;IAEtE,KAAK;QACH,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,CAAC,IAAY;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AAVD,8CAUC"}
1
+ {"version":3,"file":"PlaywrightElement.js","sourceRoot":"","sources":["../src/PlaywrightElement.ts"],"names":[],"mappings":";;;AAEA,4CAAqD;AAErD,MAAa,iBAAiB;IAC5B,YAA6B,MAAqC;QAArC,WAAM,GAAN,MAAM,CAA+B;IAAG,CAAC;IAEtE,KAAK;QACH,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,CAAC,IAAY;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,QAAQ,CAAC,QAAgB;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,iBAAU,EAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AAlBD,8CAkBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thisisagile/easy-playwright",
3
- "version": "8.4.1",
3
+ "version": "8.4.5",
4
4
  "description": "Straightforward wrapper library for Playwright web testing framework",
5
5
  "author": "Sander Hoogendoorn",
6
6
  "license": "MIT",
@@ -34,11 +34,11 @@
34
34
  "access": "public"
35
35
  },
36
36
  "devDependencies": {
37
- "@thisisagile/easy-test": "8.4.1"
37
+ "@thisisagile/easy-test": "8.4.5"
38
38
  },
39
39
  "dependencies": {
40
- "@thisisagile/easy": "8.4.1",
41
- "@thisisagile/easy-test-web": "8.4.1",
40
+ "@thisisagile/easy": "8.4.5",
41
+ "@thisisagile/easy-test-web": "8.4.5",
42
42
  "playwright": "^1.15.0"
43
43
  }
44
44
  }
@@ -1,5 +1,6 @@
1
1
  import { ElementHandle } from 'playwright';
2
2
  import { TestElement } from '@thisisagile/easy-test-web';
3
+ import { isNotEmpty, Json } from "@thisisagile/easy";
3
4
 
4
5
  export class PlaywrightElement implements TestElement {
5
6
  constructor(private readonly handle: Promise<ElementHandle | null>) {}
@@ -11,4 +12,12 @@ export class PlaywrightElement implements TestElement {
11
12
  type(text: string): Promise<void> {
12
13
  return this.handle.then(h => h?.type(text));
13
14
  }
15
+
16
+ property(property: string): Promise<Json | undefined> {
17
+ return this.handle.then(h => h?.getProperty(property).then(p => p.jsonValue()));
18
+ }
19
+
20
+ exists(): Promise<boolean> {
21
+ return this.handle.then(h => isNotEmpty(h));
22
+ }
14
23
  }