Created attachment 703618 [details] crude test case Marionette is returning 'false' for every HTMLElement.get_attribute('disabled') The element in question is the 'capture-button' in the camera app: https://github.com/mozilla-b2g/gaia/blob/master/apps/camera/index.html#L24 After the app starts up the 'disabled' attribute is removed however marionette still returns 'false'. Minimized test case.
CC'ing David Burns for his input.
If the element has a disabled attribute then we should return true and if it doesnt then we should a false so <div disable=disable> should return true and <div> should return false. This is what has been discussed in the HTML5 spec and thats what we should be following.  http://www.whatwg.org/specs/web-apps/current-work/#boolean-attributes
can't seem to see the issue. Pushed https://tbpl.mozilla.org/?tree=Try&rev=410dec044941 to try to see I could reproduce elsewhere.
loos like I forgot the html file added and new tries https://tbpl.mozilla.org/?tree=Try&rev=885a6cf483c0 https://tbpl.mozilla.org/?tree=Try&rev=ad05bde5afe4
This is working as it should, we mostly. Its not coercing the data returned to python primatives. e.g. AssertionError: True != u'true'. Will fix that in this bug
Created attachment 806691 [details] [diff] [review] try: -b do -p linux,macosx64,win32 -u marionette -t none
Created attachment 806692 [details] [diff] [review] try: -b do -p linux,macosx64,win32 -u marionette -t none
Created attachment 806703 [details] [diff] [review] bug832045.patch
So, this is kind of a weird case. DOM attributes are always strings, so even in JS, calling getAttribute('disabled') will return a string value, not a boolean. This matches what the Selenium atom does, that we're using to get attribute values. I'm not positive we want to cast this to a Boolean in Python, since it isn't how Selenium or DOM API's behave.
I guess, for consistency, we should do what the FirefoxDriver does...does it do this casting?
For some reason I thought we coerced it in the Selenium code... I could have sworn I wrote it that way originally but its not like that now so we will leave it as it is and close the bug. Happy to land the test as that might be useful. Thoughts?
Yes, might as well land the test!
Created attachment 806895 [details] [diff] [review] bug832045.patch just the test in the patch. MOAR TESTS!!!
Comment on attachment 806895 [details] [diff] [review] bug832045.patch Review of attachment 806895 [details] [diff] [review]: ----------------------------------------------------------------- Thanks.