diff --git a/driver/lib/logger.ts b/driver/lib/logger.ts index 7353360a..1c17ef3f 100755 --- a/driver/lib/logger.ts +++ b/driver/lib/logger.ts @@ -1,3 +1,4 @@ import { logger } from '@appium/support'; +import { AppiumLogger } from '@appium/types'; -export const log = logger.getLogger(`FlutterDriver`); +export const log: AppiumLogger = logger.getLogger(`FlutterDriver`); diff --git a/driver/lib/sessions/android.ts b/driver/lib/sessions/android.ts index c4b6f6ca..2d44a3a4 100644 --- a/driver/lib/sessions/android.ts +++ b/driver/lib/sessions/android.ts @@ -1,16 +1,15 @@ import AndroidUiautomator2Driver from 'appium-uiautomator2-driver'; import { log } from '../logger'; import { connectSocket, processLogToGetobservatory } from './observatory'; +import { InitialOpts } from '@appium/types'; export const DRIVER_NAME = `UIAutomator2`; type IsolateSocket = import('./isolate_socket').IsolateSocket; const setupNewAndroidDriver = async (...args: any[]): Promise => { - const androidArgs = { - javascriptEnabled: true, - }; - const androiddriver = new AndroidUiautomator2Driver(androidArgs); + const androiddriver = new AndroidUiautomator2Driver({} as InitialOpts); + // @ts-ignore await androiddriver.createSession(...args); return androiddriver; @@ -49,7 +48,7 @@ export const getObservatoryWsUri = async (proxydriver: AndroidUiautomator2Driver return urlObject.toJSON(); } } else { - urlObject = processLogToGetobservatory(proxydriver.adb.logcat.logs); + urlObject = processLogToGetobservatory(proxydriver.adb.logcat!.logs as [{message: string}]); } const remotePort = urlObject.port; const localPort = caps.forwardingPort ?? remotePort; diff --git a/driver/lib/sessions/ios.ts b/driver/lib/sessions/ios.ts index 59e9eb9e..5d0d99ac 100644 --- a/driver/lib/sessions/ios.ts +++ b/driver/lib/sessions/ios.ts @@ -7,6 +7,7 @@ import net from 'net'; import { checkPortStatus } from 'portscanner'; import { log } from '../logger'; import { connectSocket, processLogToGetobservatory } from './observatory'; +import { InitialOpts } from '@appium/types'; const LOCALHOST = `127.0.0.1`; const PORT_CLOSE_TIMEOUT = 15 * 1000; // 15 seconds @@ -15,11 +16,7 @@ type IsolateSocket = import('./isolate_socket').IsolateSocket; const setupNewIOSDriver = async (...args: any[]): Promise => { - const iosArgs = { - javascriptEnabled: true, - }; - - const iosdriver = new XCUITestDriver(iosArgs); + const iosdriver = new XCUITestDriver({} as InitialOpts); await iosdriver.createSession(...args); return iosdriver; diff --git a/driver/lib/sessions/session.ts b/driver/lib/sessions/session.ts index c6d0ddaf..80061c33 100644 --- a/driver/lib/sessions/session.ts +++ b/driver/lib/sessions/session.ts @@ -23,7 +23,7 @@ export const reConnectFlutterDriver = async function(this: FlutterDriver, caps: } }; -export const createSession = async function(this: FlutterDriver, sessionId: string, caps, ...args) { +export const createSession: any = async function(this: FlutterDriver, sessionId: string, caps, ...args) { try { // setup proxies - if platformName is not empty, make it less case sensitive if (caps.platformName) { diff --git a/driver/package.json b/driver/package.json index 1157dcf6..e64c45f9 100644 --- a/driver/package.json +++ b/driver/package.json @@ -75,7 +75,7 @@ "appium-android-driver": "^5.2.2", "appium-ios-device": "^2.4.1", "appium-uiautomator2-driver": "^2.29.4", - "appium-xcuitest-driver": "5.6.0", + "appium-xcuitest-driver": "5.7.0", "asyncbox": "^2.3.1", "bluebird": "^3.1.1", "lodash": "^4.0.0",