The capabilities available in BrowserStack are listed at
https://www.browserstack.com/automate/capabilities.
With regards to the shorthand syntax, the parts separated by an underscore
are mapped in the following order (refer to the link I provided for values
allowed for each capability):
- browserName capability
- platform capablity
- version capability
So firefox_windows_47 means Firefox version 47 on any version of Windows.
And then you can specify additional capabilities like the OS version the
way I showed you before using a capabilities call inside of the closure
specified for a given browser.
With regards to adding multiple test tasks for firefox:
browsers {
firefox_mac
firefox_win8 {
platform: "WINDOWS", os_version: "8.1"
}
firefox_win7 {
platform: "WINDOWS", os_version: "7"
}
}
gradle firefoxMacTest --tests *.login.LoginTest
gradle firefoxWin8Test --tests *.login.LoginTest
gradle firefoxWin7Test --tests *.login.LoginTest
On Fri, Dec 8, 2017 at 4:54 PM, <[email protected]> wrote:
> Hi Marcin,
>
> May I ask you another question?
>
> I have this in my *build.gradle*
>
> 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"
> }
> }
>
>
> gradle firefoxTest --tests *.login.LoginTest
> gradle edgeTest --tests *.login.LoginTest
> gradle safariTest --tests *.login.LoginTest
> gradle internetExplorerTest --tests *.login.LoginTest
>
> these above work fine, but how do I specify testing tasks e.g. for firefox
> for more browsers?
> firefox on win7 and firefox on mac?
>
> I read about the shorthand syntax here http://gebish.org/manual/
> current/#geb-browserstack-plugin
> point 5 - but how does this work? is it listed somewhere what is accepted?
>
> Thank you very much in advance!
>
> Best regards,
> Roland
>
>
> On Friday, December 8, 2017 at 2:51:01 PM UTC+1, [email protected] wrote:
>>
>> This works perfectly.
>>
>> Thank you very much Marcin for your help!
>>
>> On Thursday, December 7, 2017 at 9:04:34 PM UTC+1, Marcin Erdmann wrote:
>>>
>>> You need to do the following:
>>>
>>> browserStack {
>>> task {
>>> systemProperty "geb.build.baseUrl", baseUrl
>>> }
>>> }
>>>
>>> See point 7. in http://gebish.org/manual/cu
>>> rrent/#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.browse
>>>>>> rstack.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.c
>>>>>>>>> om/rnemeth1980/ab0f707977862718ebeaa855102fd369) ?
>>>>>>>>>
>>>>>>>>> Also I see there all browser together http://www.gebish.org
>>>>>>>>> /manual/current/#geb-browserstack-plugin.
>>>>>>>>>
>>>>>>>>> This code here https://github.com/browse
>>>>>>>>> rstack/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/man
>>>>>>>>>>> ual/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/msgid/geb-user/7b1fdbbe-b9cf-4b6
>>>>>>> 3-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/ms
>>>> gid/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/c41b10ad-52f3-4b16-838c-fcacfd4f8064%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/c41b10ad-52f3-4b16-838c-fcacfd4f8064%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%2B52dQQyy7gLP%2BYcVmX7aNjfBShR%2Bi3N0yE1r75SOndEvdGBVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.