Integrating Appium with fastlane
Integrate your Appium test suite with fastlane and the BrowserStack device cloud for native and hybrid apps using our fastlane plugin.
Add BrowserStack's fastlane plugin by executing the below command:
fastlane add_plugin browserstack
You can easily upload your app using BrowserStack fastlane Plugin and execute your test on the BrowserStack cloud. In order to configure the plugin add below action in your Fastfile.
upload_to_browserstack_app_automate( browserstack_username: ENV["BROWSERSTACK_USERNAME"], browserstack_access_key: ENV["BROWSERSTACK_ACCESS_KEY"], file_path: "browserstack_android_sample/build/outputs/apk/debug/browserstack_android_sample-debug.apk" )
Once the is app uploaded is successfully, app id of the app will be stored in an environment variable, "BROWSERSTACK_APP_ID" and it can be accessed in your tests in the following way :
String app = System.getenv("BROWSERSTACK_APP_ID"); // Get app id from environment variable. capabilities.setCapability("app", app); // Add app id to driver capability.