leancodepl / patrol

Flutter-first UI testing framework. Ready for action!
https://patrol.leancode.co
Apache License 2.0
898 stars 134 forks source link

Combining the best between patrol and flutter_convenient_test? #995

Open fzyzcjy opened 1 year ago

fzyzcjy commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

bartekpacia commented 1 year ago

Related:

fzyzcjy commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@bartekpacia Luckily no :) I have just sketched my plan here: https://github.com/fzyzcjy/flutter_convenient_test/issues/333

fzyzcjy commented 1 year ago

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 commented 1 year ago

Luckily no :) I have just sketched my plan here: https://github.com/fzyzcjy/flutter_convenient_test/issues/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 commented 1 year ago

@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 commented 1 year ago

Btw just checked the "Problems" section in https://github.com/leancodepl/patrol/pull/300#issuecomment-1265299898:

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 https://github.com/fzyzcjy/flutter_convenient_test/issues/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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

(that feature is implemented: https://github.com/fzyzcjy/flutter_convenient_test/issues/333#issuecomment-1532785436)

neiljaywarner commented 1 year ago

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

neiljaywarner commented 1 year ago

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

fzyzcjy commented 1 year ago

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

bartekpacia commented 1 year ago

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 commented 1 year ago

I hear ya..Thank you for responding..

....sent from my phone

On Wed, Aug 9, 2023, 4:16 AM Bartek Pacia @.***> wrote:

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 https://github.com/leancodepl/patrol/issues/1504.

— Reply to this email directly, view it on GitHub https://github.com/leancodepl/patrol/issues/995#issuecomment-1670966191, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXBGYLWXEJQEQDDPBZ5SHLXUNIPJANCNFSM6AAAAAAVGI36FU . You are receiving this because you were mentioned.Message ID: @.***>