-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
feat: Add an option to control intent wait for a started URI #389
Conversation
lib/commands/general.js
Outdated
return await this.adb.startUri(url, pkg); | ||
const { | ||
url, | ||
package: pkg |
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.
Please destruct waitForAppLaunch explicitly from opts and add a doctring to this method
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.
Is it something like below?
commands.mobileDeepLink = async function (opts = {}) {
const {
url,
package: pkg,
waitForLaunch: wait,
} = opts;
return await this.adb.startUri(url, pkg, wait);
}; //This I checked didn't work because startUri expect object
So below may work
return await this.adb.startUri(url, pkg, { wait });
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.
something like
const {
url,
package,
waitForLaunch,
} = opts;
return await this.adb.startUri(url, package, {waitForLaunch});
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.
Yes this also worked for me. Let me do it.
package is a reserved word so I will use the same "package: pkg" in this case.
And doc string is not there in any commands you want me to add that too?
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.
And doc string is not there in any commands you want me to add that too?
yes, I know. But we want to make it better, don't we?
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.
Very true @mykola-mokhnach.
@shibupanda Do you have time to add the docstring for the |
@mykola-mokhnach Sorry for the delay I stuck some where so will add it in this weekend or I can create a different pull request for it sure. |
np, lets do it on the weekend |
lib/commands/general.js
Outdated
@@ -234,7 +234,18 @@ commands.mobileViewportScreenshot = async function () { | |||
commands.setUrl = async function (url) { | |||
await this.adb.startUri(url, this.opts.appPackage); | |||
}; | |||
/** | |||
* @typedef {object} DeepLinkOpts | |||
* @property {?string} url - The name of URL to start. |
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 type would be {!string}
since this property is required
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.
Oh! Yes.
lib/commands/general.js
Outdated
/** | ||
* @typedef {object} DeepLinkOpts | ||
* @property {?string} url - The name of URL to start. | ||
* @property {?string} package - The name of the package to start the URI with. |
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.
same here
This needs to be update here I guess. |
Shall I proposed for the changes? |
simply create a PR |
Added condition to handle waitForLaunch capability to call concerned startUrl function.
Which will fix below issue.
appium/appium#14180
It's depends on below PR
appium/appium-adb#520