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

Can't interact with the emulator anymore when tests are paused/waiting v2.3.1+1 #1956

Closed
adrian-moisa opened this issue Nov 25, 2023 · 8 comments · Fixed by #2008
Closed
Assignees
Labels
bug Something isn't working P0 Critical issues such as a build break or regression package: patrol Related to the patrol package (native automation, test bundling)

Comments

@adrian-moisa
Copy link

Steps to reproduce

Run the emulator and start patrol develop on a test that has a delay. In older versions I was able to tap around, scroll views. I'm using await Future.delayed(Duration(minutes: 5)); to hold the test waiting.

Actual results

  • Now it seems the emulator is no longer responding. I don't see the coloured cross when I tap around. I only see it for interactions originating from the test.
  • Regular emulator works just fine, responsive to inputs.
  • Tests are running fine, all interactions happen, including rendering the coloured cross.

Logs

Logs
No error at all

Patrol version

patrol_cli v2.3.1+1

Patrol Doctor output

Patrol Doctor output
[✓] Flutter (Channel stable, 3.16.0, on macOS 13.4 22F66 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.84.2)
[✓] Connected device (3 available)
[✓] Network resources

Flutter Doctor output

Flutter Doctor output
<!-- Replace this line with your logs. Do not remove the backticks! -->
@adrian-moisa adrian-moisa changed the title Can't interact with the emulator anymore when tests are paused/waiting Can't interact with the emulator anymore when tests are paused/waiting v2.3.1+1 Nov 25, 2023
@jBorkowska jBorkowska self-assigned this Nov 27, 2023
@jBorkowska jBorkowska added the package: patrol Related to the patrol package (native automation, test bundling) label Nov 27, 2023
@jBorkowska
Copy link
Collaborator

Hi @adrian-moisa, I confirm this issue happens, just checked it on my machine. Though I'm not sure if it's a valid issue, bc we never supported it explicitly 😅 It may be caused by latest changes to initialization of bindings in patrolTest.

A question: why did you need this working? What is the use case? Maybe there is another way of solving it or we should think about such a feature in the future

@jBorkowska jBorkowska added the waiting for response Waiting for user's response label Nov 27, 2023
@adrian-moisa
Copy link
Author

Tbh, it's highly convenient to be able to explore what the app does during the testing. What happens is that you write some steps then arrive at a state, then you have to do smth else, maybe scroll, or click on smth. A lot of trial and error. So it helps if you are able to pick up the test in the spot where it was last executed and continue manually with the next step. It's especially useful when you have to orchestrate various transitions/clicks. It can be done by having the web view running in parallel as well, but not everybody has a powerful dev machine. So it would be handy for many people to do the testing and tapping on the live emulator instance instead of running two. I'm ok as well with my mac to run 2 builds even 3 in parallel. But it still requires manual hassle, context switching and backtracking. So overall, having the ability to tap around is handy. Makes life better. It's not a deal breaker, but it was one of the nice to have, quality of life things.

@github-actions github-actions bot removed the waiting for response Waiting for user's response label Nov 27, 2023
@jBorkowska
Copy link
Collaborator

Okay, I understand your issue. Actually, you are able to do it, but not while Future.delayed is executing, bc the app is stopped as well at the same time. Though there is another way - after the test fails in patrol develop mode, you can freely navigate in your app. But test have to fail, bc if it passes, 'Test finished' screen is shown and you can't use the app.

We were discussing this use case lately, but haven't figure out how to design and implement it. I recommend checking out the workaround that I mentioned before then

@jBorkowska jBorkowska added the P2 Issues not at the top of the work list label Nov 27, 2023
@bartekpacia
Copy link
Contributor

I'd consider this a bug. The cause is likely the changes made in 3.0, more specifically in this PR.

In PatrolBinding, I removed override of pointerEventSource (see this) in favor of shouldPropagateDevicePointerEvents (see this). That's the only idea I have that might be the cause. But it's very strange, that change should make no difference in behavior at all.

@adrian-moisa, you might want to locally modify PatrolBinding to bring that override back and tell us the results. If it will work, feel free to make a PR re-adding it.

@bartekpacia bartekpacia added the bug Something isn't working label Nov 27, 2023
@bartekpacia
Copy link
Contributor

@adrian-moisa Do you mean Patrol 3.0? I think the version you have in issue title is the Patrol CLI version. Could you clarify?

@adrian-moisa
Copy link
Author

adrian-moisa commented Nov 30, 2023

This is ma current version o patrol. I thought they are in lock step, patrol and cli. patrol: 3.0.2+1 & patrol_cli v2.3.1+1

@jBorkowska jBorkowska added P0 Critical issues such as a build break or regression and removed P2 Issues not at the top of the work list labels Dec 11, 2023
@jBorkowska jBorkowska removed their assignment Dec 11, 2023
@bartekpacia bartekpacia self-assigned this Dec 13, 2023
@bartekpacia
Copy link
Contributor

Thanks for bringing this issue to our attention @adrian-moisa. I implemented the fix in #2008 and it'll be released as patrol v3.2.1 very soon.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working P0 Critical issues such as a build break or regression package: patrol Related to the patrol package (native automation, test bundling)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants