mirror of
https://github.com/appium/appium.git
synced 2026-10-23 17:19:04 +08:00
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
/*global it:true */
|
|
"use strict";
|
|
|
|
var path = require('path')
|
|
, appPath = path.resolve(__dirname, "../../../sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk")
|
|
, appPkg = "com.example.android.apis"
|
|
, appAct = ".ApiDemos"
|
|
, driverBlock = require("../../helpers/driverblock.js")
|
|
, describeWd = driverBlock.describeForApp(appPath, "selendroid", appPkg, appAct)
|
|
, should = require('should');
|
|
|
|
describeWd('basic', function(h) {
|
|
it('should find and click an element', function(done) {
|
|
// selendroid appears to have some issues with implicit waits
|
|
// hence the timeouts
|
|
setTimeout(function() {
|
|
h.driver.elementByName('App', function(err, el) {
|
|
should.not.exist(err);
|
|
should.exist(el);
|
|
el.click(function(err) {
|
|
should.not.exist(err);
|
|
setTimeout(function() {
|
|
h.driver.elementByLinkText("Action Bar", function(err, el) {
|
|
should.not.exist(err);
|
|
should.exist(el);
|
|
done();
|
|
});
|
|
}, 1000);
|
|
});
|
|
});
|
|
}, 1000);
|
|
});
|
|
});
|
|
|