Deeplinking scheme url testing on Android

Hi everyone, I want to share a module I’ve been working on the last weeks. It’s a tool for automate deeplinking scheme url testing using appium.

For now it’s pretty simple, it launchs a browser where you can set your app scheme params and then run a test, that basically opens the chrome browser on your mobile phone, click on the generated scheme url, wait a couple of seconds and check if your android application has open.

Here the source:
zoster on github

The next steps are porting the test to iOS and create an sdk for advanced testing, so the user can test the whole flow of deeplinking, not just if the application has been opened after the intent url click.

Hope everyone likes it, starts using it, contribute & fill issues.

4 Likes

Can I have more info about how to use it? documentation is so poor to get me started with the tool.
Thank you

Hey @MJaz, sorry for the lack of documentation. I’ve been finishing another projects and I didnt have the time for writing any documentation or example. Or event deploy the stage 2 of the project, which is test the link on a custom url or website.

Here’s a video of the automation testing using the example.

Steps to run the application:

Zoster uses appium, so first you have to run appium; appium &.

Run zoster, if you want to run it in your browser use: zoster --neutron, or in case you want to run the desktop application, just use; zoster.
Make sure you have an android device connected via usb. Emulator arent supported yet.

Once the application is running, I use the example to fill all the required params to create a custom browsable Android URL, as described on Android Developer site, https://developer.android.com/guide/components/intents-common.html#Browser. If you click on the AndroidManifest.xml button, you will see the intent url created according to the params you set.

Inside my android application I have already added the intents to my activity, so, clicking on a browser on a link will open my application.

By clicking “Run Test”, the application will do the following:

  1. Check if any android device is connected
  2. Select an android device
  3. Check if appium is running
  4. Create a temporary url with a simple html with a button with the intent url
  5. Run an appium test that clicks on that button
  6. Check if your application is running.
    If everything goes right, the test will pass. Meaning that you set the correct data on your app.

In the stage 2, which i’m building, instead of using a local temporary url, you could set your own url and selector to test, this way you can also test if the url is correct on your website. I believe I will push this feature for friday or monday.

Hope this help you understand how to use the application. Feel free to ask me any question.

@MJaz just updated the package. Now you can test the click to the intent url on your own site by setting the URL test site, or leave it with “local” to test in a local temporary url as it was working.

Hi @vrunoa ,

Thanks for the tutorial . But I currently see a problem when running your code in my mac with a set of errors. So any help on this is greatly appreciated. Below are the details of the error

npm install
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

[email protected] install /Users/gangadhar/Desktop/Mobitv/zoster/node_modules/fsevents
node-pre-gyp install --fallback-to-build

[fsevents] Success: “/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node” is installed via remote

[email protected] install /Users/gangadhar/Desktop/Mobitv/zoster
make clean && make node

TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.basename (path.js:1357:5)
at buildResult (/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/babel/lib/babel/file.js:22:18)
at output (/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/babel/lib/babel/file.js:70:18)
at walk (/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/babel/lib/babel/file.js:128:5)
at files (/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/babel/lib/babel/file.js:132:5)
at module.exports (/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/babel/lib/babel/file.js:152:5)
at Object. (/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/babel/lib/babel/index.js:147:1)
at Module._compile (module.js:541:32)
at Object.Module._extensions…js (module.js:550:10)
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.basename (path.js:1357:5)
at buildResult (/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/babel/lib/babel/file.js:22:18)
at output (/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/babel/lib/babel/file.js:70:18)
at walk (/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/babel/lib/babel/file.js:128:5)
at files (/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/babel/lib/babel/file.js:132:5)
at module.exports (/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/babel/lib/babel/file.js:152:5)
at Object. (/Users/gangadhar/Desktop/Mobitv/zoster/node_modules/babel/lib/babel/index.js:147:1)
at Module._compile (module.js:541:32)
at Object.Module._extensions…js (module.js:550:10)
make: *** [node] Error 1

npm ERR! Darwin 15.5.0
npm ERR! argv “/usr/local/Cellar/node/6.3.0/bin/node” “/usr/local/bin/npm” “install”
npm ERR! node v6.3.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: make clean && make node
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] install script ‘make clean && make node’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the zoster package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make clean && make node
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs zoster
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls zoster
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/gangadhar/Desktop/Mobitv/zoster/npm-debug.log

hey @nagavenkat0628 zoster has been quite outdated due to my lack of time. I’m refactoring the module to avoid using make and improving path issues. I’ll probably have a new release for Monday. In the meantime, can you install the module locally and try to run make node right from the node_modules/zoster folder.

Thanks for your support. I will try out to run locally and provide an update

I tried to run from local and received the following error ::

./zoster --test /Users/gangadhar/Desktop/Mobitv/zoster/examples/complex_new.json
/Users/gangadhar/Desktop/Mobitv/zoster/server.js:6
zoster({port:port, capabilities:caps, cb:cb, open:open}).run();
^

TypeError: zoster is not a function
at module.exports (/Users/gangadhar/Desktop/zoster/server.js:6:3)
at module.exports (/Users/gangadhar/Desktop/zoster/exec.js:20:5)
at Object. (/Users/gangadhar/Desktop/zoster/bin/zoster:32:1)
at Module._compile (module.js:541:32)
at Object.Module._extensions…js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.runMain (module.js:575:10)
at run (bootstrap_node.js:352:7)

sorry for the late reply. maybe there was some issue when installing the package, can you run npm run build inside zoster folder ?

Hii , i am getting the ‘make node make install’ error while trying to install it