After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 742732 - Port to behave based UI tests
Port to behave based UI tests
Status: RESOLVED OBSOLETE
Product: gnome-photos
Classification: Applications
Component: general
3.15.x
Other Linux
: Normal enhancement
: ---
Assigned To: Pranav Kant
GNOME photos maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-01-10 23:12 UTC by Pranav Kant
Modified: 2018-01-23 09:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add accessible names throughout the UI (6.06 KB, patch)
2015-01-10 23:13 UTC, Pranav Kant
none Details | Review
Add accessible names throughout the UI (9.13 KB, patch)
2015-01-11 15:32 UTC, Pranav Kant
reviewed Details | Review
Port to behave based UI tests (37.77 KB, patch)
2015-01-11 15:32 UTC, Pranav Kant
none Details | Review
Reads from only test datadir when tests are enabled (2.35 KB, patch)
2015-01-11 15:33 UTC, Pranav Kant
needs-work Details | Review
WIP/port to behave based UI tests (57.18 KB, patch)
2015-01-31 21:24 UTC, Pranav Kant
none Details | Review
Screencast of tests (1012.86 KB, video/webm)
2015-04-07 17:48 UTC, Pranav Kant
  Details

Description Pranav Kant 2015-01-10 23:12:47 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.
Comment 1 Pranav Kant 2015-01-10 23:13:56 UTC
Created attachment 294254 [details] [review]
Add accessible names throughout the UI

Improves accessibility and makes application scriptable through dogtail
Comment 2 Pranav Kant 2015-01-11 15:32:31 UTC
Created attachment 294277 [details] [review]
Add accessible names throughout the UI

Improves accessibility and makes application scriptable through dogtail
Comment 3 Pranav Kant 2015-01-11 15:32:53 UTC
Created attachment 294278 [details] [review]
Port to behave based UI tests

Based on tests written for eog by Vadim Rutkovsky
Comment 4 Pranav Kant 2015-01-11 15:33:13 UTC
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
Comment 5 Debarshi Ray 2015-01-12 10:36:59 UTC
Review of attachment 294277 [details] [review]:

Is this really needed? I would expect GTK+ to take care of it and things to just work.
Comment 6 Debarshi Ray 2015-01-12 10:39:46 UTC
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.
Comment 7 Vadim Rutkovsky 2015-01-21 13:13:38 UTC
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
Comment 8 Pranav Kant 2015-01-31 21:24:13 UTC
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.
Comment 9 Pranav Kant 2015-04-07 17:48:46 UTC
Created attachment 301085 [details]
Screencast of tests
Comment 10 GNOME Infrastructure Team 2018-01-23 09:24:33 UTC
-- 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.