-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Flutter Web] - Question about support flutter web application #263
Comments
i haven't used the flutter web, but if it is a web server via dom that can be accessible in mobile browsers, simply you can use UIA2/XCUITest driver's web testing. https://appium.io/docs/en/writing-running-appium/web/mobile-web/ if they are running on Dart VM in browser, maybe this driver will need to add a new feature |
|
This driver finds a WebSocket to the Dart VM in https://github.com/appium-userland/appium-flutter-driver/blob/main/driver/lib/sessions/observatory.ts#L142-L145 , so if you know the way to get the observatory URL in the desktop app, the code can follow it. https://github.com/appium-userland/appium-flutter-driver/blob/main/driver/lib/sessions/session.ts#L13 is the place to handle Android/iOS. I guess this driver will need to have the ability to start a chrome browser, and manage it. https://github.com/appium-userland/appium-flutter-driver/blob/main/driver/lib/sessions/session.ts#L13 is where this driver should switch the app under test. |
hum, thanks, I see it's a big feature, and takes a long time to make it work well. Step to implement this feature as I know, please correct me if I am wrong. 1, write
I need to find ways to get the observatory URL and create a session with it. that is hard technical for a newbie, and sadly now I have no idea to resolve it. 2, add more logic to handle the chrome driver session at 3, ... |
@KazuCocoa do u have any idea and plan to implement this feature? |
ohh, supprised, I see u comment in appium-chromedriver, I guess u have strong experience with Chrome driver. That sounds good :) |
We should read/know of Flutter's implementation. In Android, the URL is available in the logcat. In iOS, it is in the system log.
No plan for now. I've maintained this project voluntarily, but I have no much time to focus on this project as appium development in my most of private time development for OSS. By reading this thread, I guess once you find a way to attach to the Dart VM, it is not so difficult to implement some features. If it needs a new capability like |
btw, does the flutter web require desktop chromium browsers for testing? Or Firefox/Safari, or mobile chrome also work...? |
@KazuCocoa at the moment, we only need to run test flutter web on desktop chromium browsers, but for the long term, we also need to check in other browsers as u said. |
@KazuCocoa yep, a lot of useful info here, but I have some confusion:
I read the implementation code for android it seen hard for me to convert it to the chrome session. Pls help me, I really appreciate your time development for the OSS project.
that is bad news for us at this time. |
Do you mean you'd like to handle the chrome via chromedriver as well? So, like other android and ios, in the case also can switch contexts with flutter and webview (chromedriver)? Both are not difficult. More important thing is how to attach to a Dart VM socket over websocket. Managing a browser (launch/stop the process) is the next step. https://github.com/appium-userland/appium-flutter-driver/blob/main/driver/lib/sessions/android.ts#L24 starts a UIA2 driver session to manage the app. So UIA2 starts the app under test, and allow the session to manage non-flutter layer as NATIVE and WebView contexts. https://github.com/appium-userland/appium-flutter-driver/blob/main/driver/lib/sessions/android.ts#L27 gets the observatory URL from the device logcat. Once the socket connection succeeds, you can send flutter commands via the session. |
Yep, it's like appium for android/ios already doing well, it can switch contexts with flutter and native, webview ... in detail, Java code, I start testing web using chrome driver.
It starts chrome desktop web browser, But, How can we manage chrome driver with appium driver?? or any other way to start testing desktop web browsers via appium driver? After that, in driver, we need to update logic for the chrome session 2, attach to a Dart VM socket over websocket 3, remove Honestly, it's easy for u, but many info we need to understand, and hard to know how to make it work :) |
For fast-moving, could u write a scaffold code to implement this feature? I know at this time u do not have much time, but I got stuck with implementing this feature, :) |
the appum-chromedriver hasn't tested against web browser one, so I'm not sure how it works as-is. So far, appium is not for desktop browsers.
For this point, how can we know of the WebSocket URL that this flutter-driver need to attach to in the flutter web? Like https://github.com/appium-userland/appium-flutter-driver/pull/264/files#diff-2d098b30480f3d2c04ff2e94d5b06d801d2df603df05e8d5ac7fb4d798621bb8R29 , if we have a way to get the url somehow, this flutter context can attach to the url with existing methods. (then, a new method for non-android and ios will need, but can add similar way) Theoritically, this flutter driver only needs the WebSocket URL, but still not clear how we can get it in the flutter for Web case. So,
Then, you have 2 driver instances in your java code. You may can send flutter command to the 2). Btw, have you attach to the Flutter for Web's Dart VM over websocket somehow? (this is not this driver specific thing) |
Just adding a note that this is a desired feature. (would be better than writing Flutter Integration test code) |
@vannt1991 Any progress? Perhaps you can share your latest code so that I can take a crack at it? |
Hi @KazuCocoa @truongsinh ,
Firstly, thank you so much for the great library, but we want to use automation based on this lib for the flutter web app, could u give us some suggestions or examples to implement this task.
Thanks and Regards
The text was updated successfully, but these errors were encountered: