Skip to content

Commit b3cd284

Browse files
echizenxudafeng
andauthored
feat: 支持配置navigationTimeout参数 (#53)
* feat: 支持配置navigationTimeout参数 * version: 1.12.0 --------- Co-authored-by: xudafeng <xudafeng@126.com>
1 parent 4fe8521 commit b3cd284

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/macaca-playwright.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type TDeviceCaps = {
4040
username?: string;
4141
password?: string;
4242
};
43+
navigationTimeout?: number;
4344
};
4445

4546
class Playwright extends DriverBase {
@@ -144,6 +145,9 @@ class Playwright extends DriverBase {
144145
const browserContext = await this.browser.newContext(newContextOptions);
145146
browserContext.name = contextName;
146147
browserContext.index = index;
148+
if (typeof this.args.navigationTimeout === 'number') {
149+
browserContext.setDefaultNavigationTimeout(this.args.navigationTimeout);
150+
}
147151
this.browserContexts.push(browserContext);
148152
this.browserContext = this.browserContexts[index];
149153
this.pages.push(await this.browserContext.newPage());

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "macaca-playwright",
3-
"version": "1.11.20",
3+
"version": "1.12.0",
44
"description": "Macaca Playwright driver",
55
"keywords": [
66
"playwright",

0 commit comments

Comments
 (0)