anchor.diff:  ----
   
   :numbered:
  +
  +
  +=== geb-lambdatest plugin
  +
  +Following is an example of using the geb-lambdatest Gradle plugin.
  +
  +[source,groovy,subs="attributes,verbatim"]
  +----
  +import geb.gradle.lambdatest.LambdaTestAccount
  +
  +apply plugin: "geb-lambdatest" //<1>
  +
  +buildscript { //<2>
  +    repositories {
  +       mavenCentral()
  +    }
  +    dependencies {
  +       classpath 'org.gebish:geb-gradle:{geb-version}'
  +    }
  +}
  +
  +lambdaTest {
  +    application 'http://localhost:8080' //<3>
  +    browsers { //<4>
  +        chrome_windows_70 {
  +                   capabilities platform: "Windows 10"
  +               }
  +    }
  +    task { //<6>
  +       testClassesDir = test.testClassesDir
  +       testSrcDirs = test.testSrcDirs
  +       classpath = test.classpath
  +    }
  +    account { //<7>
  +       username = System.getenv(LambdaTestAccount.USER_ENV_VAR)
  +       accessKey = System.getenv(LambdaTestAccount.ACCESS_KEY_ENV_VAR)
  +    }
  +    tunnelOps {
  +        additionalOptions = ['--proxy', 'proxy.example.com:8080'] //<8>
  +    }
  +}
  +----
  +<1> Apply the plugin to the build.
  +<2> Specify how to resolve the plugin.
  +<3> Specify which urls the LambdaTest Tunnel should be able to access.
  +Multiple applications can be specified.
  +If no applications are specified, the tunnel will not be restricted to particular URLs.
  +<4> The tests would run in chrome on Windows 10 as sample.
  +<5> Explicitly specify the required browser capabilities if the shorthand syntax doesn't allow you to express all needed capabilities.
  +<6> Configure all of the generated test tasks; for each of them the closure is run with delegate set to a test task being configured.
  +<7> Pass credentials for LambdaTest.
  +<8> Pass additional link:https://www.lambdatest.com/support/docs/lambda-tunnel-modifiers/[command line options] to LambdaTestTunnel.
  +
  +
  +[TIP]
  +====
  +You can use `allLambdaTestTests` task that will depend on all of the generated test tasks to run all of them during a build.
  +====
  +
  +:numbered!:
  +
  +==== Disabling LambdaTest Tunnel
  +
  +The plugin by default manages the lifecycle of a tunnel which allows to point the browsers provisioned at LambdaTest at urls which are accessible from localhost but not from the Internet.
  +
  +If you are pointing the browsers only at urls which are accessible on the Internet and wish to get rid of the overhead associated with opening the tunnel you might want to disable the use of it.
  +It can be done in the following way:
  +
  +[source,groovy,subs="attributes,verbatim"]
  +----
  +lambdaTest {
  +    useTunnel = false
  +}
  +----
  +
  
positive.code: 
  * link:https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options[SauceLabs additional config]
  * link:http://www.browserstack.com/automate/capabilities[BrowserStack Capabilities]
  
  Finally, there is also link:api/geb/driver/CloudDriverFactory.html#create(java.lang.String,%20java.lang.String,%20Map%3CString,%20Object%3E)[an overloaded version of `create()` method] available that
  doesn't take a string specification and allows you to simply specify all the required capabilities using a map.
  
negative.code: }
  ----
  
  
  [[lambda-test-driver-factory]]
  === `LambdaTestDriverFactory`
  
  The following is an example of utilizing `LambdaTestDriverFactory` in `GebConfig.groovy` to configure a driver that will use a browser provided in the LambdaTest cloud.
  
  [source,groovy]
  ----
  def lambdaTestBrowser = System.getProperty("geb.lambdatest.browser")
  if (lambdaTestBrowser) {
      driver = {
         def username = System.getenv("GEB_LAMBDATEST_USERNAME")
         assert username
         def accessKey = System.getenv("GEB_LAMBDATEST_AUTHKEY")
         assert accessKey
         new LambdaTestDriverFactory().create(lambdaTestBrowser, username, accessKey)
      }
  }
  ----
  
  If using `TunnelIdentifier` support:
  
  [source,groovy]
  ----
  def lambdaTestBrowser = System.getProperty("geb.lambdatest.browser")
  if (lambdaTestBrowser) {
      driver = {
         def username = System.getenv("GEB_LAMBDATEST_USERNAME")
         assert username
         def accessKey = System.getenv("GEB_LAMBDATEST_AUTHKEY")
         assert accessKey
         def tunnelId = System.getenv("GEB_LAMBDATEST_TUNNELID")
         assert localId
         new LambdaTestDriverFactory().create(lambdaTestBrowser, username, accessKey, tunnelId)
      }
  }
  ----
  
  == Gradle plugins
  
  For SauceLabs, LambdaTest and BrowserStack, Geb provides a Gradle plugin which simplifies declaring the account and browsers that are desired, as well as configuring a tunnel to allow the cloud provider to
  access local applications.
  These plugins allow easily creating multiple `Test` tasks that will have the appropriate `geb.PROVIDER.browser` property set (where _PROVIDER_ is either `saucelabs`, `lambdatest` or `browserstack`).
  The value of that property can be then passed in configuration file to <<sauce-labs-driver-factory>>/<<lambda-test-driver-factory>>/<<browser-stack-driver-factory>> as the ”browser specification“.
  Examples of typical usage are included below.
  
  === geb-saucelabs plugin
  