- blacksmith: https://github.com/flatiron/blacksmith
- whitesmith: http://jnordberg.github.com/wintersmith/
- petrify: https://github.com/caolan/petrify
- pop: https://github.com/alexyoung/pop
- haroopress: https://github.com/rhiokim/haroopress
var assert = require( 'assert' ); | |
var client = require( '../../lib/core/webdriverNode').remote({ | |
desiredCapabilities: { | |
browserName:"chrome" | |
} | |
}); | |
describe( 'Protocol methods', function(){ | |
describe( '#execute()', function(){ | |
it( 'Execute a script.', function( done ){ |
var jasmineEnv = jasmine.getEnv(); | |
var oldCallback = jasmineEnv.currentRunner().finishCallback; | |
jasmineEnv.currentRunner().finishCallback = function () { | |
oldCallback.apply(this, arguments); | |
console.log(jasmine.getJSReport()); | |
}; |
exports.command = function( url, callback) | |
{ | |
var self = this; | |
// 先获取当前的窗口windowHandle | |
this.protocol.windowHandles(function( ret ){ | |
var oldHandles = ret.value; | |
// 执行脚本打开窗口 |
java -jar /Users/neekey/stuffs/selenium-server/selenium-server-standalone-2.25.0.jar -Dwebdriver.chrome.driver=/Users/neekey/stuffs/chromedriver/chromedriver |
PhoneGap的插件机制为我们提供了自由拓展Native API的可能。但是网络上和PhoneGap插件开发相关的资料较少,本文介绍插件开发的简单过程。
参考资料:
How to Create a PhoneGap Plugin for Android
Migrating your PhoneGap Plugins to Version 1.5+
##PhoneGap的Plugin原理
捕捉浏览器中的JS运行时错误,主要通过监听window.onerror来实现。但是对于不同的脚本执行方式以及不同的浏览器,能捕获到的信息会有区别。
window.onerror 讲接收3个参数:
msg
:错误描述,比如:a is not definedurl
:出错脚本所在的urllineNumber
:出错脚本的行数
本文将对不同浏览器和不同的脚本执行方式进行测试,并总结这些区别。
SASS的@import
是最常用的功能之一,默认我们可以使用相对,绝对路径来以当前目录为根节点进行文件的查找,但是有时候我们需要引入的文件并不在我们的当前目录下(并且文件位置相差很大,特别是很多需要被多个项目共用的框架等,如compass)。
针对这样的需求,SASS 可以通过指定--load-path
来添加一个额外用于查找的路径,可以看官方文档:http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import
Sass looks for other Sass files in the current directory, and the Sass file directory under Rack, Rails, or Merb. Additional search directories may be specified using the :load_paths option, or the --load-path option on the command line.
下面举个例子,来说明如何使用: