Project

spassky

0.01
No commit activity in last 3 years
No release in over 3 years
This rubygem does not have a description or summary.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Spassky

Spassky is a test framework that allows us to automate the process of running JavaScript Unit tests on various browsers and devices. It currently supports running tests in QUnit, but in theory, will support any JavaScript framework that the browser supports.

Spassky was a protagonist in the greatest Chess match of last century - which being played by an American and a Soviet Russian, was a Cold War metaphor. Spassky eventually resigned and Fischer won the championship.

Architecture

                   +-----+
                   | You |
                   +--+--+
                      |
                      |
                      v
 +------------------------------------------+
 |         Spassky Central Server           |
 +------------------------------------------+
           |           |          |
           |           |          |
           v           v          v
       +-------+   +-------+   +-----+
       |iPhone3|   |iPhone4|   |Nokia|
       |-------|   |-------|   |-----|
       |       |   |       |   | +++ |
       |       |   |       |   | +++ |
       |   +   |   |   +   |   | +++ |
       +-------+   +-------+   +-----+

Developers push JS unit tests to the Spassky server through a command line interface. Multiple devices connected to the central Spassky server will poll the server for a suite of tests. The browser will be redirected to the test page, run the tests, and then are redirected to the idle loop.

Installation

gem install spassky

Spassky

Usage

Start the server:

spassky server --port 9191

Connect test devices by browsing to http://localhost:9191/device/connect on the device. The device will stay in an idle meta refresh loop until it receives a test to run.

Check what devices are connected to the server:

spassky devices --server http://localhost:9191

Run a single html file (the second parameter is the test name):

spassky run --pattern html_test.html --test html_test.html --server http://localhost:9191

Run a test with colour:

spassky run --pattern html_test.html --test html_test.html --server http://localhost:9191 --colour

Run a directory that contains a test

spassky run --pattern test_directory --test html_test.html --server http://localhost:9191

Why?

We need to run automated tests on a wide range of web-enabled devices with very mixed capabilities. Some of them have JavaScript, but in many cases it's not standard and buggy. That means web testing tools targeted at desktop browsers don't tend to work very well, if at all. Spassky uses legacy techniques and as little client-side JavaScript as possible to ensure we can run tests on as many devices as possible.

How it works

Physical devices act as test agents, connected permanently to a central server using meta refresh tags. Using a command-line utility, developers execute tests against those browsers by posting to the central server. The tests themselves are plain HTML pages, that are expected to call an assert URL (e.g. by embedding an image) within a time frame.

Test structure

Tests can be either a single html file, or a directory containing multiple files.

If spassky is given a directory, it will pass all files in that directory to that server. Any other files in the test directory can be linked to from the html file relatively.

An example test directory:

test_name
 |-scripts/main.js
 |-css/main.css
 |-test.html

Some features that would be nice to have

  • Assertions on network activity (e.g. for caching tests)