The APIs in Sencha Test don't currently allow for filtering or locating rows by more than one property and value. Instead, you would need to use the Ext JS Store's "findBy" method, wrapped inside of an "execute" function in Sencha Test. Below is an example that shows how this can be achieved on one of the Kitchen Sink grids. In this example, a grid row is being located by two properties:
Code:
// WebDriver scenario example.
//
// Scenario URL: https://examples.sencha.com/extjs/6.7.0/examples/kitchensink/frame-index.html?classic#cell-editing
describe('Grid tests', function() {
it('should find a grid row by multiple properties', function() {
// Define the property values you want to search
var common = 'Bee Balm',
light = 'Shade';
ST.grid('cell-editing')
.and(function(future) {
// Set the property names and values on the "future" object
future.data = future.data || {};
future.data.common = common;
future.data.light = light;
})
.execute(function(grid) {
// This function gets passed to the browser for execution.
// In order for it to have access to your property names and values,
// you need to add them to the "future.data" object, as above.
var me = this;
// Use the Ext JS "findBy" method of the Store to locate a record
// index by a custom function, and return the index.
return grid.getStore().findBy(function(record, id) {
return record.get('common') === me.future.data.common
&& record.get('light') === me.future.data.light;
});
})
.and(function(future) {
// "executeResult" contains the return value from the function above.
var rowIndex = future.data.executeResult;
// Now interact with the grid row, now we know the index
ST.grid('cell-editing')
.rowAt(rowIndex)
.click();
});
});
});