Kunlun
Kunlun
is a library that provides:
- User friendly and more helpful methods in addition to WD
- Appium logging control through environment variable
DEBUG
- Sauce Labs helper method
- Bootstrap your appium page object test structure
Table of contents
- Quick example
- API
- waitTillAvailable(selector, by)
- waitTillNotAvailable(selector, by)
- clickEl(selector, by)
- typeEl(value, selector, by)
- getEls(selector, by)
- getEl(selector, by)
- hasEl(selector, by)
- getElAttribute(attr, selector, by)
- typeSpecialKey(key)
- bindModule(module)
- resetModule()
- goBack()
- cancelLastMove()
- Command line tool
- License
Quick example:
- find an element by some selector
- write your own logic to wait for it to be available
- click on it
you can just call clickEl()
with Kunlun.
Default selector type is accessibility id
, you can overwrite it with xpath
, -ios uiautomation
, etc
- Print out Appium client side logging while running the test, just append
DEBUG=true
in command line
This package is still under construction, more are coming.
API
-
waitTillAvailable(selector, by)
Wait until specific element is displayed
-
waitTillNotAvailable(selector, by)
Wait until specific element is NOT displayed
Send special key as defined in https://github.com/admc/wd/blob/master/lib/special-keys.js
e.g.: driver.typeSpecialKey('Return');
Click on selected element after waiting for it to be displayed
-
typeEl(value, selector, by)
Type text value in selected element after waiting for it to be displayed
Search for multiple elements after waiting for any of them to be displayed
Search for element after waiting for any of them to be displayed
Check if an element exists
-
getElAttribute(attr, selector, by)
Get the value of an element's attribute after waiting for it to be displayed
Bind functions from customized page object modules to AppiumDriver object
Clean up customized page object modules functions
Click on built-in Back button
Click on built-in Cancel button
-
Plus, all the APIs as listed in WD
Command line tool
Kunlun comes with kunlun
command line interface that helps you to create a basic page object Appium test framework.
$ npm install kunlun
$ ./node_modules/.bin/kunlun init
Follow the instructions and it will create a scaffold of basic test framework for you.
License
Licensed under the MIT