background preloader

Introduction.js

Introduction.js

Automating web tests with FitNesse and Selenium UPDATE: My thinking on this has changed significantly in the years following this post, but according to Google it’s still quite popular. If you’re interested in combining FitNesse and Selenium, make sure to read this post as well: How to implement UI Testing without shooting yourself in the foot. It explains how to avoid some of the most common problems. Web user interfaces have traditionally been hard to integrate into an automated test process. Selenium is a free browser automation and testing library, written by folks at ThoughtWorks. FitNesse is an open-source test and collaboration server, based on the Framework for integrated tests (FIT), and supports testing Java, .Net, Python and even some other code. Installing Selenium The core of Selenium is written in JavaScript, and is compatible with all major browsers. Just download Selenium Remote Console from A quick test Let’s first do a quick test to make sure that Selenium RC is running correctly. !

Angular-UI Bootstrap The $uibPosition service provides a set of DOM utilities used internally to absolute-position an element in relation to another element (tooltips, popovers, typeaheads etc...). getRawNode(element) Takes a jQuery/jqLite element and converts it to a raw DOM element. parameters element(Type: object) - The element to convert. returns (Type: element) - A raw DOM element. parseStyle(element) Parses a numeric style value to a number. value(Type: string) - The style value to parse. (Type: number) - The numeric value of the style property. offsetParent(element) Gets the closest positioned ancestor. element(Type: element) - The element to get the offset parent for. (Type: element) - The closest positioned ancestor. scrollbarWidth(isBody) Calculates the browser scrollbar width and caches the result for future calls. isBody(Type: boolean, Default: false, optional) - Is the requested scrollbar width for the body/html element. (Type: number) - The width of the browser scrollbar. position(element, includeMargins)

Documentation JSHint is a program that flags suspicious usage in programs written in JavaScript. The core project consists of a library itself as well as a CLI program distributed as a Node module. More docs: List of all JSHint options · CLI flags · Writing your own reporter · FAQ Basic usage The easiest way to use JSHint is to install it as a Node program. $ npm install jshint -g After you've done that you should be able to use the jshint program. $ jshint myfile.js myfile.js: line 10, col 39, Octal literals are not allowed in strict mode. 1 error If a file path is a dash (-) then JSHint will read from standard input. Configuration JSHint comes with a default set of warnings but it was designed to be very configurable. This setup allows you to have different configuration files per project. Configuration file is a simple JSON file that specifies which JSHint options to turn on or off. Inline configuration /* jshint undef: true, unused: true */ /* global MY_GLOBAL */ Directives jshint /* jshint strict: true */

Backbone.js Export This: Interface Design Patterns for Node.js Modules | Bites from Good Eggs When you require a module in Node, what are you getting back? When you write a module, what options do you have for designing its interface? When I was first learning to work in Node I found the sheer number of ways to do things to be a bit overwhelming. JavaScript is extremely flexible and the community of developers contributing to open source seem to have different styles for implementing the same thing. On my journey with Node I've been keeping an eye out the Good Way to do things and adopting them for use in my own work and in our work at Good Eggs. In this post I'll share my observations of the Node module system and the ways in which you can use it to encapsulate and share code. I discuss seven patterns below, many of which can be used in combination. require, exports and module.exports First some fundamentals. In Node requiring a file is requiring the module it defines. It's as if there were an implicit line at the beginning of each module that reads: and require it with: Export Away!

Quick start with FitNesse and Selenium Several months ago I used Selenium for web application testing, writing all my tests in Java. That was a nice experience except that writing tests in Java is somewhat verbose. So, after reading nice things about FitNesse I decided to give it a try. My idea was to stay with Selenium’s engine for running tests but to keep all test scripts nicely organized as wiki pages on a FitNesse server. Ingredients To connect FitNesse and Selenium you’ll need the following: Download the latest FitNesse jar.Download WebTest Fixtures extension for FIT/FitNesse. That’s maybe more components than expected but you’d need all of these as each one has a separate role: I’ll be installing FitNesse on my local machine but I’ll put Selenium RC on a separate virtual machine (I’ll call it browsers-vm here) with referent browser installations that I use for testing. All these tools are written in Java so you’ll need Java installed as well. Setting up FitNesse with WebTest Fixtures, etc. That’s it. Running Selenium RC

ng-repeat The ngRepeat directive instantiates a template once per item from a collection. Each template instance gets its own scope, where the given loop variable is set to the current collection item, and $index is set to the item index or key. Special properties are exposed on the local scope of each template instance, including: Creating aliases for these properties is possible with ngInit. Special repeat start and end points To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending the range of the repeater by defining explicit start and end points by using ng-repeat-start and ng-repeat-end respectively. The example below makes use of this feature: <header ng-repeat-start="item in items"> Header {{ item }}</header><div class="body"> Body {{ item }}</div><footer ng-repeat-end> Footer {{ item }}</footer> And with an input of ['A','B'] for the items variable in the example above, the output will evaluate to:

A Javascript When Function Mon Feb 20 2012 function when(conditionFunc, execFunc, interval){ if (conditionFunc()){ execFunc(); }else{ setTimeout(function(){ when(conditionFunc, execFunc, interval);}, interval); } } You have some code which should only execute when a condition is true. E.g. Use when like this... function libIsReady(){ return typeof(LIBRARYNAME) ! Categories

Processing.js Incremental Delaunay Triangulationby Jeonggyu Lee An interactive implementation of incremental Delaunay Triangulation algorithm. My Life Aquaticby David Leibovic, Sunah Suh A shared aquarium Source code Circle of Fifthsby Shelley Marshall Create, transpose, and change a chord progression by using the circle of fifths, and play the progression. 2011 Advent Calendarby Nikolaus Gradwohl An advent calendar built with Processing.js 3D Sketchesby Andor Salga A collection of 3D sketches by Processing.js' 3D developer PJS in CoffeeScriptby David Guttman A tutorial showing how to write Processing.js sketches in CoffeeScript, a language that is compiled into Javascript Flight of the Navigatorby The Mozilla #audio team Fight of the Navigator is a demo showcasing the power of WebGL and Audio API Pew Pewby Nightmare Retro Asteroids clone written in Processing.js Flockingby Harry Brundage The math behind flocking algorithms coaltrace.js byTrevor Bedford Evolutionary simulation. Twitter Flowby Sandro Paganotti AFL Flagsby P5Pby Fizz

Migrating from 2.x to 3.x · visionmedia/express Wiki Removed Changed req.header(field[, defaultValue]) replaced by req.get(field) (remains for backwards compatibility)res.header(field[, value]) replaced by res.set(field, value) / res.get(field) (remains for backwards compatibility)renamed app.register() to app.engine()template engine compliance from engine.compile(str, options) => Function to engine.__express(filename, options, callback)express.createServer() is now simply express() (but remains for BC). Keep in mind that the return value of express() is no longer an http.Server instance. View options Application function The return value of express() is a JavaScript Function, encapsulating everything that makes an Express app tick. ...var app = express();http.createServer(app).listen(80);https.createServer(options, app).listen(443); For convenience, and smaller applications the app.listen() method takes the same arguments, wrapping in an HTTP server. var app = express();app.listen(3000); and Socket.IO compatibility Template engine integration

Related:  tddTestingtutorial