Skip to content

Commit

Permalink
feat: 支持配置navigationTimeout参数 (#53)
Browse files Browse the repository at this point in the history
* feat: 支持配置navigationTimeout参数

* version: 1.12.0

---------

Co-authored-by: xudafeng <[email protected]>
  • Loading branch information
echizen and xudafeng authored Aug 15, 2024
1 parent 4fe8521 commit b3cd284
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/macaca-playwright.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type TDeviceCaps = {
username?: string;
password?: string;
};
navigationTimeout?: number;
};

class Playwright extends DriverBase {
Expand Down Expand Up @@ -144,6 +145,9 @@ class Playwright extends DriverBase {
const browserContext = await this.browser.newContext(newContextOptions);
browserContext.name = contextName;
browserContext.index = index;
if (typeof this.args.navigationTimeout === 'number') {
browserContext.setDefaultNavigationTimeout(this.args.navigationTimeout);
}
this.browserContexts.push(browserContext);
this.browserContext = this.browserContexts[index];
this.pages.push(await this.browserContext.newPage());
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "macaca-playwright",
"version": "1.11.20",
"version": "1.12.0",
"description": "Macaca Playwright driver",
"keywords": [
"playwright",
Expand Down

0 comments on commit b3cd284

Please sign in to comment.