add select_cells test utility

selects [included,excluded) semi-open range, like Python conventions.
This commit is contained in:
Min RK 2016-01-22 11:42:45 +01:00
parent 89b75c21e2
commit f0cb481cb2

View File

@ -446,6 +446,15 @@ casper.select_cell = function(index, moveanchor) {
}, {i: index, moveanchor: moveanchor});
};
casper.select_cells = function(index, bound, moveanchor) {
// Select a block of cells in the notebook.
// like Python range, selects [index,bound)
this.evaluate(function (i, n, moveanchor) {
Jupyter.notebook.select(i, moveanchor);
Jupyter.notebook.extend_selection_by(n);
}, {i: index, n: (bound - index - 1), moveanchor: moveanchor});
};
casper.click_cell_editor = function(index) {
// Emulate a click on a cell's editor.