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

Combining the best between patrol and flutter_convenient_test? #995

Open
fzyzcjy opened this issue Feb 24, 2023 · 18 comments
Open

Combining the best between patrol and flutter_convenient_test? #995

fzyzcjy opened this issue Feb 24, 2023 · 18 comments
Labels
epic Idea for a big new feature feature New feature request

Comments

@fzyzcjy
Copy link

fzyzcjy commented Feb 24, 2023

Hi, this package looks interesting :) I am wondering whether https://github.com/fzyzcjy/flutter_convenient_test can be merged/integrated somehow. This is because patrol and flutter_convenient_test have different advantages while solving the same problem (make testing easy). For example, patrol supports "native automation", while flutter_convenient_test supports "auto hot-restart" and a GUI etc.

@bartekpacia
Copy link
Contributor

Hi! We love your convenient_test package and we'd love to let developers have the best of both worlds!

I'm on vacation currently but when I come back, we could discuss the topic :)

@fzyzcjy
Copy link
Author

fzyzcjy commented Feb 24, 2023

Sure, take your time and have a good vacation :)

@bartekpacia bartekpacia added epic Idea for a big new feature feature New feature request labels Feb 28, 2023
@bartekpacia
Copy link
Contributor

bartekpacia commented Feb 28, 2023

Related:

@bartekpacia bartekpacia added this to the 10x improvements milestone Mar 2, 2023
@bartekpacia bartekpacia removed this from the 10x improvements milestone Mar 17, 2023
@fzyzcjy
Copy link
Author

fzyzcjy commented Apr 27, 2023

Firstly, congratulations on adding the hot-restart feature to patrol!

Indeed, flutter_convenient_test already has the feature since its initial release (a year ago?). Therefore, it seems that by separating patrol and flutter_convenient_test, we are reinventing the wheel by writing each feature twice :/ (p.s. I also want to use the patrol feature of native testing)

Btw, I am planning to add some new features to flutter_convenient_test in a few days, e.g. make it 10x faster (hopefully!).

@bartekpacia
Copy link
Contributor

Hi @fzyzcjy, thanks:)

Actually Hot Restart was quite easy to add (we just call flutter attach under the hood and send R).

Btw, I am planning to add some new features to flutter_convenient_test in a few days, e.g. make it 10x faster (hopefully!).

Haha, I'm also currently working on a similar 10x feature – issue 1004 has all the details :) I hope we're not doing the same thing haha

@fzyzcjy
Copy link
Author

fzyzcjy commented Apr 27, 2023

@bartekpacia Luckily no :) I have just sketched my plan here: fzyzcjy/flutter_convenient_test#333

@fzyzcjy
Copy link
Author

fzyzcjy commented Apr 27, 2023

we just call flutter attach under the hood and send R

similar approach here, I just attached the DevTool websocket (IIRC) and send hot-restart event to it

@bartekpacia
Copy link
Contributor

bartekpacia commented Apr 27, 2023

Luckily no :) I have just sketched my plan here: fzyzcjy/flutter_convenient_test#333

Oh that's great :) Actually that reminds me of the "full tree widget tests" approach by presented by @alicja-ogonowska in this droidcon talk

@fzyzcjy
Copy link
Author

fzyzcjy commented Apr 27, 2023

@bartekpacia Thanks for the link (and thanks @alicja-ogonowska for sharing) - I will watch when having time! At a first glance (just jumped randomly across several slides), it seems similar to what I have been gradually developed: I have a Tester class for each of my pages, pump the whole page, and do clicking/assertions/etc on it.

@fzyzcjy
Copy link
Author

fzyzcjy commented Apr 27, 2023

Btw just checked the "Problems" section in #300 (comment):

Because convenient_test doesn't know anything about Patrol, the native automation server has to be started manually.

Looks like just need a easy glue script

The videos above are recorded on iOS Simulator because to run tests on the Android emulator, a manual change in convenient_test_managers code and rebuild is needed. See fzyzcjy/flutter_convenient_test#253 for more details. I could go and fix this if we decide to proceed with integrating convenient_test.

Again looks like easy fix

Breakpoints created using VSCode don't have any effect when running integration tests with convenient_test_manager

Hmm have you tried to start the convenient test worker in VSCode? The manager is a separate thing unrelated to the worker, while the worker is the one which really has the code being tested

@bartekpacia
Copy link
Contributor

bartekpacia commented Apr 27, 2023

Hmm have you tried to start the convenient test worker in VSCode? The manager is a separate thing unrelated to the worker, while the worker is the one which really has the code being tested

No I haven't, tbh I don't remember if I ever knew of the "worker". Could you write a bit more about it?

@fzyzcjy
Copy link
Author

fzyzcjy commented Apr 27, 2023

@bartekpacia convenient_test consists of mainly two things: manager and worker. Like the following screenshot:

image

The manager is a windows/macos/linux app, and the worker is an android/ios app running on simulator/real-device.

The worker is where tests are executed, just like how we run plain-old integration tests.

The manager controls the worker to trigger hot-restart, record video, etc.

@fzyzcjy
Copy link
Author

fzyzcjy commented May 3, 2023

(that feature is implemented: fzyzcjy/flutter_convenient_test#333 (comment))

@neiljaywarner
Copy link

it's exciting to see discussion on this @fzyzcjy and @bartekpacia ...

@neiljaywarner
Copy link

@fzyzcjy @bartekpacia any updated thoughts on best of both worlds or being able to merge or use both?
thanks

@fzyzcjy
Copy link
Author

fzyzcjy commented Aug 8, 2023

@neiljaywarner My thoughts are shown above :) Hope @bartekpacia has some updates!

@bartekpacia
Copy link
Contributor

bartekpacia commented Aug 9, 2023

Hi, as much as I'd like to see this idea come to fruition, unfortunately we don't have resources to focus on this right now. Most of the feedback we get from users focuses on integration on VSCode (especially debugging support, like breakpoints, and being able to seamlessly run Patrol tests from within the code editor). That's what we plan to do in the mid/long term - see #1504.

That said, this is all open-source, if you feel like tinkering and making convenient_test and patrol play nice together, nothing is stopping you.

@neiljaywarner
Copy link

neiljaywarner commented Aug 9, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Idea for a big new feature feature New feature request
Projects
None yet
Development

No branches or pull requests

3 participants