Skip to content

Commit

Permalink
Further improve integration between cloud browser gradle plugins and …
Browse files Browse the repository at this point in the history
…driver factories.

Part of geb/issues#579
  • Loading branch information
erdi committed Nov 22, 2019
1 parent de97e5a commit c4a81a2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/test-support/src/main/groovy/GebConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ def sauceLabsBrowser = System.getProperty("geb.saucelabs.browser")
if (sauceLabsBrowser) {
setPortIndexProperty(getForkIndex(5))
driver = {
new SauceLabsDriverFactory().create(sauceLabsBrowser)
new SauceLabsDriverFactory().create()
}
}

def browserStackBrowser = System.getProperty("geb.browserstack.browser")
if (browserStackBrowser) {
setPortIndexProperty(getForkIndex(5))
driver = {
new BrowserStackDriverFactory().create(browserStackBrowser)
new BrowserStackDriverFactory().create()
}

if (browserStackBrowser.contains("realMobile")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ class BrowserStackDriverFactory extends CloudDriverFactory {
"https://$username:$password@hub.browserstack.com/wd/hub"
}

WebDriver create(String specification, Map<String, Object> additionalCapabilities = [:]) {
create(specification, System.getenv("GEB_BROWSERSTACK_USERNAME"), System.getenv("GEB_BROWSERSTACK_AUTHKEY"), additionalCapabilities)
WebDriver create(Map<String, Object> additionalCapabilities = [:]) {
def specification = System.getProperty("geb.browserstack.browser")
def user = System.getenv("GEB_BROWSERSTACK_USERNAME")
def key = System.getenv("GEB_BROWSERSTACK_AUTHKEY")
create(specification, user, key, additionalCapabilities)
}

WebDriver create(String specification, String username, String password, String localId, Map<String, Object> capabilities = [:]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ class SauceLabsDriverFactory extends CloudDriverFactory {
this.host = host
}

WebDriver create(String specification, Map<String, Object> additionalCapabilities = [:]) {
create(specification, System.getenv("GEB_SAUCE_LABS_USER"), System.getenv("GEB_SAUCE_LABS_ACCESS_PASSWORD"), additionalCapabilities)
WebDriver create(Map<String, Object> additionalCapabilities = [:]) {
def specification = System.getProperty("geb.saucelabs.browser")
def user = System.getenv("GEB_SAUCE_LABS_USER")
def key = System.getenv("GEB_SAUCE_LABS_ACCESS_PASSWORD")
create(specification, user, key, additionalCapabilities)
}

@Override
Expand Down

0 comments on commit c4a81a2

Please sign in to comment.