Skip to content
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

Screenset Webviews not debuggable using Appium #84

Open
3 tasks done
MewanWA opened this issue Nov 14, 2024 · 0 comments
Open
3 tasks done

Screenset Webviews not debuggable using Appium #84

MewanWA opened this issue Nov 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MewanWA
Copy link
Contributor

MewanWA commented Nov 14, 2024

Checklist

  • The issue can be reproduced in the attached sample application in the repository.
  • I have read the relevant SDK documentation and have not found a suitable solution or answer.
  • I agree to the terms within the SAP Code of Conduct.

Description

We are currently using Appium to build a few tests that concern Auth. We use Native Screensets and need to access the context of the Screenset in order to perform actions on it with the Appium driver. Currently its not available when using the gigya_flutter_plugin. However, I was able to make it work by making a few changes as its already implemented in iOS.

https://github.com/SAP/gigya-swift-sdk/blob/1ace6fd17dbd04478da429e112f04a0109883565/GigyaSwift/Global/Plugins/GigyaWebBridge.swift#L89

All we need to do is set the GigyaLogger to debug mode if user is running the app in Debug mode. This will ensure the WKWebView is inspectable.

For Android, we need to set the WebView.setWebContentsDebuggingEnabled(true). This has not been implemented yet in Android SDK by checking for the GigyaLogger.isDebug() value, but it can be enabled globally without needing access to that specific WebView using WebView.setWebContentsDebuggingEnabled(true).

Suggestion:
Accept a isDebug value in showScreenSet SDK function. If this is true, we will set GigyaLogger to debug in iOS and in Android we will call WebView.setWebContentsDebuggingEnabled(true).

Instead of adding a new isDebug bool value, we can also use BuildConfig.DEBUG (Android) or #if DEBUG (iOS). Although this would make it a bit restricted for the users as those values are tied to the build rather than what the Flutter app passes via a function. But in most cases, this would work fine.

I will create a PR with the suggested fix above.

Reproduction

  1. Run iOS or Android Flutter App
  2. Run Appium server
  3. Try and access WebView context

Additional context

No response

SDK version

1.0.5

Android/iOS

Android/iOS

@MewanWA MewanWA added the bug Something isn't working label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant