You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For running tests on a project with no variants, you can simply run following command for uploading and running tests on debug apk:
46
+
47
+
```
48
+
gradle clean executeDebugTestsOnBrowserstack
49
+
```
50
+
51
+
And for projects with productFlavors, replace ${buildVariantName} with your build variant name, for example if your productFlavor name is "phone" and you want to test debug build type of this variant then command will be
52
+
53
+
```
54
+
gradle clean executePhoneDebugTestsOnBrowserstack
55
+
56
+
```
57
+
58
+
##### Supported browserStackConfig parameters
25
59
26
60
username: String
27
61
accessKey: String
@@ -39,45 +73,51 @@ Supported parameters:
39
73
callbackURL: String
40
74
networkProfile: String
41
75
76
+
> Note: username, accessKey and devices are mandatory parameters. Visit https://www.browserstack.com/app-automate/espresso/get-started to get started with Espresso Tests on BrowserStack and also to know more about the above mentioned parameters.
42
77
43
-
> Note: username, accessKey and devices are compulsory parameters. Visit https://www.browserstack.com/app-automate/espresso/get-started to get started with Espresso Tests on BrowserStack and also to know more about the above mentioned parameters.
44
-
45
-
> Note: List of supported devices and be found [here](https://api.browserstack.com/app-automate/espresso/devices.json) (basic auth required).
46
-
47
-
To run an Espresso test on BrowserStack using this plugin, use the following command:
78
+
> Note: List of supported devices and be found [here](https://api.browserstack.com/app-automate/espresso/devices.json) (basic auth required). For example :``` curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" https://api-cloud.browserstack.com/app-automate/devices.json ```
48
79
49
-
gradle runDebugBuildOnBrowserstack
80
+
> Note: You can also set the values of username and accessKey in environment variables with names BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY, respectively. If you do this, then there is no need to set this parameters in browserStackConfig block.
50
81
51
-
This will execute the following:
82
+
##### Internal steps
52
83
53
-
1. Build debug and test apks, as dependencies are declared on `assembleDebug` and `assembleDebugAndroidTest` tasks.
84
+
1. Build debug and test apks, as dependencies are declared on `assemble${buildvariantName}` and `assemble${buildvariantName}AndroidTest` tasks.
54
85
2. Find the latest apks in the app directory recursively.
55
-
3. Upload both the apks on BrowserStack platform.
86
+
3. Upload both the apks on BrowserStack AppAutomate platform.
56
87
4. Execute Espresso test using the uploaded apps on the devices mentioned.
For running tests on a project with no variants, you can simply run following command for uploading debug apk:
76
96
77
97
```
78
-
apply plugin: 'com.browserstack.gradle'
98
+
gradle clean uploadDebugToBrowserstackAppLive
79
99
```
80
100
101
+
And for projects with productFlavors, replace ${buildVariantName} with your build variant name, for example if your productFlavor name is "phone" and you want to upload debug build type of this variant then command will be gradle clean uploadPhoneDebugToBrowserstackAppLive.
102
+
103
+
##### Supported browserStackConfig parameters
104
+
105
+
username: String
106
+
accessKey: String
107
+
108
+
> Note: username and accessKey are mandatory parameters.
109
+
110
+
##### Internal steps
111
+
112
+
1. Build debug and test apks, as dependencies are declared on `assemble${buildvariantName}` .
113
+
2. Find the latest apk in the app directory recursively.
114
+
3. Upload the apk on BrowserStack AppLive platform.
115
+
116
+
117
+
> Note: You can also set the values of username and accessKey in environment variables with names BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY, respectively. If you do this, then there is no need to set these parameters in browserStackConfig block.
118
+
119
+
> Note: You can also see all possible tasks by running "gradle tasks -all"
0 commit comments