Conversation
| private MutableCapabilities options; | ||
| private WebDriver driver; | ||
|
|
||
| public SauceRemoteGrid(MutableCapabilities capabilities){ |
There was a problem hiding this comment.
I like this, so is this the new name you picked from SauceLabs or SauceClient?
There was a problem hiding this comment.
@joshgrantsauce @joshmgrant Hey bud, let me know your thoughts on all my comments. I'm not sure how to proceed here
There was a problem hiding this comment.
I'm not sure what you mean in your comment. Basically my idea was to break down the SauceLabs "object" into a SauceRemoteGrid and SauceAPI component. I chose the names arbitrarily (seemed to make sense :) ). This object would be specifically for Webdriver-like functionality.
| this(new MutableCapabilities()); | ||
| } | ||
|
|
||
| public SauceRemoteGrid(String browser){ |
There was a problem hiding this comment.
Is this just for demo purposes? I would love to get away from using strings with Sauce and rather use statically typed objects like enums or classes.
grid = new SauceRemoteGrid(Browser.Chrome, "73", Platform.Windows, DataCenter.US)
What do you think?
|
|
||
| @Test | ||
| public void setOnlyMobileOS() { | ||
| sauceGrid = new SauceRemoteGrid("android"); |
There was a problem hiding this comment.
I do like this feature where you can just pick a platform and a test runs? Is that what you're going for?
|
|
||
| @Test | ||
| public void setOnlyBrowser(){ | ||
| sauceGrid = new SauceRemoteGrid("chrome"); |
There was a problem hiding this comment.
So would this apply to all browsers? You can just pick one and run a test on some default VM?
I've also considered another approach along this route:
sauceGrid = new SauceRemoteGrid(); //would start a session on a default configuration
Not to replace yours, I like your idea. But maybe an additional override for an even simpler way to get started?
|
|
||
| assertEquals(sauceGrid.getOptions(), expectedOptions); | ||
| } | ||
| } |
There was a problem hiding this comment.
I think this is a good path. I know that this was just a sample, but I'd love to see a few more use cases of where you're headed. Like Using JSExecutor and using API. But overall, I really like the idea and I think SauceRemoteGrid is a perfect name for the object!
Code samples of what a
SauceLabsbinding could look like.NOTE: NOT FOR MERGING, this is more like a proof of concept to get an idea of look and feel.