graceful-playwright 1.1.8 → 1.2.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/README.md CHANGED
@@ -93,6 +93,7 @@ export class GracefulPage {
93
93
 
94
94
  /** @description proxy method to (await this.getPage())[method] */
95
95
  evaluate: Page['evaluate']
96
+ waitForSelector: Page['waitForSelector']
96
97
  fill: Page['fill']
97
98
  click: Page['click']
98
99
  content: Page['content']
package/core.d.ts CHANGED
@@ -40,6 +40,8 @@ export declare class GracefulPage {
40
40
  autoRetryWhenFailed<T>(f: () => T | Promise<T>): Promise<T>;
41
41
  /** @description proxy method to (await this.getPage()).evaluate */
42
42
  evaluate: Page['evaluate'];
43
+ /** @description proxy method to (await this.getPage()).waitForSelector */
44
+ waitForSelector: Page['waitForSelector'];
43
45
  /** @description proxy method to (await this.getPage()).fill */
44
46
  fill: Page['fill'];
45
47
  /** @description proxy method to (await this.getPage()).click */
package/core.js CHANGED
@@ -62,6 +62,7 @@ class GracefulPage {
62
62
  message.includes('ERR_SOCKET_NOT_CONNECTED') ||
63
63
  message.includes('ERR_ABORTED') ||
64
64
  message.includes('ERR_ADDRESS_UNREACHABLE') ||
65
+ message.includes('ERR_NETWORK_IO_SUSPENDED') ||
65
66
  /page crashed/i.test(message);
66
67
  if (isKnownError) {
67
68
  this.getOnError()(error);
@@ -98,6 +99,11 @@ class GracefulPage {
98
99
  let page = await this.getPage();
99
100
  return await page.evaluate(pageFunction, arg);
100
101
  };
102
+ /** @description proxy method to (await this.getPage()).waitForSelector */
103
+ waitForSelector = async (selector, options) => {
104
+ let page = await this.getPage();
105
+ return await page.waitForSelector(selector, options);
106
+ };
101
107
  /** @description proxy method to (await this.getPage()).fill */
102
108
  fill = async (selector, value, options) => {
103
109
  let page = await this.getPage();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graceful-playwright",
3
- "version": "1.1.8",
3
+ "version": "1.2.0",
4
4
  "description": "Gracefully handle timeout and network error with auto retry.",
5
5
  "keywords": [
6
6
  "graceful",