-
-
Save shikato/e05d1aa7fde30db15a07 to your computer and use it in GitHub Desktop.
Appium.app sampe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var wd = require("wd"); | |
var chai = require("chai"); | |
var chaiAsPromised = require("chai-as-promised"); | |
chai.use(chaiAsPromised); | |
chai.should(); | |
chaiAsPromised.transferPromiseness = wd.transferPromiseness; | |
var desired = { | |
"appium-version": "1.0", | |
platformName: "Android", | |
platformVersion: "4.4", | |
deviceName: "mydevice", | |
app: "{{apkのpath}}", | |
"app-package": "org.shikato.androidtestsample", | |
"app-activity": ".TopActivity" | |
}; | |
var browser = wd.promiseChainRemote("0.0.0.0", 4723); | |
browser.init(desired).then(function() { | |
return browser | |
.elementByXPath("//android.view.View[1]/android.widget.FrameLayout[2]/android.widget.LinearLayout[1]/android.widget.EditText[1]").sendKeys("12") | |
.elementByXPath("//android.view.View[1]/android.widget.FrameLayout[2]/android.widget.LinearLayout[1]/android.widget.EditText[2]").sendKeys("5") | |
.elementByXPath("//android.view.View[1]/android.widget.FrameLayout[2]/android.widget.LinearLayout[1]/android.widget.Button[1]").click() | |
.fin(function() { | |
return browser.quit(); | |
}); | |
}).done(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment