mobile-dev-inc / maestro

Painless Mobile UI Automation
https://maestro.mobile.dev/
Apache License 2.0
5.86k stars 280 forks source link

After the update, when running the tests it is asking to inform the operating system and version #1845

Open AnaLuisaFav opened 3 months ago

AnaLuisaFav commented 3 months ago

Is there an existing issue for this?

Steps to reproduce

  1. Get the new version curl -Ls "https://get.maestro.mobile.dev" | bash
  2. Run tests

Actual results

Everything was working ok with the emulator configured before the update. But now, when I run my tests it is asking to inform the operating system and version, even with the emulator already open.

------------------ Shard 1 ------------------ 
Please specify a device platform [android, ios, web]: 
android 
Please specify Android version [34, 33, 31, 30, 29, 28]: Press ENTER for default (30)

Expected results

For the tests to run normally without a manual entry.

About app

It's a confidential flutter app available in Android and iOS, but I'm using the Android version.

About environment

I'm on a DELL Notebook 15" Windows 11 (WSL Ubuntu)

Logs

Logs ``` ```

Maestro version

1.37.0

How did you install Maestro?

install script (https://get.maestro.mobile.dev)

Anything else?

No response

nson22 commented 3 months ago

Same issue, I downgrade

bartekpacia commented 3 months ago

Hey @AnaLuisaFav and @nson22, sorry about the problem.

  1. Run tests

Can you tell me more about:

partparsh commented 3 months ago

Hi @bartekpacia I am also facing the same issue,

I am using WSL2 on Windows 11

What (and how many) device do you have running?

1 Android emulator device on Windows

Steps to reproduce

  1. Install the app on Android emulator, run adb devices to get device identifier emulator-5554
  2. run adb -a -P 5037 nodaemon server on Windows Powershell to start adb server
  3. run maestro --host $WSL_HOST test run-tests.yaml where $WSL_HOST is ip address of windows 11

Actual results

The flow does not start and shard configuration is being asked

------------------ Shard 1 ------------------

Please specify a device platform [android, ios, web]:

Expected Result

Maestro should recognise the running emulator and start the test against it.

Observations:

I was able to make the tests run against the running emulator by specifying the --udid Following command worked for me: maestro --udid=emulator-5554 --host $WSL_HOST test run-tests.yaml

curaserkan commented 3 months ago

Also, we don't choose the iPhone version; we choose only the iOS platform and iOS version. It's created only iPhone11 version

Old version: Screenshot 2024-07-30 at 08 39 30 Screenshot 2024-07-30 at 08 39 50

New Version:

Screenshot 2024-07-30 at 08 45 43

nson22 commented 3 months ago

Hey @AnaLuisaFav and @nson22, sorry about the problem.

  1. Run tests

Can you tell me more about:

  • What (and how many) device do you have running?
  • What does the command you're running look like, exactly?

I can't tell what went wrong yesterday but now is working fine I also update to version https://github.com/mobile-dev-inc/maestro/releases/tag/cli-1.37.4

AnaLuisaFav commented 3 months ago

@bartekpacia @nson22 hey!

nson22 commented 3 months ago

@bartekpacia @nson22 hey!

  • I was running on 1 emulator device (Pixel 4 API Android VanillaIceCream)
  • The steps was same as @partparsh:
    1. Install the app on Android emulator, run adb devices to get device identifier emulator-5554
    2. run adb -a -P 5037 nodaemon server on Windows Powershell to start adb server
    3. run maestro --host $WSL_HOST test run-tests.yaml where $WSL_HOST is ip address of windows 11

@AnaLuisaFav I'm using a Linux machine, but I downgrade my Java version to 11 and upgrade mastro to the latest CLI Maybe you can try the same on your wsl env

bartekpacia commented 3 months ago

Does this only occur on Windows (WSL) hosts? Did someone experience this on Linux and/or macOS?

This might be related to #1851 and #1799.

AnaLuisaFav commented 3 months ago

@nson22 I downgrade maestro and it started working again. But I wanted to use a feature that is in the new version, so I need this to be adjusted. xD

AnaLuisaFav commented 3 months ago

@bartekpacia Yes, in WSL host. I don't know if anyone has had the same experience with Linux and/or macOS

nson22 commented 3 months ago

Does this only occur on Windows (WSL) hosts? Did someone experience this on Linux and/or macOS?

This might be related to #1851 and #1799.

Linux working fine

bartekpacia commented 3 months ago

It seems to me that the actual problem is this:

After v1.37.x, Maestro does not detect running devices on WSL, and always asks to create a new device

then it may be similar to #1863

AnaLuisaFav commented 3 months ago

@bartekpacia Yeah, that's it. Any news here? I would really like to use the new features of the new version, and this case is blocking me :')

It seems to me that the actual problem is this:

After v1.37.x, Maestro does not detect running devices on WSL, and always asks to create a new device

then it may be similar to #1863

dannmf commented 3 months ago

I have the same problem, I use WSL Windows 10 and I'm trying to use a tool with an Android device... image

ggetorres commented 3 months ago

Can anyone help with this error?

❌ Error: BlockingCoroutine is cancelling kotlinx.coroutines.JobCancellationException: BlockingCoroutine is cancelling; job=BlockingCoroutine{Cancelling}@2973afa0 Caused by: maestro.cli.CliError: Unable to start device: Maestro_Pixel_6_API_31_1 at maestro.cli.device.DeviceService.startDevice(DeviceService.kt:74) at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1.invokeSuspend(TestCommand.kt:237) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

curlycrow commented 2 months ago

Hi @bartekpacia I am also facing the same issue,

I am using WSL2 on Windows 11

What (and how many) device do you have running?

1 Android emulator device on Windows

Steps to reproduce

1. Install the app on Android emulator, run `adb devices` to get device identifier `emulator-5554`

2. run `adb -a -P 5037 nodaemon server` on Windows Powershell to start adb server

3. run `maestro --host $WSL_HOST test run-tests.yaml` where $WSL_HOST is ip address of windows 11

Actual results

The flow does not start and shard configuration is being asked

------------------ Shard 1 ------------------

Please specify a device platform [android, ios, web]:

Expected Result

Maestro should recognise the running emulator and start the test against it.

Observations:

I was able to make the tests run against the running emulator by specifying the --udid Following command worked for me: maestro --udid=emulator-5554 --host $WSL_HOST test run-tests.yaml

thank u , this is the solution

TheNextBigThing14 commented 2 months ago

InkedScreenshot 2024-09-10 153509 can somebody help with this?