From 3b2478b417f4cf0e74e7b5aa7a32a456f30c79a8 Mon Sep 17 00:00:00 2001 From: SmartBear <471110230@qq.com> Date: Thu, 12 Oct 2023 01:27:47 -0500 Subject: [PATCH] fix: setContext (#62) * fix: setWindow * fix: setContext --- lib/server/controllers/context.js | 3 ++- lib/server/controllers/window.js | 3 ++- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/server/controllers/context.js b/lib/server/controllers/context.js index 092791b..11984b7 100644 --- a/lib/server/controllers/context.js +++ b/lib/server/controllers/context.js @@ -13,7 +13,8 @@ function *getContexts(next) { function *setContext(next) { const body = this.request.body; const name = body.name; - yield this.device.setContext(name); + const opts = body.opts; + yield this.device.setContext(name, opts); this.state.value = null; yield next; } diff --git a/lib/server/controllers/window.js b/lib/server/controllers/window.js index 5e44ce8..b388805 100644 --- a/lib/server/controllers/window.js +++ b/lib/server/controllers/window.js @@ -11,7 +11,8 @@ function *getWindows(next) { } function *getWindowSize(next) { - this.state.value = yield this.device.getWindowSize(); + const windowHandle = this.params.windowHandle; + this.state.value = yield this.device.getWindowSize(windowHandle); yield next; } diff --git a/package.json b/package.json index 5781f56..b84991f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webdriver-server", - "version": "1.3.0", + "version": "1.3.1", "description": "webdriver server", "keywords": [ "webdriver",