:facepalm: That did it. Thank you both for all the help!

On Wednesday, October 23, 2019 at 2:44:43 PM UTC-5, John Anderson wrote:
>
> Are you sure you have the account block in the right place? You have it 
> configured inside the browser block and in the documentation its declared 
> only in the sauceLabs block.
>
> On Wed, Oct 23, 2019 at 1:09 PM Ben Frey <[email protected] 
> <javascript:>> wrote:
>
>> I now have a new problem (let me know if I should start a new thread). 
>> Gradle cannot set the property "username":
>>
>> Caused by: groovy.lang.MissingPropertyException: Could not set unknown 
>> property 'username' for object of type geb.gradle.cloud.BrowserSpec.
>>
>>
>> This is happening right where the variable username is being set, just 
>> like in the example:
>> account {
>>     username = System.getenv(SauceAccount.USER_ENV_VAR)
>>     accessKey = System.getenv(SauceAccount.ACCESS_KEY_ENV_VAR)
>> }
>>
>> My GebConfig.groovy file has this for the driver setup:
>> def sauceLabsBrowser = System.getProperty('geb.saucelabs.browser')
>> if (sauceLabsBrowser) {
>>     driver = {
>>         def username = System.getenv("GEB_SAUCE_LABS_USER")
>>         assert username
>>         def accessKey = System.getenv("GEB_SAUCE_LABS_ACCESS_PASSWORD")
>>         assert accessKey
>>
>>         new SauceLabsDriverFactory().create(sauceLabsBrowser, username, 
>> accessKey)
>>     }
>> } else {
>>     System.setProperty('webdriver.chrome.driver', 
>> 'src/test/resources/chromedriver')
>>     driver = { new ChromeDriver() }
>> }
>>
>> What step am I missing?
>>
>> On Wednesday, October 23, 2019 at 12:26:57 PM UTC-5, Ben Frey wrote:
>>>
>>> Alright, I created https://github.com/geb/issues/issues/597. Please let 
>>> me know if you'd like any more details in the issue.
>>>
>>> On Wednesday, October 23, 2019 at 8:09:53 AM UTC-5, Marcin Erdmann wrote:
>>>>
>>>> No, unfortunately that's not supported at the moment. We would need to 
>>>> add support for adding multiple test tasks per capability/browser type - 
>>>> would you mind submitting an issue for that in the tracker? There's 
>>>> already 
>>>> a number of issues around improvements to cloud browser plugins, I could 
>>>> just make the next release all about that.
>>>>
>>>> With regards to a workaround for this, there's nothing that comes to my 
>>>> mind apart from a nasty hack where you would set a project property on the 
>>>> command line, like -PstuffToTest=a and then have an if statement like:
>>>>
>>>> sauceLabs {
>>>>         task {
>>>>             if (stuffToTest == "a") {
>>>>                 filter {
>>>>                     includeTestsMatching 'stufftotest.*'
>>>>                 }
>>>>             }
>>>>         }
>>>>     }
>>>> }
>>>>
>>>> Nasty, but can work in the meantime.
>>>>
>>>> On Wed, Oct 23, 2019 at 1:59 PM Ben Frey <[email protected]> wrote:
>>>>
>>>>> Oh, I guess I didn't quite get the implications of bullet point 4 
>>>>> there, thanks for clarifying. So is there a way to filter or group tests 
>>>>> based on test class/method rather than capability? I'm trying to run 
>>>>> groups 
>>>>> of scenarios in parallel CI jobs, rather than all of the tests in one.
>>>>>
>>>>> On Wednesday, October 23, 2019 at 7:55:08 AM UTC-5, Marcin Erdmann 
>>>>> wrote:
>>>>>>
>>>>>> Yeah, this is where the problem is. The Gradle SauceLabs plugin adds 
>>>>>> a separate task to run tests at SauceLabs - any tasks that you add 
>>>>>> manually 
>>>>>> as well as the default test task will not include the configuration for  
>>>>>> SauceLabs. Based on the configuration that you provided in the original 
>>>>>> email the test task name will be internetExplorerTest - it's derived on 
>>>>>> the 
>>>>>> name of the item that you add in the `browsers {}` configuration block. 
>>>>>> It's all described at 
>>>>>> https://gebish.org/manual/current/#geb-saucelabs-plugin.
>>>>>>
>>>>>> On Wed, Oct 23, 2019 at 1:28 PM Ben Frey <[email protected]> wrote:
>>>>>>
>>>>>>> ./gradlew clean testTaskName
>>>>>>>
>>>>>>> where "testTaskName" is a Gradle task defined like this
>>>>>>> task testTaskName(type: Test) {
>>>>>>>     filter {
>>>>>>>         includeTestsMatching 'stufftotest.*'
>>>>>>>     }
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> On Wednesday, October 23, 2019 at 6:27:12 AM UTC-5, Marcin Erdmann 
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> What's the Gradle task that you are running in CI?
>>>>>>>>
>>>>>>>> On Tue, Oct 22, 2019 at 6:33 PM Ben Frey <[email protected]> 
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> My tests are working locally, although I have to use the 
>>>>>>>>> bonigarcia WebDriverManager to retrieve a Chromedriver locally:
>>>>>>>>> WebDriverManager.chromedriver().version('2.35').setup()
>>>>>>>>>
>>>>>>>>> In my build.gradle file I want to set up an Internet Explorer 
>>>>>>>>> browser in the remote SauceLabs instance:
>>>>>>>>> sauceLabs {
>>>>>>>>>     browsers {
>>>>>>>>>         create('internet explorer') {
>>>>>>>>>             capabilities platform: 'Windows 7', browserVersion: 
>>>>>>>>> '11'
>>>>>>>>>         }
>>>>>>>>>         task {
>>>>>>>>>         }
>>>>>>>>>         account {
>>>>>>>>>             def username = System.getenv('SAUCE_USERNAME')
>>>>>>>>>             def accessKey = System.getenv('SAUCE_ACCESS_KEY')
>>>>>>>>>         }
>>>>>>>>>     }
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> and my GebConfig.groovy looks like this
>>>>>>>>> baseUrl = 'https://www.domain.com'
>>>>>>>>> reportsDir = 'build/reports/tests/geb'
>>>>>>>>>
>>>>>>>>> def sauceLabsBrowser = System.getProperty('geb.saucelabs.browser')
>>>>>>>>> if (sauceLabsBrowser) {
>>>>>>>>>     println 'Got a SauceLabs browser'
>>>>>>>>>     driver = {
>>>>>>>>>         def username = System.getenv('SAUCE_USERNAME')
>>>>>>>>>         assert username
>>>>>>>>>         def saucelabsKey = System.getenv('SAUCE_ACCESS_KEY')
>>>>>>>>>         assert  saucelabsKey
>>>>>>>>>
>>>>>>>>>         new SauceLabsDriverFactory().create(sauceLabsBrowser, 
>>>>>>>>> username, saucelabsKey)
>>>>>>>>>     }
>>>>>>>>> } else {
>>>>>>>>>     println 'Attempting to get a local webdriver'
>>>>>>>>>     // WebDriverManager.chromedriver().version('2.35').setup()
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> When I push my code to my company's GitLab instance, I get the 
>>>>>>>>> following stack trace:
>>>>>>>>> tests.TestClass > classMethod FAILED
>>>>>>>>>     java.lang.IllegalStateException: The path to the driver 
>>>>>>>>> executable must be set by the webdriver.chrome.driver system 
>>>>>>>>> property; for more information, see https://
>>>>>>>>> github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest 
>>>>>>>>> version can be downloaded from 
>>>>>>>>> http://chromedriver.storage.googleapis.com/index.html
>>>>>>>>>         at com.google.common.base.Preconditions.checkState(
>>>>>>>>> Preconditions.java:847)
>>>>>>>>>         at org.openqa.selenium.remote.service.DriverService.
>>>>>>>>> findExecutable(DriverService.java:134)
>>>>>>>>>         at org.openqa.selenium.chrome.ChromeDriverService.
>>>>>>>>> access$000(ChromeDriverService.java:35)
>>>>>>>>>         at org.openqa.selenium.chrome.ChromeDriverService$Builder.
>>>>>>>>> findDefaultExecutable(ChromeDriverService.java:159)
>>>>>>>>>         at org.openqa.selenium.remote.service.
>>>>>>>>> DriverService$Builder.build(DriverService.java:355)
>>>>>>>>>         at org.openqa.selenium.chrome.ChromeDriverService.
>>>>>>>>> createDefaultService(ChromeDriverService.java:94)
>>>>>>>>>         at org.openqa.selenium.chrome.ChromeDriver.<init>(
>>>>>>>>> ChromeDriver.java:123)
>>>>>>>>>         at geb.driver.NameBasedDriverFactory.getDriver(
>>>>>>>>> NameBasedDriverFactory.groovy:44)
>>>>>>>>>         at geb.driver.CachingDriverFactory.getDriver_closure4(
>>>>>>>>> CachingDriverFactory.groovy:57)
>>>>>>>>>         at geb.driver.CachingDriverFactory.getDriver_closure4(
>>>>>>>>> CachingDriverFactory.groovy)
>>>>>>>>>         at geb.driver.CachingDriverFactory$SimpleCache.get(
>>>>>>>>> CachingDriverFactory.groovy:81)
>>>>>>>>>         at geb.driver.CachingDriverFactory.getDriver(
>>>>>>>>> CachingDriverFactory.groovy:56)
>>>>>>>>>         at geb.Configuration.createDriver(Configuration.groovy:675
>>>>>>>>> )
>>>>>>>>>         at geb.Configuration.getDriver(Configuration.groovy:353)
>>>>>>>>>         at geb.Browser.getDriver(Browser.groovy:160)
>>>>>>>>>         at geb.navigator.factory.BrowserBackedNavigatorFactory.<
>>>>>>>>> init>(BrowserBackedNavigatorFactory.groovy:31)
>>>>>>>>>         at geb.Configuration.createNavigatorFactory(Configuration.
>>>>>>>>> groovy:413)
>>>>>>>>>         at geb.Browser.createNavigatorFactory(Browser.groovy:982)
>>>>>>>>>         at geb.Browser.getNavigatorFactory(Browser.groovy:170)
>>>>>>>>>         at geb.Page.init(Page.groovy:140)
>>>>>>>>>         at geb.Browser.initialisePage(Browser.groovy:1116)
>>>>>>>>>         at geb.Browser.createPage(Browser.groovy:829)
>>>>>>>>>         at geb.Browser.to(Browser.groovy:537)
>>>>>>>>>         at geb.Browser.to(Browser.groovy:526)
>>>>>>>>>         at geb.spock.GebSpec.methodMissing(GebSpec.groovy:60)
>>>>>>>>>         at login.LoginTrait$Trait$Helper.logIn(LoginTrait.groovy:7
>>>>>>>>> )
>>>>>>>>>         at tests.TestClass.setupSpec(TestClass.groovy:8)
>>>>>>>>>
>>>>>>>>> So I have two questions:
>>>>>>>>>
>>>>>>>>>    1. Why is it trying to retrieve a Chrome webdriver in the CI 
>>>>>>>>>    pipeline when my buildscript specifies Internet Explorer?
>>>>>>>>>    2. Am I setting everything up as expected? I left out the 
>>>>>>>>>    sauceLabs.task closure because I was getting Gradle errors on e.g. 
>>>>>>>>>    test.testClassesDir
>>>>>>>>>    
>>>>>>>>> -- 
>>>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>>>> Groups "Geb User Mailing List" group.
>>>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>>>> send an email to [email protected].
>>>>>>>>> To view this discussion on the web visit 
>>>>>>>>> https://groups.google.com/d/msgid/geb-user/7545c8f8-e510-4065-8d3c-7c29b67304b0%40googlegroups.com
>>>>>>>>>  
>>>>>>>>> <https://groups.google.com/d/msgid/geb-user/7545c8f8-e510-4065-8d3c-7c29b67304b0%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>>
>>>>>>>> -- 
>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>> Groups "Geb User Mailing List" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>> send an email to [email protected].
>>>>>>> To view this discussion on the web visit 
>>>>>>> https://groups.google.com/d/msgid/geb-user/b70f3fe1-acd7-4317-8df6-c74f91d77270%40googlegroups.com
>>>>>>>  
>>>>>>> <https://groups.google.com/d/msgid/geb-user/b70f3fe1-acd7-4317-8df6-c74f91d77270%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "Geb User Mailing List" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to [email protected].
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/geb-user/21fa1c21-3185-4a12-ab6e-cebc799bf5c1%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/geb-user/21fa1c21-3185-4a12-ab6e-cebc799bf5c1%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Geb User Mailing List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/geb-user/ea68213d-cd16-4fce-b750-626dc9413020%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/geb-user/ea68213d-cd16-4fce-b750-626dc9413020%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/072f8f82-cb69-49a4-baa5-404763943fad%40googlegroups.com.

Reply via email to