Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d46fe3c

Browse files
juliemrIgorMinar
authored andcommittedFeb 7, 2013
fix(scenario): include error messages in XML output
Fix the XML output of scenario tests so that it properly includes error messages from failing specs.
1 parent 92ca7ef commit d46fe3c

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed
 

‎src/ngScenario/output/Xml.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ angular.scenario.output('xml', function(context, runner, model) {
4343
if (step.error) {
4444
var error = $('<error></error>');
4545
stepContext.append(error);
46-
error.text(formatException(stepContext.error));
46+
error.text(formatException(step.error));
4747
}
4848
});
4949
});

‎test/ngScenario/output/xmlSpec.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
describe('angular.scenario.output.json', function() {
3+
describe('angular.scenario.output.xml', function() {
44
var output, context;
55
var runner, model, $window;
66
var spec, step;
@@ -33,4 +33,17 @@ describe('angular.scenario.output.json', function() {
3333
expect(context.find('it').attr('status')).toEqual('success');
3434
expect(context.find('it step').attr('status')).toEqual('success');
3535
});
36+
37+
it('should output errors to the XML', function() {
38+
runner.emit('SpecBegin', spec);
39+
runner.emit('StepBegin', spec, step);
40+
runner.emit('StepFailure', spec, step, 'error reason');
41+
runner.emit('StepEnd', spec, step);
42+
runner.emit('SpecEnd', spec);
43+
runner.emit('RunnerEnd');
44+
45+
expect(context.find('it').attr('status')).toEqual('failure');
46+
expect(context.find('it step').attr('status')).toEqual('failure');
47+
expect(context.find('it step').text()).toEqual('error reason');
48+
});
3649
});

0 commit comments

Comments
 (0)
This repository has been archived.