]>
git.proxmox.com Git - extjs.git/blob - extjs/packages/soap/.sencha/test/Ext.cmd.api.adapter.js
1 Ext
.cmd
.api
.adapter
= {
8 setCurrentScript: function(name
) {
9 // no-op, managed by Ext.Boot.currentFile
12 getCurrentScript: function() {
13 return this.api
.getCurrentScript(Ext
.Boot
.currentFile
);
16 getSpecStructure: function(spec
) {
19 fileName
: spec
.fileName
,
20 description
: spec
.description
25 getSuiteStructure: function(suite
) {
28 fileName
: suite
.fileName
,
31 description
: suite
.description
34 spLen
= specs
.length
, spec
, sp
,
35 suites
= suite
.suites_
,
36 suLen
= suites
.length
, suite
, su
;
38 for(su
= 0; su
< suLen
; su
++) {
40 structure
.suites
.push(this.getSuiteStructure(suite
));
43 for(sp
= 0; sp
< spLen
; sp
++) {
45 structure
.specs
.push(this.getSpecStructure(spec
));
51 reportTestStructure: function() {
52 var runner
= jasmine
.getEnv().currentRunner_
,
53 suites
= runner
.topLevelSuites(),
54 slen
= suites
.length
, suite
, s
,
57 for(s
= 0; s
< slen
; s
++) {
59 structure
.push(this.getSuiteStructure(suite
));
61 this.api
.addTestSuites(structure
);
64 executeTests: function() {
65 this.isRunning
= true;
66 jasmine
.setOptions(this.api
.jsonOptions
);
68 jasmine
.getEnv().addReporter(new SenchaTestRunner
.Reporter());
69 jasmine
.getEnv().execute();
72 flushTestResults: function() {
73 if(this.testResults
.length
> 0) {
74 var results
= this.testResults
;
75 this.testResults
= [];
76 this.api
.reportTestResults(results
);
80 onTestResult: function(result
) {
81 this.testResults
.push(result
);
82 if(this.testResults
.length
>= this.resultBufferSize
) {
83 this.flushTestResults();
87 captureCoverage: function() {
88 var coverageObj
= window
['__coverage__'];
90 this.api
.addTestCoverage(coverageObj
);
94 onTestsDone: function(success
) {
97 if(success
=== undefined) {
100 me
.success
= success
;
102 me
.flushTestResults();
103 me
.captureCoverage();
104 this.api
.stopWorkItem(me
.success
);