Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Sauce Driver Prototype #84

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Sauce Driver Prototype #84

wants to merge 3 commits into from

Conversation

joshgrantsauce
Copy link
Contributor

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.

private MutableCapabilities options;
private WebDriver driver;

public SauceRemoteGrid(MutableCapabilities capabilities){
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor Author

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){
Copy link
Contributor

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");
Copy link
Contributor

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");
Copy link
Contributor

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);
}
}
Copy link
Contributor

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants