QUnit test adapter for OPA: add a test to be executed by QUnit Has the same signature as QUnit.test (QUnit version is also considered) Suggested usage:
sap.ui.require(["sap/ui/test/Opa5", "sap/ui/test/opaQunit"], function (Opa5, opaTest) {
Opa5.extendConfig({
assertions: new Opa5({
checkIfSomethingIsOk : function () {
this.waitFor({
success: function () {
Opa5.assert.ok(true, "Everything is fine");
}
});
}
})
});
opaTest("Should test something", function (Given, When, Then) {
// Implementation of the test
Then.checkIfSomethingIsOk();
});
});
Param | Type | Default Value | Description |
---|---|---|---|
testName | string | name of the QUnit test. | |
expected? | int | only supported in QUnit v1.x: denotes how many assertions are expected to be made in the test. | |
callback | function | the test function. Expects 3 arguments, in order: {@link sap.ui.test.Opa.config}.arrangements, {@link sap.ui.test.Opa.config}.actions, {@link sap.ui.test.Opa.config}.assertions. These arguments will be prefilled by OPA | |
async? | boolean | false | available only in QUnit v1.x. Indicates whether the test is asynchronous. False by default. |
Method | Description |
---|