GNOME Bugzilla – Bug 742732
Port to behave based UI tests
Last modified: 2018-01-23 09:24:33 UTC
Current test infrastructure is naive before BDD (Behavior Driven Development, http://pythonhosted.org/behave/). By using behave, it easy to extend, manage and debug test suites as compared to earlier method of writing tests.
Created attachment 294254 [details] [review] Add accessible names throughout the UI Improves accessibility and makes application scriptable through dogtail
Created attachment 294277 [details] [review] Add accessible names throughout the UI Improves accessibility and makes application scriptable through dogtail
Created attachment 294278 [details] [review] Port to behave based UI tests Based on tests written for eog by Vadim Rutkovsky
Created attachment 294279 [details] [review] Reads from only test datadir when tests are enabled Modify the behaviour of the application to lookup only in test datadir when compiled with --enable-installed-tests
Review of attachment 294277 [details] [review]: Is this really needed? I would expect GTK+ to take care of it and things to just work.
Review of attachment 294279 [details] [review]: ::: src/photos-query-builder.c @@ +369,3 @@ GSettings *settings; GString *tracker_filter; + #ifndef BEHAVE_INSTALLED_TESTS_ENABLED We don't want to change the application code for the tests because that defeats the whole purpose of testing - to test the code that will actually be running. @@ +426,3 @@ + filter = g_strdup_printf ("(fn:contains (nie:url (?urn), 'file:///tmp/photos/')" + "%s)", + tracker_filter->str); We should redefine the XDG directories (see ~/.config/user-dirs.dirs) as I have mentioned before.
Review of attachment 294278 [details] [review]: ::: tests/actions.feature @@ +5,3 @@ + + Scenario: Basic operations + * Wait 1 second Nitpick: a better idea would be 'wait for app to load' step or similar - so we can check that window has appeared, progress bars are gone etc. For now we can stub it with "sleep(1)" @@ +6,3 @@ + Scenario: Basic operations + * Wait 1 second + * Select an image Nitpick: its not clear which image is being selected, a better idea would be renaming to 'Select the first image' or 'Select image #1', so this step would be easy to extend
Created attachment 295865 [details] [review] WIP/port to behave based UI tests In this new approach, I am using tracker-sandbox.py script from tracker to create a separate data instance of the tracker. This is more cleaner way to test while still keeping the user and test data separate. This is work in progress patch, suggestions are welcome. To run tests using this wip patch, few modifications in environment.py should do.
Created attachment 301085 [details] Screencast of tests
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-photos/issues/23.