@intuned/runtime-dev 0.1.0-test.22 → 0.1.0-test.23

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.
@@ -14,5 +14,5 @@ async function tsNodeImport(apiFilePath) {
14
14
  }
15
15
  });
16
16
  const imported = await (specifier => new Promise(r => r(`${specifier}`)).then(s => _interopRequireWildcard(require(s))))(apiFilePath);
17
- return imported.default;
17
+ return imported;
18
18
  }
@@ -87,6 +87,26 @@ async function* runApiGenerator({
87
87
  page,
88
88
  context
89
89
  } = await (0, _getPlaywrightConstructs.getPlaywrightConstructsForMode)(mode, cdpAddress, auth === null || auth === void 0 ? void 0 : auth.session));
90
+ let isPageStable = false;
91
+ let retry = 0;
92
+ while (!isPageStable && retry < 10) {
93
+ try {
94
+ await page.locator("html").all();
95
+ isPageStable = true;
96
+ break;
97
+ } catch (error) {
98
+ var _error$message;
99
+ if (error !== null && error !== void 0 && (_error$message = error.message) !== null && _error$message !== void 0 && _error$message.includes("Execution context was destroyed")) {
100
+ await new Promise(resolve => setTimeout(resolve, 200));
101
+ } else {
102
+ throw error;
103
+ }
104
+ }
105
+ retry++;
106
+ }
107
+ if (!isPageStable) {
108
+ return (0, _neverthrow.err)(new _errors.AutomationError("The page is not stable, try to run again"));
109
+ }
90
110
  }
91
111
  const executionContext = (0, _asyncLocalStorage.getExecutionContext)();
92
112
  if (!executionContext) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "0.1.0-test.22",
3
+ "version": "0.1.0-test.23",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -94,7 +94,8 @@
94
94
  "typescript": "^5.1.6",
95
95
  "wait-on": "^7.2.0",
96
96
  "zod": "^3.21.4",
97
- "zod-validation-error": "^3.0.3"
97
+ "zod-validation-error": "^3.0.3",
98
+ "ts-node": "^10.9.1"
98
99
  },
99
100
  "devDependencies": {
100
101
  "@babel/cli": "^7.23.4",