-
Notifications
You must be signed in to change notification settings - Fork 61
Sauce Driver Prototype #84
base: master
Are you sure you want to change the base?
Conversation
private MutableCapabilities options; | ||
private WebDriver driver; | ||
|
||
public SauceRemoteGrid(MutableCapabilities capabilities){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, so is this the new name you picked from SauceLabs or SauceClient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
SauceLabs
binding could look like.NOTE: NOT FOR MERGING, this is more like a proof of concept to get an idea of look and feel.