Rally应用SDK使用TreeView加载testfolder,只加载top folder



尝试运行为Rally App SDK提供的树视图示例testfolders示例[这里][1]- https://help.rallydev.com/apps/2.0/doc/#!/api/Rally.ui.tree.Tree [1]

为userstory和test文件夹提供的示例都只加载顶层,不加载子任务/用户故事(userstory &对于测试文件夹,不加载子文件夹或测试用例。

这是App.js文件的摘录。

Ext.define('CustomApp', {
    extend: 'Rally.app.App',
    componentCls: 'app',
    
    launch: function() {
    	
    	this.add({
				         xtype: 'rallytree',
				         topLevelModel: Ext.identityFn('TestFolder'),
				         childModelTypeForRecordFn: function(record){
				             if(record.get('Children') && record.get('Children').length > 0){
				                 return 'TestFolder';
				             } else {
				                 return 'TestCase';
				             }
				         },
				         givenAParentRecordWhatIsTheAttributeConnectingAChildToThisParentFn: function(record){
				             if(record.get('Children') && record.get('Children').length > 0){
				                 return 'Parent';
				             } else {
				                 return 'TestFolder';
				             }
				         },
				         canExpandFn: function(record){
				             return record.get('Children') && record.get('Children').length > 0
				             || record.get('TestCases') && record.get('TestCases').length > 0;
				         },
				         enableDragAndDrop: false,
				         dragThisGroupOnMeFn: function(record){
				             if(record.get('_type') === 'testfolder'){
				                 if(record.get('Children') && record.get('Children').length > 0){
				                     return 'testfolder';
				                 }
				                 if(record.get('TestCases') && record.get('TestCases').length > 0){
				                     return 'testcase';
				                 }
				                 return ['testfolder', 'testcase'];
				             }
				         },
				         topLevelStoreConfig: {
				             sorters: []
				         },
				         childItemsStoreConfigForParentRecordFn: function(){
				             return {
				                 sorters: []
				             };
				         }
                //remaining config omitted for brevity
            
        /**/
      });
        //API Docs: https://help.rallydev.com/apps/2.1/doc/
    }
});

看看这个应用:https://github.com/nikantonelli/TestCaseOrganiser

应该显示你的TestFolder层次结构和测试用例,甚至允许拖放移动测试用例。

最新更新