Reference a combobox within a grid row using Sencha Test

166 Views Asked by At

Reference a combobox within a grid row using Sencha Test.

Given something like:

{
            text: "Select one",
            width: 110,
            editor: {
                field: {
                    xtype: 'combobox',
                    editable: true,
                    valueField: 'val',
                    displayField: 'name',
                    store: {
                        fields: ['val', 'name'],
                        data: [
                            [0, 'Option 1'],
                            [1, 'Option 2'],
                            [2, 'Option 3']
                        ]
                    }
                }
            }         
        }

So far I can't reference the combo that gets activated once you click on a cell.

This is using a cellediting plugin.

 plugins: {
        ptype: 'cellediting',
        clicksToEdit: 1
    },

So I'm trying to select one of those values from there using ST. So far no luck. I'm only able to activate the cellediting plugin doing something like:

this.grid().rowAt(index).cellAt(1).click();
1

There are 1 best solutions below

1
On BEST ANSWER

Added an itemId to the combobox and did this:

this.grid().rowAt(index).cellAt(1).click();
ST.comboBox('combobox[itemId=someValue]').visible().expand().setValue(1);

(this refers to a PageObject)