Example #1
0
        "Test startReport method": function(){
            //Create a new report object
            var rep = new repstack();
            //start a new report
            rep.startReport();

            //confirm the report is empty
            //I expect just an empty report
            var expected = {"results":[]};
            Y.Assert.areEqual(JSON.stringify(expected), JSON.stringify(rep.getReport()), "Make sure the report only has an empty results node");
        }
Example #2
0
        "Test addReport Method": function(){
            //Create a new report object
            var rep = new repstack();
            //start a new report
            rep.startReport();

            //Add to the report
            var expected =  {"results":[{"passed":2,"failed":0,"total":2,"ignored":0,"duration":28,"type":"report","name":"TabView functional test suite","testCaseyui_3_4_1_3_1337192244962_27":{"passed":2,"failed":0,"total":2,"ignored":0,"duration":26,"type":"testcase","name":"testCaseyui_3_4_1_3_1337192244962_27","test tab structure":{"result":"pass","message":"Test passed","type":"test","name":"test tab structure","duration":2},"test tab selection":{"result":"pass","message":"Test passed","type":"test","name":"test tab selection","duration":15}},"timestamp":"Wed May 16 11:17:25 2012","ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0"}]};

            var report = {"passed":2,"failed":0,"total":2,"ignored":0,"duration":28,"type":"report","name":"TabView functional test suite","testCaseyui_3_4_1_3_1337192244962_27":{"passed":2,"failed":0,"total":2,"ignored":0,"duration":26,"type":"testcase","name":"testCaseyui_3_4_1_3_1337192244962_27","test tab structure":{"result":"pass","message":"Test passed","type":"test","name":"test tab structure","duration":2},"test tab selection":{"result":"pass","message":"Test passed","type":"test","name":"test tab selection","duration":15}},"timestamp":"Wed May 16 11:17:25 2012","ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0"};

            rep.addReport(report);
            //Confirm they are the same
            Y.Assert.areEqual(JSON.stringify(expected), JSON.stringify(rep.getReport()), "Confirm reports are the same, created vs. received");
        }