Skip to content

Instantly share code, notes, and snippets.

@shikato
Last active August 29, 2015 14:14
Show Gist options
  • Save shikato/e05d1aa7fde30db15a07 to your computer and use it in GitHub Desktop.
Save shikato/e05d1aa7fde30db15a07 to your computer and use it in GitHub Desktop.
Appium.app sampe
"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