Closed bootstraponline closed 9 years ago
I think silently ignoring caps such as a default screen res on OS X 10.10 is fine. The completely invalid caps aren't good to ignore though.
To expand on my comment a bit:
I like the idea of complaining on non-white-listed capabilities. The problem with verifying capabilities is that, although there's a REST API, last I checked it wasn't super consumable; I'm hesitant to put in logic that relies on new versions of the gem being released to allow for new browsers, so I'd definitely want the REST API to be the thing driving this. That adds some spinup time to each test, as the API is queried (unless we do some sort of gross caching thing locally?).
If it's not easy to get comprehensive validation info via REST then I'd be fine with a more targeted fix specifically for the screen res issue. There could be an override option which just ignores the logic if set.
URL: http://saucelabs.com/rest/v1/info/platforms/:automation_api
That API will list all platforms. If we automatically generated classes based on the info then it'd enable people to be sure what they're requesting is valid (similar to watir autogenerating from html5 spec). Also if a new platform is added then they could just go back to the old string representation. I'll probably look into this since at work the goal is to enable people to easily write automation and specifying good combinations of platforms/browsers/capabilities is important.
This is what I have in mind:
# returns ["Mac 10.6", "ipad", "1.0"]
puts Platform.mac_10_6.ipad.v1
# no method error because it's invalid
puts Platform.mac_10_6.ipad.v5
I'll try and finish up the code soon.
@DylanLacey let me know what you think of the sauce_platforms gem.
I solved the client side validation with sauce_platforms. The screen res example looks like this:
config['screen-resolution'] = '1280x1024'
config[:browsers] = [
Platform.windows_8_1.firefox.v37,
Platform.mac_10_10.safari.v8 + ['screen-resolution' => '1024x768'],
]
It'd be great if sauce_ruby provided information about browser validation before attempting to run on Sauce with obviously invalid browsers. I see strange errors like:
and