var queue = [];
var blocking = false;
+var fixture;
function reset() {
- synchronize(function() {
- blocking = true;
- $.get('index.html', function(content) {
- var div = $(document.createElement('div')).html(content)
- // search for main div
- .find('[@id=main]').html();
- $('#main').html(div);
- blocking = false;
- process();
- });
- });
+ if(fixture) {
+ $("#main").html(fixture);
+ } else {
+ fixture = $("#main").html();
+ }
}
function synchronize(callback) {
}
function runTests(files) {
+ var fixture = null;
+ reset();
var startTime = new Date();
for( var i=0; i < files.length; i++) {
runTest( files, i );
- reset();
}
synchronize(function() {
var runTime = new Date() - startTime;
document.getElementById("tests").appendChild( li );
Test = [];
+ reset();
blocking = false;
process();
});
* @example $("p").css("color");
* @before <p style="color:red;">Test Paragraph.</p>
* @result red
+ * @desc Retrieves the color style of the first paragraph
+ *
+ * @example $("p").css("fontWeight");
+ * @before <p style="font-weight: bold;">Test Paragraph.</p>
+ * @result bold
+ * @desc Retrieves the font-weight style of the first paragraph.
+ * Note that for all style properties with a dash (like 'font-weight'), you have to
+ * write it in camelCase. In other words: Every time you have a '-' in a
+ * property, remove it and replace the next character with an uppercase
+ * representation of itself. Eg. fontWeight, fontSize, fontFamily, borderWidth,
+ * borderStyle, borderBottomWidth etc.
*
* @test ok( $('#foo').css("display") == 'block', 'Check for css property "display"');
*
* @example $("p").css("color","red");
* @before <p>Test Paragraph.</p>
* @result <p style="color:red;">Test Paragraph.</p>
+ * @desc Changes the color of all paragraphs to red
+ *
*
* @test ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible');
* @test $('#foo').css('display', 'none');