Class BrowserStackSdkHelper
browserstack.yml configuration file from SHAFT's
BrowserStack property system. This enables integration with the BrowserStack SDK, which
reads the YAML file at runtime to configure test execution on BrowserStack's cloud platform.
The generated file maps SHAFT's browserStack.* properties to the SDK's expected
YAML format, supporting desktop web, mobile web, and native mobile app scenarios.
Usage: Call generateBrowserStackYml() before driver creation to produce a
browserstack.yml file in the project root directory. When the BrowserStack SDK
Java agent is active, it reads this file and intercepts WebDriver creation accordingly.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringGenerates abrowserstack.ymlconfiguration file in the project root directory by mapping SHAFT's BrowserStack properties to the SDK's expected YAML format.
-
Method Details
-
generateBrowserStackYml
Generates abrowserstack.ymlconfiguration file in the project root directory by mapping SHAFT's BrowserStack properties to the SDK's expected YAML format.If the
browserStack.customBrowserStackYmlPathproperty is set to a non-empty value, the specified file is copied to the project root asbrowserstack.ymland SHAFT's property-to-YAML mapping is skipped entirely. This allows users to provide their own SDK configuration file and override SHAFT's properties.The generated file includes authentication credentials, platform configuration, build/project naming, and optional settings like local testing, debugging, and geo-location.
- Returns:
- the absolute path to the
browserstack.ymlfile (generated or copied) - Throws:
IllegalStateException- if the file cannot be written or the custom file is not found
-