Skip to content

Commit 37b9291

Browse files
authored
fix: fixed port cdpRequest issue
1 parent 644034f commit 37b9291

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/commands/contexts.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,13 @@ export async function getWebViewDetails(this: NovaWindowsDriver, waitForWebviewM
170170
}
171171

172172
const host = 'localhost';
173-
const port = this.webviewDevtoolsPort;
173+
174+
if ((this.caps.app === 'none' || this.caps.app === 'root' || this.caps.appTopLevelWindow != null) && this.caps.webviewDevtoolsPort == null) {
175+
throw new errors.InvalidArgumentError(`Capability "webviewDevtoolsPort" must be set when using "none", "root", or "appTopLevelWindow" with "enableWebView"`);
176+
}
177+
178+
const port = this.webviewDevtoolsPort ??= this.caps.webviewDevtoolsPort ?? null;
179+
174180
const webViewDetails: WebViewDetails = {
175181
info: await cdpRequest<CDPVersionResponse>({ host, port, endpoint: '/json/version', timeout: 10000 }),
176182
pages: await cdpRequest<CDPListResponse>({ host, port, endpoint: '/json/list', timeout: 10000 }),

0 commit comments

Comments
 (0)