Closed Bug 1219704 Opened 9 years ago Closed 9 years ago

Implement *test_play_ogg_video.py* as an integration test in JavaScript

Categories

(Firefox OS Graveyard :: Gaia::Video, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(feature-b2g:2.6+)

RESOLVED FIXED
feature-b2g 2.6+

People

(Reporter: whsu, Assigned: rnicoletti)

References

Details

(Whiteboard: [gip-to-gij])

Attachments

(1 file)

Component: Gaia::UI Tests → Gaia::Video
feature-b2g: --- → 2.6+
Assignee: nobody → rnicoletti
Status: NEW → ASSIGNED
Hi Punam, I'm having an issue 'clicking' on a thumbnail of a video in order to play it. The test is crashing when 'click' is invoked. I have updated lib/video.js to contain the same functions as lib/gallery.js in terms of clicking on a thumbnail. I am invoking 'tapThumbnails(n)' [1] the same as gallery tests [2]. My test crashes, the gallery test succeeds. Can you have a look? [1] https://github.com/russnicoletti/gaia/blob/bug-1219704/apps/video/test/marionette/open_video_test.js#L34 https://github.com/russnicoletti/gaia/blob/bug-1219704/apps/video/test/marionette/lib/video.js#L158-L163 [2] https://github.com/mozilla-b2g/gaia/blob/master/apps/gallery/test/marionette/load_valid_image_test.js#L49 https://github.com/russnicoletti/gaia/blob/bug-1219704/apps/gallery/test/marionette/lib/gallery.js#L129-L134
Flags: needinfo?(pdahiya)
More information. In lib/video.js, when I change: thumbnails[n].click(); to: var thumbnail = thumbnails[n]; thumbnail.click(); I get the following error: 'ElementNotAccessibleError: Element is not focusable via the accessibility API -> id: , tagName: LI, className: thumbnail\n\nRemote Stack:\n<none>'
Hi Russ, Looking at the code I don't see anything missing. I tried running video test on my local and able to replicate the crash. There is no useful error shown in logs , I have tried with VERBOSE=1 as well. DOM to create and display list of thumbnail is slightly different in video than gallery, I think selectors in video might need to be updated to select video thumbnail item. If you manually click video thumbnail while running test, it does show video playing, I will debug some more and keep you posted. Thanks!
Flags: needinfo?(pdahiya)
(In reply to Russ Nicoletti [:russn] from comment #2) > More information. In lib/video.js, when I change: > > thumbnails[n].click(); > > to: > > var thumbnail = thumbnails[n]; > thumbnail.click(); > > I get the following error: > > 'ElementNotAccessibleError: Element is not focusable via the accessibility > API -> id: , tagName: LI, className: thumbnail\n\nRemote Stack:\n<none>' ok, that was it, removing raisesAccessibilityExceptions: true let test pass. Looks like accessibility API is throwing exception and crash when thumbnaiitem is clicked. https://github.com/russnicoletti/gaia/blob/bug-1219704/apps/video/test/marionette/open_video_test.js#L18
I was looking into why the element was not 'focusable'. I think it's because an 'li' element is not focusable by default. Adding 'tabindex=0' makes it focusable but your suggestion is cleaner. Thanks.
Comment on attachment 8688079 [details] [review] [gaia] russnicoletti:bug-1219704 > mozilla-b2g:master Hi David, this PR is intended to resolve this bug as well as bug 1219705 and bug 1219706.
Attachment #8688079 - Flags: feedback?(dflanagan)
Comment on attachment 8688079 [details] [review] [gaia] russnicoletti:bug-1219704 > mozilla-b2g:master David, I'm changing from f? to r? as discussed during 1:1.
Attachment #8688079 - Flags: feedback?(dflanagan) → review?(dflanagan)
Comment on attachment 8688079 [details] [review] [gaia] russnicoletti:bug-1219704 > mozilla-b2g:master Various nits on github. I think there is a way to avoid the setTimeout(), a better way to handle showControls(). Also, I think that you might be testing elapsedTime() before 1 second has elapsed, which could cause the intermittent failures.
Attachment #8688079 - Flags: review?(dflanagan) → review-
Comment on attachment 8688079 [details] [review] [gaia] russnicoletti:bug-1219704 > mozilla-b2g:master Hi David, I've updated the PR based on your feedback.
Attachment #8688079 - Flags: review- → review?(dflanagan)
Comment on attachment 8688079 [details] [review] [gaia] russnicoletti:bug-1219704 > mozilla-b2g:master This is looking good, but I had a few nits and I think there is a bug in your waitForThumbnails() function which is likely to cause intermittent failures. If you fix the bug (or convince me that there isn't a bug) then this is pretty much an automatic r+.
Attachment #8688079 - Flags: review?(dflanagan) → review-
Comment on attachment 8688079 [details] [review] [gaia] russnicoletti:bug-1219704 > mozilla-b2g:master Hi David, I've updated the PR to address your latest feedback. More details in the PR.
Attachment #8688079 - Flags: review- → review?(dflanagan)
Russ, Please take another look at your thumbnails getter function in lib/video.js. the `get thumbnails` getter function is exactly the same as the `getThumbnails()` function and very similar to the `get thumbnail` getter (except that one uses findElement and one uses findElements). In all three of these cases, however, they're using 'li.thumbnail' as the selector. So I'm pretty sure that your getter function is returning an array of thumbnail elements. If you want to get the container element you need '#thumbnails' as the selector. But that won't work either, because the thumbnails are grouped by month. Anyway, I'm still concerned that waitForThumbnails() is broken and that thumbnails.length will never change during the waitFor() call. Maybe I'm misunderstanding Marionette... If you can convince me that marionette's findElements() call returns a live NodeList object that updates automatically as the DOM changes then I'm okay with this code. But it doesn't look to me like it could work.
Flags: needinfo?(rnicoletti)
Comment on attachment 8688079 [details] [review] [gaia] russnicoletti:bug-1219704 > mozilla-b2g:master Clearing the review request for now. Please set it again when you've responded to my comment above.
Attachment #8688079 - Flags: review?(dflanagan)
Comment on attachment 8688079 [details] [review] [gaia] russnicoletti:bug-1219704 > mozilla-b2g:master After more investigation, I have verified waitForThumbails is not necessary. It may be "broken" as you say but it's not necessary because after app.launch(), the thumbnails will already have been loaded so there is no need to "wait" for them. I can't point to the marionette code to prove this but I have instrumented various files and played with the timing of loading the thumbnails and I am convinced this is the case. I have removed the waitForThumbnails function and updated the test code. The PR is updated.
Flags: needinfo?(rnicoletti)
Attachment #8688079 - Flags: review?(dflanagan)
Comment on attachment 8688079 [details] [review] [gaia] russnicoletti:bug-1219704 > mozilla-b2g:master Given that the biggest problem we have with our marionette tests is intermittent errors caused by timing issues, I don't see how we can land a patch when neither of us can explain why it works. As far as we can tell, the gallery.launch() call should be returning before the thumbnails are created. I've traced this back as far as gaia/tests/jsmarionette/plugins/marionette-apps/lib/waitforapp.js and don't see anything that it making it wait any longer than it takes for the <body> element to be displayed. So even though the test works now, we can't have any confidence that it will continue to work. I think there is working going on to make these marionette tests runnable on actual devices, and when we do that, there will be a different device storage backend, which will presumably have different timing issues. I'm guessing that maybe the device storage stub that we're getting with this test is synchronous instead of async, and would expect that if we run a device with a real device storage api, we'd start to see failures. So I think you do need to wait for the thumbnails.
Attachment #8688079 - Flags: review?(dflanagan) → review-
Comment on attachment 8688079 [details] [review] [gaia] russnicoletti:bug-1219704 > mozilla-b2g:master I've re-introduced waiting for the thumbnails. The function within the 'waitFor' calls 'findElements' so whether or not a DOM node is returned or simply an array the function should behave as designed. I also cleaned up the patch based on your other comments in the PR.
Attachment #8688079 - Flags: review- → review?(dflanagan)
Comment on attachment 8688079 [details] [review] [gaia] russnicoletti:bug-1219704 > mozilla-b2g:master Looks good. Thanks, Russ.
Attachment #8688079 - Flags: review?(dflanagan) → review+
After pulling the latest from master, which included my patch, I found I was getting an ElementNotAccessibleError when running the tests. I'm not sure why my result was different from treeherder but I created a follow up patch where I explicitly set 'raisesAccessibilityExceptions' to false in the marionette prefs. https://github.com/mozilla-b2g/gaia/commit/2cf0778d92505fc845e962b3a2eed3ac2afa45ad
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: