You need to do the following:
browserStack {
task {
systemProperty "geb.build.baseUrl", baseUrl
}
}
See point 7. in http://gebish.org/manual/current/#geb-browserstack-plugin
for an explanation.
On Thu, Dec 7, 2017 at 1:53 PM, <[email protected]> wrote:
> I tried
>
> browserStack {
>
> String baseUrl = System.getProperty("functional.tests.baseurl")
>
> if(baseUrl) {
> println ("functional.tests.baseurl -> $baseUrl")
>
> systemProperty "geb.build.baseUrl", baseUrl
> }
>
> application baseUrl
>
> browsers {
>
>
> but get
>
> * What went wrong:
> A problem occurred evaluating root project 'functional-tests-...'.
> > Could not find method systemProperty() for arguments [geb.build.baseUrl,
> https://www.....com/] on root project 'functional-tests-...'.
>
> Any idea what I am doing wrong?
>
> Thank you in advance!
>
>
> On Thursday, December 7, 2017 at 12:20:32 PM UTC+1, [email protected]
> wrote:
>>
>> Hi Marcin,
>>
>> I have access now to browserstack to try out the your code actually.
>>
>> The way the baseUrl is set does not work.
>>
>> I checked it here too https://github.com/browser
>> stack/geb-browserstack/blob/master/build.gradle,
>>
>> I tried this
>>
>> String baseUrl = System.getProperty("functional.tests.baseurl")
>>
>> if(baseUrl) {
>> println ("functional.tests.baseurl -> $baseUrl")
>> }
>>
>> application baseUrl
>>
>> and also hardcoding the url, but get this exception:
>>
>> geb.error.NoBaseUrlDefinedException: There is no base URL configured and
>> it was requested. Please see the Geb manual for different ways of
>> managing the base URL (quick solution: you can set the
>> 'geb.build.baseUrl' JVM system property)
>>
>>
>> Could you please help me?
>>
>> Thank you very much in advance,
>> Roland
>>
>>
>> On Tuesday, November 7, 2017 at 8:44:38 PM UTC+1, Marcin Erdmann wrote:
>>>
>>> In your build file:
>>>
>>> apply plugin: "geb-browserstack"
>>>
>>> buildscript {
>>> repositories {
>>> mavenCentral()
>>> }
>>> dependencies {
>>> classpath 'org.gebish:geb-gradle:2.0'
>>> }
>>> }
>>>
>>> browserStack {
>>> application 'http://localhost:8080' //change to point at the app
>>> you're testing
>>>
>>> browsers {
>>> firefox {
>>> capabilities os: "WINDOWS", os_version: "8.1"
>>> }
>>> edge {
>>> capabilities os: "WINDOWS", os_version: "10"
>>> }
>>> safari {
>>> capabilities os: "OS X", os_version: "High Sierra"
>>> }
>>> create("internet explorer") {
>>> capabilities os: "WINDOWS", os_version: 7",
>>> browser_version: "11"
>>> }
>>> }
>>> account {
>>> username = System.getenv("GEB_BROWSERSTACK_USERNAME") //ensure
>>> the environment vars are populated
>>> accessKey = System.getenv("GEB_BROWSERSTACK_AUTHKEY") //ensure
>>> the environment vars are populated
>>> }
>>> }
>>>
>>> at the top of your GebConfig:
>>>
>>> def browserStackBrowser = System.getProperty("geb.browserstack.browser")
>>> if (browserStackBrowser) {
>>> driver = {
>>> def username = System.getenv("GEB_BROWSERSTACK_USERNAME")
>>> assert username
>>> def accessKey = System.getenv("GEB_BROWSERSTACK_AUTHKEY")
>>> assert accessKey
>>> new BrowserStackDriverFactory().create(browserStackBrowser,
>>> username, accessKey)
>>> }
>>> }
>>>
>>> then running your tests:
>>>
>>> gradle firefoxTest --tests *.login.LoginTest
>>> gradle edgeTest --tests *.login.LoginTest
>>> gradle safariTest --tests *.login.LoginTest
>>> gradle internetExplorerTest --tests *.login.LoginTest
>>>
>>> On Tue, Nov 7, 2017 at 7:32 AM, <[email protected]> wrote:
>>>
>>>> I would like to test these os/browser combinations:
>>>>
>>>> *OS*
>>>>
>>>> *Browser*
>>>>
>>>> Windows 10 (64-bit)
>>>>
>>>> EDGE
>>>>
>>>> Windows 8.1 (64-bit)
>>>>
>>>> Firefox
>>>>
>>>> Windows 7 (64-bit)
>>>>
>>>> IE11
>>>>
>>>> macOS High Sierra
>>>>
>>>> Safari
>>>>
>>>> Do I need to care about browser versions except for IE? Browserstack
>>>> takes care of the driver I assume. As far as I understand Geb 2.0 supports
>>>> Selenium 3.6.0, but I am unsure if I can take the latest browser versions
>>>> for e.g. Safari or EDGE.
>>>>
>>>> Thank you very much!
>>>>
>>>>
>>>> On Monday, November 6, 2017 at 11:08:39 PM UTC+1, Marcin Erdmann wrote:
>>>>>
>>>>> Can you please expand on what you mean by "specific browser setups"?
>>>>> Which browsers (including which operating systems and versions) do you
>>>>> want
>>>>> to run your tests at BrowserStack?
>>>>>
>>>>> The tasks added to the build by geb-browserstack plugin are regular
>>>>> org.gradle.api.tasks.testing.Test tasks which means that they support
>>>>> the --tests switch so you can run a single spec if you wish to.
>>>>>
>>>>> The project from browserstack org on github you linked to will
>>>>> probably work but is overcomplicated because it aims to to run tests on
>>>>> multiple browsers at BrowserStack concurrently.
>>>>>
>>>>> On Mon, Nov 6, 2017 at 10:05 AM, <[email protected]> wrote:
>>>>>
>>>>>> Hello Marcin,
>>>>>>
>>>>>> I would be very happy to see examples. My goal is to run one testspec
>>>>>> a time on specific browser setups for having bamboo build plans for each
>>>>>> browser setup.
>>>>>>
>>>>>> How should add browserstack that I can start gradle tasks like this:
>>>>>> "remoteChromeDockerTest --tests *.login.LoginTest" ( like in my current
>>>>>> approach https://gist.github.com/rnemeth1980/ab0f70797786271
>>>>>> 8ebeaa855102fd369) ?
>>>>>>
>>>>>> Also I see there all browser together http://www.gebish.org
>>>>>> /manual/current/#geb-browserstack-plugin.
>>>>>>
>>>>>> This code here https://github.com/browserstack/geb-browserstack/blob/
>>>>>> master/build.gradle seems to be different too. Is this approach
>>>>>> still working?
>>>>>>
>>>>>> Thank you very much for your help,
>>>>>> Roland
>>>>>>
>>>>>> On Sunday, November 5, 2017 at 5:44:04 PM UTC+1, Marcin Erdmann wrote:
>>>>>>>
>>>>>>> Roland,
>>>>>>>
>>>>>>> The plugin has been introduced so that you don't have to manage
>>>>>>> opening and closing of the BrowserStack tunnel, define envs and use
>>>>>>> capabilities. There are also ways to customise what the plugin does, by
>>>>>>> for
>>>>>>> example not using the BrowserStackDriverFactory in your
>>>>>>> GebConfig.groovy or
>>>>>>> passing additional capabilities to its create() method.
>>>>>>>
>>>>>>> You will need to be more specific about what you mean by fitting
>>>>>>> geb-browserstack plugin into what you have. If all you're after is
>>>>>>> setting
>>>>>>> some chrome options and capabilities when running in BrowserStack then
>>>>>>> it
>>>>>>> is of course possible and I can provide an example of how to do it.
>>>>>>>
>>>>>>> Marcin
>>>>>>>
>>>>>>> On Fri, Nov 3, 2017 at 12:36 PM, <[email protected]> wrote:
>>>>>>>
>>>>>>>> hi,
>>>>>>>> how could I use the browserstack integration in geb?
>>>>>>>>
>>>>>>>> my current implementation for remotedrivers looks like this
>>>>>>>> https://gist.github.com/rnemeth1980/ab0f707977862718ebe
>>>>>>>> aa855102fd369.
>>>>>>>>
>>>>>>>> "remoteChromeDockerTest --tests *.login.LoginTest" is my sample
>>>>>>>> gradle task.
>>>>>>>>
>>>>>>>> Can I define environments like "remoteChromeDocker" and use
>>>>>>>> capabilities?
>>>>>>>>
>>>>>>>> I do not see how I can fit the geb-browserstack plugin in there
>>>>>>>> from here http://www.gebish.org/manual/current/#geb-browserstack-
>>>>>>>> plugin.
>>>>>>>>
>>>>>>>> thank you very much,
>>>>>>>> Roland
>>>>>>>>
>>>>>>>> --
>>>>>>>> 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 post to this group, send email to [email protected].
>>>>>>>> To view this discussion on the web visit
>>>>>>>> https://groups.google.com/d/msgid/geb-user/d0d6bad7-cb50-43b
>>>>>>>> 7-8191-7dd63cda43c9%40googlegroups.com
>>>>>>>> <https://groups.google.com/d/msgid/geb-user/d0d6bad7-cb50-43b7-8191-7dd63cda43c9%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>> 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 post to this group, send email to [email protected].
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/geb-user/30beb7c6-837b-4ff
>>>>>> 9-b4e0-5d1b2578139e%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/geb-user/30beb7c6-837b-4ff9-b4e0-5d1b2578139e%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>> --
>>>> 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 post to this group, send email to [email protected].
>>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>>> gid/geb-user/7b1fdbbe-b9cf-4b63-8a10-4c708026cf49%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/geb-user/7b1fdbbe-b9cf-4b63-8a10-4c708026cf49%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
> 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 post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/geb-user/b36ee623-25a8-4e55-87dd-f405a5a87241%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/b36ee623-25a8-4e55-87dd-f405a5a87241%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/geb-user/CA%2B52dQRQyntb4BfbE--JnpO-Fiy%3DQRV9apZAeiuqg%2BSAx0CHdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.