mirror of
https://github.com/appium/appium.git
synced 2026-05-19 01:28:49 -05:00
add apidemos code to linter and lint
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ var path = require('path')
|
||||
module.exports = function(grunt) {
|
||||
grunt.initConfig({
|
||||
jshint: {
|
||||
all: ['*.js', 'app/*.js', 'app/test/unit/*.js', 'instruments/*.js', 'test/functional/*.js', 'test/unit/*.js', 'test/functional/appium/*.js', 'test/functional/testapp/*.js', 'test/functional/uicatalog/*.js', 'test/functional/webview/*.js', 'test/helpers/*.js', 'test/functional/safari/*.js', 'test/functional/prefs/*.js', 'test/functional/selendroid/*.js', 'test/functional/firefoxos/*.js', 'app/uiauto/appium/app.js', 'app/uiauto/appium/binding.js', 'app/uiauto/appium/element.js', 'app/uiauto/appium/utility.js', 'app/uiauto/lib/instruments_client.js', 'app/uiauto/lib/status.js', 'android/*.js', 'app/hybrid/ios/*.js', 'app/hybrid/firefox/*.js']
|
||||
all: ['*.js', 'app/*.js', 'app/test/unit/*.js', 'instruments/*.js', 'test/functional/*.js', 'test/unit/*.js', 'test/functional/appium/*.js', 'test/functional/apidemos/*.js', 'test/functional/testapp/*.js', 'test/functional/uicatalog/*.js', 'test/functional/webview/*.js', 'test/helpers/*.js', 'test/functional/safari/*.js', 'test/functional/prefs/*.js', 'test/functional/selendroid/*.js', 'test/functional/firefoxos/*.js', 'app/uiauto/appium/app.js', 'app/uiauto/appium/binding.js', 'app/uiauto/appium/element.js', 'app/uiauto/appium/utility.js', 'app/uiauto/lib/instruments_client.js', 'app/uiauto/lib/status.js', 'android/*.js', 'app/hybrid/ios/*.js', 'app/hybrid/firefox/*.js']
|
||||
, options: {
|
||||
laxcomma: true
|
||||
, es5: true
|
||||
|
||||
@@ -12,23 +12,23 @@ var path = require('path')
|
||||
, io = require('socket.io-client');
|
||||
|
||||
|
||||
describeWd('alert dialog detection', function(h) {
|
||||
describeWd('alert dialog detection', function() {
|
||||
|
||||
// set up telnet...
|
||||
var runCommands = function(cmds, cb) {
|
||||
try {
|
||||
var conn = net.createConnection(5554, 'localhost')
|
||||
var conn = net.createConnection(5554, 'localhost');
|
||||
conn.on('connect', function() {
|
||||
try {
|
||||
for (var i = 0; i < cmds.length; i++) {
|
||||
conn.write(cmds[i] + "\n");
|
||||
};
|
||||
}
|
||||
conn.write('quit\n');
|
||||
cb(true);
|
||||
} catch(err) {
|
||||
console.log("Could not run commands: " + err.description);
|
||||
cb(undefined);
|
||||
};
|
||||
}
|
||||
}, cb);
|
||||
} catch(err) {
|
||||
console.log("Couldn't run commands: " + err.description);
|
||||
@@ -45,12 +45,12 @@ describeWd('alert dialog detection', function(h) {
|
||||
var client = io.connect('http://127.0.0.1:4723', options);
|
||||
client.on('connect', function() {
|
||||
runCommands(['power ac off', 'power capacity 9'], function(success) {
|
||||
success.should.be.true;
|
||||
success.should.equal(true);
|
||||
});
|
||||
});
|
||||
client.on('alert', function() {
|
||||
runCommands(['power ac on', 'power capacity 50'], function(success) {
|
||||
success.should.be.true;
|
||||
success.should.equal(true);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user