wiki:WikiTesting

Version 3 (modified by jeroen, 3 years ago) (diff)

--

Testing tool

This page describes the overall flow and functionalities of our testing tool. The tool is a single-page javascript that allows for rapid integration testing of the different settings with arbitrary players, plugins and skins.

Settings

All settings of the tool are loaded from an external javascript, settings.js. This script should be in the same folder as the testing tool. The settings.js lists the following settings:

  • All players available for testing.
  • All skins available for testing.
  • All plugins available for testing.
  • A list of testing examples.
  • A flag called show_api_forms which can be used to toggle the javascript API forms.

Here's an example settings.js:

var settings = {
	players: {
		'5.1':'../tags/mediaplayer-5.1/player.swf',
		'5.0':'../tags/mediaplayer-5.0/player.swf'
	},
	plugins: {
		audiodescription:'../plugins/audiodescription/v4/audiodescription.swf',
		captions:'../plugins/captions/v4/captions.swf'
	},
	skins: {
		none:'',
		beelden:'../skins/beelden/beelden.xml',
		bekle:'../skins/bekle/bekle.swf'
	},
	examples: {
		'': {},
		'FLV video': {
			file:'../../testing/files/bunny.flv',
			image:'files/bunny.jpg',
			skin:'beelden',
			height:240,
			width:400
		},
		'Captions': {
			file:'../../testing/files/bunny.mp4',
			image:'files/bunny.jpg',
			height:240,
			width:400,
			plugins:'captions',
			'captions.file':'files/captions.srt'
		}
	},
	show_api_forms:true
}

Note that players, plugins and skins can be referenced in the testing examples, by using their names defined above the examples (e.g. the plugins:"captions"). Multiple plugins can be added to an example like this: plugins:"audiodescription,captions".

For players and plugins, the testing tool presumes an XML file with the same name to be available in the same folder as the player or plugin. This XML file is used by the tool to build the fieldsets with all settings for that player or plugin. Here's an example player XML and an example plugin XML.

Skins do not need a settings XML since the settings are included in the skin themselves. Skins can have the extension swf (4.0 player skins), xml (5.0 player skins) and zip (also 5.0 skins, but then compressed in a ZIP file).

Initialization

The testing tool performs the following steps when it's being loaded:

  1. The settings.js file is loaded.
  2. The examples form and sources fieldset are loaded with values from these settings.
  3. If present, the tool grabs all variables from the browser's querystring.
  4. Using these variables, the tool selects a player, a skin and the plugins to use.
  5. The tool builds the fieldsets with settings for the player and plugins.
  6. The tool prefills the elements with values from the browser's querystring.
  7. The querystring variables that could not be loaded into a fieldset element are pushed into a new Custom fields fieldset.
  8. With all the variables prefilled, the appropriate player, skin and plugins are loaded.
  9. Together with the loading of the player, the testing tool also generates a permalink for the current setup (click the permalink item to jump to it).

Every time an example is selected, the player generates a querystring for that example and reloads the page using those variables. Step 1 to 9 are then followed again.

Every time a new player or plugin is selected, the testing tool reloads the fieldsets, essentially repeating step 5 to 9.

Every time a new skin is selected, a field is updated or a new custom field is added, step 8 and 9 are repeated.