0

How does a OPA match pattern for a sap.m.MessageToast.show call looks like? I looked into the Code of sap.m.MessageToast.show and assumed the use control is sap.ui.core.Popup. Therefore I tried the following matcher:

iShouldSeeAToastMessage : function() {
    return this.waitFor({
        controlType : "sap.ui.core.Popup",
        success : function (aDialog) {              
            ok(true, "Found a Toast: " + aDialog[0]);
        },
        errorMessage : "No Toast message detected!"
    });
},

Is the controlType correct? How could the matcher section look like?

Zoyd
  • 3,449
  • 1
  • 18
  • 27
user3783327
  • 616
  • 8
  • 30
  • 60

1 Answers1

3

This should work:

return this.waitFor({
    pollingInterval : 100,
    viewName : "YOUR_VIEW_NAME_HERE",
    check : function () {
        return !!sap.ui.test.Opa5.getJQuery()(".sapMMessageToast").length;
    },
    success : function () {
        ok(true, "Found a Toast");
    },
    errorMessage : "No Toast message detected!"
});
matbtt
  • 4,230
  • 19
  • 26