I'm looking to the right way to end to end test (e2e) an ag-grid angular application.
protractor documentation says that you can use by.model(modelName)
to sendKeys
to an input field using ng-model.
https://www.protractortest.org/#/api?view=ProtractorBy.prototype.model
But ng-model is not an angular 2 directive
I've tried for example this method but it's not working:
const cellElement = element(by.model('row.name'));
browser.actions().click(cellElement).perform(); //to get focus on cell
cellElement.sendKeys('some value');
But this do not give any result, there is no focus on the cell, there is no cursor in the cell as well when I debug with visual studio code.
One thing I found is that when the cell is not in focus or in edit mode, I see these classes in the devtool added to the cell element:
ag-cell
, ag-cell-with-height
, ag-cell-value
, ag-cell-not-inline-editing
, ag-cell-focus
And when I double click in a cell manually without protractor (which I'm not even able to get working), then I see these classes added to the element in the chrome devtool:
ag-cell
, ag-cell-with-height
, ag-cell-value
, ag-cell-focus
, ag-cell-inline-editing
is it possible to add the class
ag-cell-inline-editing
to the element and force the cell to receive the content we send to it ?
since I see that in the official documentation there is no documented way to do this advanced protractor e2e tests, even if it is normally supposed to be like a basic simple test to create.
Is there any way to get this to work and be able to do for example cell content validation ? means if I edit the content of the cell then my form is valid ? and all this using just protractor.