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

Add Appium test to install app from Play store with Lantern running #906

Merged
merged 20 commits into from
Oct 10, 2023

Conversation

atavism
Copy link
Contributor

@atavism atavism commented Sep 10, 2023

Adding this test to help us debug https://github.com/getlantern/engineering/issues/223 further and it should be extremely useful

Here's how the test currently works (with Lantern running)..

  • Try to establish a session with the Play store
  • Check Google Play features are working
  • Install an app ("Google Home") from the Play store
  • Launch the installed app

Not ready for review yet, I need to check how the test runs

@atavism atavism changed the title Add Appium test to install and open app from Play store with Lantern running Add Appium test to install app from Play store with Lantern running Sep 10, 2023
@atavism atavism changed the title Add Appium test to install app from Play store with Lantern running [WIP] Add Appium test to install app from Play store with Lantern running Sep 10, 2023
@atavism atavism changed the title [WIP] Add Appium test to install app from Play store with Lantern running Add Appium test to install app from Play store with Lantern running Sep 10, 2023
@atavism
Copy link
Contributor Author

atavism commented Sep 25, 2023

Ok with Browserstack CI fixed, checking if the test runs successfully now.

@atavism
Copy link
Contributor Author

atavism commented Sep 25, 2023

The test is failing for some reason:

GooglePlayTest > userJourneyTests(int) > appium_kotlin.tests.GooglePlayTest.userJourneyTests(int)[2] STANDARD_ERROR
    org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. 
    Host info: host: 'fv-az453-286', ip: '10.1.0.188'
    	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:561)
    	at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:274)
    	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:157)
    	at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:89)
    	at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:101)
    	at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:113)
    	at appium_kotlin.tests.BaseTest.setupAndCreateConnection(BaseTest.kt:140)

@atavism
Copy link
Contributor Author

atavism commented Sep 27, 2023

I fixed that issue: I realized we could launch the Google Play app using the existing Android driver without having to create a second instance

@atavism
Copy link
Contributor Author

atavism commented Sep 27, 2023

I'm able to run the full test now using a local Appium server with..

./gradlew test --tests '*GooglePlay*'

I didn't realize it was necessary to make changes to local_config.json to get all this to work. To save others trouble in the future, I updated the README with instructions for running the Appium tests locally.

@atavism atavism requested a review from jigar-f October 2, 2023 09:09
@jigar-f
Copy link
Contributor

jigar-f commented Oct 3, 2023

@ atavism I see tests are still failing on Browerstack, the issue is that Dart-define values are not being passed to Flutter, and enableFlutterDriverExtension is not enabled.

Should we go ahead and create a new product flavor for the Appium test? What do you think let me know, I am open to other suggestions. Also, Let's keep in mind that we might need to few more changes for IOS as well, but that is for later not right now.

@atavism atavism force-pushed the atavism/google-play-test branch from 468c31e to 775eeea Compare October 3, 2023 09:22
@atavism
Copy link
Contributor Author

atavism commented Oct 4, 2023

I see tests are still failing on Browerstack, the issue is that Dart-define values are not being passed to Flutter, and enableFlutterDriverExtension is not enabled.

Is this still an issue? We are passing CI=true via dart defines for debug builds: https://github.com/getlantern/android-lantern/blob/main/Makefile#L302

Should we go ahead and create a new product flavor for the Appium test?

Yeah, sounds good to me!

@jigar-f
Copy link
Contributor

jigar-f commented Oct 4, 2023

I see tests are still failing on Browerstack, the issue is that Dart-define values are not being passed to Flutter, and enableFlutterDriverExtension is not enabled.
Is this still an issue? We are passing CI=true via dart defines for debug builds: https://github.com/getlantern/android-lantern/blob/main/Makefile#L302

Yes, That is still an issue, somehow when running from CI dart-define not getting, While building we are getting logs but flutter not picking up, You can find full logs in CI.

Value of DART_DEFINES is: make[1]: Entering directory '/home/runner/work/android-lantern/android-lantern'
[140](https://github.com/getlantern/android-lantern/actions/runs/6391310922/job/17346307642#step:12:141)
Q0k9dHJ1ZQ==make[1]: Leaving directory '/home/runner/work/android-lantern/android-lantern'
[141](https://github.com/getlantern/android-lantern/actions/runs/6391310922/job/17346307642#step:12:142)
Value of CI is: true

Also let's create a card for Appium flavor

@atavism
Copy link
Contributor Author

atavism commented Oct 4, 2023

Also let's create a card for Appium flavor

@jigar-f https://github.com/getlantern/engineering/issues/460

@jigar-f
Copy link
Contributor

jigar-f commented Oct 10, 2023

@atavism Can you take look at this, Once this PR is merged we can merge this as well, with new changes.

@atavism atavism merged commit 12a6704 into main Oct 10, 2023
4 of 5 checks passed
@atavism atavism deleted the atavism/google-play-test branch October 10, 2023 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants