Closed Bug 1165365 Opened 9 years ago Closed 9 years ago

Bug 1163215 breaks gallery test

Categories

(Firefox OS Graveyard :: Gaia::UI Tests, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: njpark, Unassigned)

Details

Failure can be seen with test_gallery_switch_to_camera.py.  When images are loaded and gallery app starts, the script taps the first image in the list. after that, it calls 

self.assertIsNotNone(image.current_image_source)

But in Bug 1163215, current_image_source was changed as follows:

-        return self.marionette.find_element(*self._current_image_locator).value_of_css_property('background-image')
+        return self.marionette.find_element(*self._current_image_locator).get_attribute('src')

Now this is returning 'None' which causes the script to fail.


The question is:
is our use of self.assertIsNotNone(image.current_image_source) valid?  In test_gallery_handle_valid_image_file.py, 

I should have found this when reviewing this patch, but I think I made a mistake when cloning this branch locally and ran it on my machine yesterday, because it passed the test at the time.  Sorry about that.

ni? ing :djf for feedback
(In reply to No-Jun Park [:njpark] from comment #0)

> is our use of self.assertIsNotNone(image.current_image_source) valid?  In
> test_gallery_handle_valid_image_file.py, 
> 

sorry, please disregard the test after the question mark. I found out it also fails on today's nightly. (it used to pass locally on the branch was cloned)

:djf, the definition for assertIsNotNone is:

    def assertIsNotNone(self, obj, msg=None):
        """Included for symmetry with assertIsNone."""
        if obj is None:
            standardMsg = 'unexpectedly None'
            self.fail(self._formatMessage(msg, standardMsg))

and the test script above can be seen here:
https://github.com/mozilla-b2g/gaia/blob/master/tests/python/gaia-ui-tests/gaiatest/tests/functional/gallery/test_gallery_switch_to_camera.py#L31

Should it return an object when the user taps the thumbnail and views the image?
Flags: needinfo?(dflanagan)
that's odd, when I look at the fullscreen view of the gallery via WedIde, it shows the background Image value, but I don't see image source value.  FYI, I see:

<div aria-label="landscape image, 9:33 PM, December 24, 2014" role="img" style="transform-origin: center center 0px; background-image: url(&quot;blob:app://gallery.gaiamobile.org/13fcb168-e453-4d53-891f-8785d9f2c136&quot;); background-size: contain; background-repeat: no-repeat; background-color: rgb(34, 34, 34); width: 640px; height: 480px; transform: translate(-160px, 44px) scale(0.5, 0.5) rotate(0deg);" class="image-view"></div>
Turns out the nightly did not contain the changes, but since we get the script from the tip, it ran the updated script without the patch.  with the newest nightly, this test passes.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Flags: needinfo?(dflanagan)
You need to log in before you can comment on or make changes to this bug.