Skip to content

Commit

Permalink
Fix more types
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Jul 24, 2024
1 parent cfcfbea commit 2a0f599
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/commands/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const extensions = {
*/
let ctxs = [{id: NATIVE_WIN, view: {}}];
this.contexts = [NATIVE_WIN];
for (let view of webviews) {
for (const view of webviews) {
ctxs.push({id: `${WEBVIEW_BASE}${view.id}`, view});
this.contexts.push(view.id.toString());
}
Expand Down Expand Up @@ -158,7 +158,7 @@ const extensions = {
this.curWebFrames = [];
});

await this.remote.connect(this.opts.webviewConnectTimeout);
await this.remote.connect();
},

/**
Expand Down
10 changes: 6 additions & 4 deletions lib/commands/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ const helpers = {
*/
async _deleteCookie(cookie) {
const url = `http${cookie.secure ? 's' : ''}://${cookie.domain}${cookie.path}`;
return await (/** @type {import('appium-remote-debugger').RemoteDebugger} */ (this.remote)).deleteCookie(cookie.name, url);
return await (/** @type {RemoteDebugger} */ (this.remote)).deleteCookie(cookie.name, url);
},
/**
* @this {XCUITestDriver}
Expand Down Expand Up @@ -351,18 +351,20 @@ const helpers = {
*/
async executeAtom(atom, args, alwaysDefaultFrame = false) {
let frames = alwaysDefaultFrame === true ? [] : this.curWebFrames;
let promise = (/** @type {import('appium-remote-debugger').RemoteDebugger} */ (this.remote)).executeAtom(atom, args, frames);
let promise = (/** @type {RemoteDebugger} */ (this.remote)).executeAtom(atom, args, frames);
return await this.waitForAtom(promise);
},
/**
* @this {XCUITestDriver}
* @param {string} atom
* @param {any[]} args
*/
async executeAtomAsync(atom, args, responseUrl) {
async executeAtomAsync(atom, args) {
// save the resolve and reject methods of the promise to be waited for
let promise = new B((resolve, reject) => {
this.asyncPromise = {resolve, reject};
});
await (/** @type {RemoteDebugger} */ (this.remote)).executeAtomAsync(atom, args, this.curWebFrames, responseUrl);
await (/** @type {RemoteDebugger} */ (this.remote)).executeAtomAsync(atom, args, this.curWebFrames);
return await this.waitForAtom(promise);
},
/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"appium-idb": "^1.6.13",
"appium-ios-device": "^2.5.4",
"appium-ios-simulator": "^6.1.7",
"appium-remote-debugger": "^11.4.0",
"appium-remote-debugger": "^11.4.2",
"appium-webdriveragent": "^8.7.8",
"appium-xcode": "^5.1.4",
"async-lock": "^1.4.0",
Expand Down

0 comments on commit 2a0f599

Please sign in to comment.