appium-flutter-driver
appium-flutter-driver copied to clipboard
Flutter driver should have helpful log around setContext
The problem
I do a driver.context("FLUTTER) and get a strange log output which shows that the context is not switched. But the flutter driver can work afterwards in flutter context and a getContext delivers correctly set context "Flutter" So it seems only a wrong log output.
Posted this in the appium server repository, there i got the answer : 'Unfortunately flutter driver does not belong to the list of drivers officially supported by Appium team'
Environment
- Appium version (or git revision) that exhibits the issue: 2@beta27
- Last Appium version that did not exhibit the issue (if applicable): n/a
- Desktop OS/version used to run Appium: Mac
- Node.js version (unless using Appium.app|exe): 14
- Npm or Yarn package manager:
- Mobile platform/version under test: iOS
- Real device or emulator/simulator: emulator
- Appium CLI or Appium.app|exe: CLI
Details
In the Log snippet below you can see that i do a getContexts and printing the current contexts into the log. Afterwards i change the context to FLUTTER, but the log says "switching from NATIVE to NATIVE" If i do a getContext, i get correctly "FLUTTER"
Link to Appium logs
2022-03-30 07:16:20:690 - [debug] [FlutterDriver@3c0f (27dab2e3)] Responding to client with driver.getContexts() result: ["NATIVE_APP","FLUTTER"]
2022-03-30 07:16:20:691 - [HTTP] <-- GET /session/27dab2e3-6a7c-4870-958a-774a1330ec12/contexts 200 93 ms - 34
2022-03-30 07:16:20:692 - [HTTP]
2022-03-30 07:16:20:693 - NATIVE_APP
2022-03-30 07:16:20:693 - FLUTTER
2022-03-30 07:16:20:696 - [HTTP] --> POST /session/27dab2e3-6a7c-4870-958a-774a1330ec12/context
2022-03-30 07:16:20:697 - [HTTP] {"name":"FLUTTER"}
2022-03-30 07:16:20:698 - [debug] [FlutterDriver@3c0f (27dab2e3)] Calling AppiumDriver.setContext() with args: ["FLUTTER","27dab2e3-6a7c-4870-958a-774a1330ec12"]
2022-03-30 07:16:20:698 - [AppiumDriver@731e] Plugins which can handle cmd 'setContext': images
2022-03-30 07:16:20:698 - [AppiumDriver@731e] Plugin images is now handling cmd 'setContext'
2022-03-30 07:16:20:699 - [AppiumDriver@731e] Executing default handling behavior for command 'setContext'
2022-03-30 07:16:20:699 - [debug] [FlutterDriver] Executing Flutter driver command 'setContext'
2022-03-30 07:16:20:699 - [debug] [XCUITest] Attempting to set context to 'NATIVE_APP' from 'NATIVE_APP'
2022-03-30 07:16:20:699 - [debug] [XCUITest] Already in 'NATIVE_APP' context. Doing nothing.
2022-03-30 07:16:20:700 - [debug] [FlutterDriver@3c0f (27dab2e3)] Responding to client with driver.setContext() result: null