New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to upload app to app-automate. #3573
Conversation
can you fix the "Using: undefined()" bit? |
}); | ||
|
||
if (response.error) { | ||
Logger.error(response.error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a more descriptive error message here, like "Uploading the app the BrowSerstack has failed because of: ...". And we can also add some help text and a link for more info (if applicable), using the actionable error messages framework. Same goes for the error logging in the catch()
block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the url in the screenshot contains undefined
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 0a4ba71. We should only show the build URL if a session with BrowserStack was successfully created.
c86cee3
to
29ffd1b
Compare
29ffd1b
to
f8b58be
Compare
This PR is ready to be merged now. |
@@ -269,7 +269,7 @@ class Transport extends BaseTransport { | |||
const startTime = new Date(); | |||
const {host, port, start_process} = this.settings.webdriver; | |||
const portStr = port ? `port ${port}` : 'auto-generated port'; | |||
const options = this.createSessionOptions(argv); | |||
const options = await this.createSessionOptions(argv); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createSessionOptions doesn't return a Promise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does now, for AppAutomate, since I am uploading the app to BrowserStack inside this method only, after creating all the session options. It also made more sense to do it inside createSessionOptions
since options
are not final until the app is uploaded to BrowserStack. And for the other implementations of createSessionOptions
, adding await
here shouldn't have any effect.
I tried doing this inside this.createDriver
also (just so that I don't have to add this await
) but the problem there was that the spinner (Connecting to localhost on 4723...) was overwriting the console messages related to app upload (Uploading app to BrowserStack... and App upload successful!) and the spinner is called just after calling this.createSessionOptions
method.
To test an app on BrowserStack app-automate, we first need to upload that application to BrowserStack using BrowserStack's REST API: https://www.browserstack.com/docs/app-automate/api-reference/appium/apps#upload-an-app
The upload can be done either from a public URL or using a file from the local filesystem. This PR allows users to set
appUploadPath
orappUploadUrl
as desired capability if they wish to upload the app they wish to test to BrowserStack.Additionally, if they have already set
appium:app
desired capability to some BrowserStack URL (starts withbs://
), it will be overwritten with the new URL. And if they have setappium:app
to something else other than BrowserStack URL, that will be considered as the custom id while uploading the application, which then can be used as it is to run tests against the uploaded app.A few test runs:
Without custom id:
With custom id: