testing - 自定义 Rally Grid 列和 Rally 数据列

标签 testing rally

我正在尝试创建一个应用程序,它将显示当前项目中的所有测试集及其通过/失败总数的状态。 我面临的问题(顺便说一句,昨天刚开始学习 ExtJS 和 Rally SDK):
- 我需要了解如何使用当前选择的项目作为在网格中起诉的项目作为过滤器
- 应如何查询测试集通过/失败总数,然后将其显示在网格的列中 - 示例:测试集 123 | 45/70

最佳答案

这是一个使用 project picker 的应用示例并按项目构建测试集网格。另请参阅 this post 中的代码示例. Web Services API 中没有归档计算通过/失败总数的地方。您将不得不迭代结果并计算代码中的总数。我鼓励通过某些标准限制测试用例结果的数量,例如创建日期。在测试用例结果自动生成的情况下,庞大的数据量可能会产生问题。

Ext.define('CustomApp', {
    extend: 'Rally.app.App',
    componentCls: 'app',

        launch: function() {
            var c = Ext.create('Ext.Container', {
                items: [
                    {
                    xtype: 'rallyprojectpicker',
                    fieldLabel: 'select project',
                        listeners:{
                            change: function(combobox){
                                if ( this.down('#g')) {
                                    console.log('grid exists');
                                    Ext.getCmp('g').destroy();
                                    console.log('grid deleted');
                                }
                                this.onProjectSelected(combobox.getSelectedRecord());
                            },
                            scope: this
                        }
                    },
                ],
            });
            this.add(c);
        },

        onProjectSelected:function(record){
            var project = record.data['_ref'];
            console.log('project', project);
            var testSetStore = Ext.create('Rally.data.WsapiDataStore', {
            model: 'TestSet',
            fetch: ['FormattedID','Name', 'Project', 'TestCaseStatus'],
            pageSize: 100,
            autoLoad: true,
            filters: [
        {
            property: 'Project',
            value: project
        }
        ],
            listeners: {
                load: this.onTestSetsLoaded,
                scope: this
            }
        }); 


        },

    onTestSetsLoaded:function(store, data){
                var testSets = [];
                Ext.Array.each(data, function(testset) {
                    var ts  = {
                        FormattedID: testset.get('FormattedID'),
                        _ref: testset.get("_ref"),  
                        Name: testset.get('Name'),
            TestCaseStatus: testset.get('TestCaseStatus')
                    };
                    testSets.push(ts);
                 });
                this.updateGrid(testSets);

    },


        updateGrid: function(testSets){
        var store = Ext.create('Rally.data.custom.Store', {
                data: testSets,
                pageSize: 100
            });
        if (!this.down('#g')) {
        this.createGrid(store);
        }
        else{
        this.down('#g').reconfigure(store);
        }
    },

        createGrid: function(store){
    console.log("load grid", store);

    var g = Ext.create('Rally.ui.grid.Grid', {
                id: 'g',
        store: store,

        columnCfgs: [
        {
                   text: 'Formatted ID', dataIndex: 'FormattedID', xtype: 'templatecolumn',
                    tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
                },
                {
                    text: 'Name', dataIndex: 'Name'
                },
        {
                    text: 'TestCaseStatus', dataIndex: 'TestCaseStatus'
                }
        ]
    });
    this.add(g);
   },
});

此示例的完整 html 源代码可从 this repo 获得。

关于testing - 自定义 Rally Grid 列和 Rally 数据列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19887056/

相关文章:

集会回顾: help fetching all history based on future state

rally - 应用程序SDK 2.0 : Charts in the short term?

testing - Angular2 测试 - 未检测到变化

java - 如何在 Java 上使用单元测试来测试与类的私有(private)字段的交互?

Django 测试报错AttributeError : 'tuple' object has no attribute 'setdefault'

perl - 使用 Test::WWW::Selenium 或其他方式检测操作系统对话框

scala - 在 IntelliJ ClassNotFoundException 中运行测试

java - .net 应用程序可以将 SSO token 传递给 java 应用程序以调用 Rally Rest 服务吗?

web-services - 如何使用 REST API 在 Rally 中更新测试用例的最后判决

c# - 拉力赛API : How do I create a UserStory and relate it to a Feature?