appium/appium-flutter-driver

Unknown mobile command "flutter:checkHealth"

pranay289 opened this issue · 0 comments

I am getting Unknown mobile command "flutter:checkHealth". error while using this script assert.strictEqual(await driver.execute('flutter:checkHealth'), 'ok'); can anyone please help me regarding to this. I am using typescript for this.

Error

Unknown mobile command "flutter:longClickGesture". Only shell, execEmuConsoleCommand, dragGesture, flingGesture, doubleClickGesture, clickGesture, longClickGesture, pinchCloseGesture, pinchOpenGesture, swipeGesture, scrollGesture, scrollBackTo, scroll, viewportScreenshot, viewportRect, deepLink, startLogsBroadcast, stopLogsBroadcast, deviceidle, acceptAlert, dismissAlert, batteryInfo, deviceInfo, getDeviceTime, changePermissions, getPermissions, performEditorAction, startScreenStreaming, stopScreenStreaming, getNotifications, openNotifications, listSms, type, replaceElementValue, pushFile, pullFile, pullFolder, deleteFile, isAppInstalled, queryAppState, activateApp, removeApp, terminateApp, installApp, clearApp, backgroundApp, getCurrentActivity, getCurrentPackage, startActivity, startService, stopService, broadcast, getContexts, getAppStrings, installMultipleApks, lock, unlock, isLocked, refreshGpsCache, startMediaProjectionRecording, isMediaProjectionRecordingRunning, stopMediaProjectionRecording, getConnectivity, setConnectivity, toggleGps, isGpsEnabled, hideKeyboard, isKeyboardShown, pressKey, getDisplayDensity, getSystemBars, fingerprint, sendSms, gsmCall, gsmSignal, gsmVoice, powerAc, powerCapacity, networkSpeed, sensorSet, getPerformanceData, getPerformanceDataTypes, statusBar, screenshots, scheduleAction, getActionHistory, unscheduleAction, getUiMode, setUiMode, sendTrimMemory commands are supported.

Here is my sample code


import * as find from "appium-flutter-finder"; 
import * as assert from "assert";
// import * as wdio from "webdriverio";
// import type { Options } from '@wdio/types'

// const config: Options.WebdriverIO = {
//     hostname: 'http://localhost',
//     port: 4444,
//     capabilities: {
//         browserName: 'Chrome'
//     }
// }
describe('Launch app', () => {
    it('Sigin screen', async () => {
        const buttonFinder = find.byValueKey('increment');

    //    assert.strictEqual(await driver.getElementText("Log in"),"Log in")
    //    const driver = await wdio.remote();
        assert.strictEqual(await driver.execute('flutter:checkHealth'), 'ok');
        await driver.elementClick(buttonFinder);
        // await driver.touchAction({
        //     action:'tap',
        // });
    //    await driver.touchAction({
    //     action: 'tap',
    //     element: { elementId: buttonFinder }
    //   });

    })
})

and also this script assert.strictEqual(await driver.execute('flutter:waitFor'), buttonPressed); not working same issue with this

From flutter side I have done this things

void main() async {
  enableFlutterDriverExtension();
 }

Is there anything I am missing?