Debugging a sporadic error with grid right-click
Posted: Wed May 16, 2018 2:57 am
I have a test that
1. selects two items on a grid
2. executes a right click which opens a context menu,
3. clicks one of the items in the menu.
Here's a rough idea of the code:
Without the waitFor:1000 (or some magic number), It sporadically fails to execute the right click and instead simply shows the message "waiting for [Object object]".
I have tried waiting for a selection change on the selectionModel, and I also tried doing a waitForTop, and neither of those solved the problem, but the arbitrary wait statement does if the # of seconds to wait is long enough.
Any ideas? I hate the idea of leaving a magic number in there but I'm out of things to try. I went into siesta-all.js to try and console.log things but I got as far as the processMouseActionSteps function at which point I didn't really know how to keep tracing in a meaningful way.
Thanks!
1. selects two items on a grid
2. executes a right click which opens a context menu,
3. clicks one of the items in the menu.
Here's a rough idea of the code:
function(next) {
var items = grid.getStore().getData().items;
grid.getView().getSelectionModel().select([items[0],items[1]]);
next();
},
{ waitFor: 1000}, //right click sporadically fails if I don't put this in ...
{ rightclick: function() { return t.getCell(grid,0, 2); } },
{ click: ">>menuitem[text=Bulk Copy]", desc: "Click Bulk Copy"}
I have tried waiting for a selection change on the selectionModel, and I also tried doing a waitForTop, and neither of those solved the problem, but the arbitrary wait statement does if the # of seconds to wait is long enough.
Any ideas? I hate the idea of leaving a magic number in there but I'm out of things to try. I went into siesta-all.js to try and console.log things but I got as far as the processMouseActionSteps function at which point I didn't really know how to keep tracing in a meaningful way.
Thanks!