@thisisagile/easy-puppeteer 8.4.0 → 8.4.4

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 'puppeteer';
2
2
  import { TestElement } from '@thisisagile/easy-test-web';
3
+ import { Json } from "@thisisagile/easy";
3
4
  export declare class PuppeteerElement 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.PuppeteerElement = void 0;
4
+ const easy_1 = require("@thisisagile/easy");
4
5
  class PuppeteerElement {
5
6
  constructor(handle) {
6
7
  this.handle = handle;
@@ -11,6 +12,12 @@ class PuppeteerElement {
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.PuppeteerElement = PuppeteerElement;
16
23
  //# sourceMappingURL=PuppeteerElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PuppeteerElement.js","sourceRoot":"","sources":["../src/PuppeteerElement.ts"],"names":[],"mappings":";;;AAGA,MAAa,gBAAgB;IAC3B,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,4CAUC"}
1
+ {"version":3,"file":"PuppeteerElement.js","sourceRoot":"","sources":["../src/PuppeteerElement.ts"],"names":[],"mappings":";;;AAEA,4CAAqD;AAErD,MAAa,gBAAgB;IAC3B,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,4CAkBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thisisagile/easy-puppeteer",
3
- "version": "8.4.0",
3
+ "version": "8.4.4",
4
4
  "description": "Straightforward wrapper library for Puppeteer 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.0"
37
+ "@thisisagile/easy-test": "8.4.4"
38
38
  },
39
39
  "dependencies": {
40
- "@thisisagile/easy": "8.4.0",
41
- "@thisisagile/easy-test-web": "8.4.0",
40
+ "@thisisagile/easy": "8.4.4",
41
+ "@thisisagile/easy-test-web": "8.4.4",
42
42
  "puppeteer": "^12.0.1"
43
43
  }
44
44
  }
@@ -1,5 +1,6 @@
1
1
  import { ElementHandle } from 'puppeteer';
2
2
  import { TestElement } from '@thisisagile/easy-test-web';
3
+ import { isNotEmpty, Json } from "@thisisagile/easy";
3
4
 
4
5
  export class PuppeteerElement implements TestElement {
5
6
  constructor(private readonly handle: Promise<ElementHandle | null>) {}
@@ -11,4 +12,12 @@ export class PuppeteerElement 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
  }