I have a grid that have the cells editable using the contenteditable markup.
The grid works fine and binds correctly to the angularjs model but I cannot make the testing automation using the angularjs e2e testing framework to work.
After browsing the angular scenario js I found the dsl methods for performing the e2e testing and noticed that the contenteditable would not work with the input method.
So I created a new dsl method for contenteditable:
angular.scenario.dsl('contenteditable', function () {
var chain = {};
chain.enter = function (value) {
return this.addFutureAction("contenteditable '" + this.name + "' enter '" + value + "'", function ($window, $document, done) {
var contenteditable = $document.elements(this.name);
debugger;
contenteditable.text(value);
contenteditable.trigger('change');
done();
});
};
return function (name) {
this.name = name;
return chain;
};
});
After a while I could make half of it to work, but it still doesn't trigger the 'change' event that is crucial for my angular directive code to work (even with the trigger call there).
What is the best way to solve that? Ideas?