Skip to content

Instantly share code, notes, and snippets.

@DanielGallo
Created July 31, 2018 16:40
Show Gist options
  • Save DanielGallo/64c6512685ea4c5169bfa228a1d13a15 to your computer and use it in GitHub Desktop.
Save DanielGallo/64c6512685ea4c5169bfa228a1d13a15 to your computer and use it in GitHub Desktop.
Getting and storing a grid cell value
// Scenario URL: http://examples.sencha.com/extjs/6.5.3/examples/kitchensink/?classic#array-grid
describe('Grid', function() {
var recordTitle;
it('should get the cell text content', function() {
// Use the "getRecord" API to get a record's value
ST.grid('grid[title="Basic Grid"]')
.rowAt(1)
.getRecord()
.and(function(row) {
recordTitle = row.data.record.name;
});
// Or, to get the cell's actual text content
/*ST.grid('grid[title="Basic Grid"]')
.rowAt(1)
.cellAt(0)
.get('innerText')
.and(function(future) {
recordTitle = future.data.innerText;
});*/
});
it('should compare the cell text with another value', function() {
expect(recordTitle).toContain('Voomm');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment