on 04-17-2018 7:34 PM
I have a simple OPA5 test for my SAPUI5 app to check that a table is displayed when I click a button. When the test runs it clicks on the button and the table shows up but the there is no data on it. Using console logs on my code I can see that the data is being set properly. Here are my code snippets. Is there a way to wait for the data to be bound before proceeding to check for the table?
Code to be tested:
var errorsModel = new sap.ui.model.json.JSONModel(data);
oComponent.setModel(errorsModel, "errors_inputs");
console.log(oComponent.getModel("errors_inputs"));
OPA Test
opaTest("Should press the Process button and see the formatting errors table", function (Given, When, Then) {
// Actions
When.onCheckingErrortables.iPressTheProcessButtonWithBadData();
// Assertions
Then.onCheckingErrortables.iShouldSeeTheErrorsTableWithOneRow();
});
PageObjects for this test:
actions: {
iPressTheProcessButtonWithBadData: function(){
return this.waitFor({
viewName: inputsView,
id: "processBtn",
actions: new Press(),
errorMessage: "No Process button found"
});
}
},
assertions: {
iShouldSeeTheErrorsTableWithOneRow: function () {
return this.waitFor({
viewName: inputsView,
id: "errors_table",
matchers: new AggregationFilled({name: "rows"}),
success: function (rows) {
Opa5.assert.ok(rows.getRows().length === 1, "The Errors Table is visible and contains one row");
},
errorMessage: "Errors Tables does not have the right number of rows"
});
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.