Last year a got some progresses testing Swing UI using assertj-swing-junit
dependency

Also, I got to run TravisCI successfully, by including  xvfb In order to
run the tests that require a GUI.

Finally, it required 2 additional changes:

1. Modifying Main class on modeler to expose Injector object
2. Include some modifications to the CayenneModelerFrame to set names for
the GUI components to test, since assertj cannot test anonymous instances.

If Swing still being an option, I can open a PR with a full functional use
case of GUI testing using the mentioned stack..

Other way, what would be the desires/goals for diving into JavaFX? so we
could think about at GUI testing strategy covering that path.

Thanks

EmeCas




On Tue, Oct 1, 2019 at 2:51 PM John Huss <johnth...@gmail.com> wrote:

> The way to handle testing for the UI is to write the app in an MVP style,
> sort of like this:
> https://stackoverflow.com/questions/11367250/concrete-code-example-of-mvp
>
> The gist is to define an interface contract for the view so that you can
> replace the actual Swing UI View with a mock while testing.
> But that doesn't help much with an existing application that wasn't written
> in that style.
>
>
> On Tue, Oct 1, 2019 at 1:00 AM Andrus Adamchik <and...@objectstyle.org>
> wrote:
>
> > Yeah, I was thinking how do we even approach testing of Java UI. Any
> > suggestions are welcome.
> >
> > And to complicate things we've been postponing a dive into JavaFX, while
> > the Swing app keeps adding functionality. So investing effort in a test
> > framework should take this pending decision into account.
> >
> > Andrus
> >
> > > On Oct 1, 2019, at 7:11 AM, Aristedes Maniatis <a...@maniatis.org>
> wrote:
> > >
> > > I've been down that path before, trying to test Swing and JavaFX. Its
> > not easy to do. The best tool I found (and that was about 8 years ago)
> was
> > https://www.froglogic.com/squish/editions/automated-java-gui-testing/
> but
> > I don't know if they have any licensing available for open source
> projects.
> > >
> > > Emerson, if you have any experience with this, let us know what has
> > worked for you.
> > >
> > >
> > > Ari
> > >
> > >
> > > On 30/9/19 12:21am, Emerson Castañeda wrote:
> > >> Wonder if these bugs would be into the kind of things that a good GUI
> > test
> > >> suite for the modeler could prevent.
> > >>
> > >> EmeCas
> > >>
> > >> On Thu, Sep 26, 2019 at 12:08 PM Lon Varscsak <lon.varsc...@gmail.com
> >
> > >> wrote:
> > >>
> > >>> Okay, cool.  Another bug (I just found) is on the add relationship
> > dialog
> > >>> (on object entity) is that it seems to ignore the "delete" rule and
> > just is
> > >>> always the default.  Easily worked around by just editing the added
> > >>> relationship after the fact.
> > >>>
> > >>> On Thu, Sep 26, 2019 at 12:22 AM Andrus Adamchik <
> > and...@objectstyle.org>
> > >>> wrote:
> > >>>
> > >>>> Screenshots are stripped by the list management software, but the
> > >>>> description is pretty clear. I am not using 4.2 myself, but we do
> > need to
> > >>>> fix it before we release 4.2.M1.
> > >>>>
> > >>>> Andrus
> > >>>>
> > >>>>> On Sep 26, 2019, at 1:08 AM, Lon Varscsak <lon.varsc...@gmail.com>
> > >>>> wrote:
> > >>>>> Hey all,
> > >>>>>
> > >>>>> It looks like when adding a db-relationship in the Modeler
> > >>>> (4.2.M1-SNAPSHOT from today) the potential target entities is not
> > sorted
> > >>>> (which is only mildly annoying), but doesn't contain any target
> > entities
> > >>>> outside of the current data map (blocker).  Am i missing something?
> > >>>>> Thanks!
> > >>>>>
> > >>>>> -Lon
> > >>>>>
> > >>>>> Here's a screenshot for reference:
> > >>>>>
> > >>>>
> >
> >
>

Reply via email to