new Case()
This class represents case written inside tests and salep scope. For every case ran or skipped in salep, there is a case object created and stored. Those case objects are accessible from results.
Example
salep.test("A test", function() {
salep.case("Case 1", function() {
// Continue to case
});
});
...
var result = salep.getResults();
result.tests.forEach(function(test) {
test.cases.forEach(function(case) {
if (case.success === false) {
console.log("Case [" + case.name + "] failed, reason: " + case.reason);
}
});
});
Members
name :string
Name of the case
Type:
- string
parent :Test
Indicates the parent test of case.
Type:
reason :string
Declares the reason of failure if case is failed. If case is succeded or skipped this property equals to empty string
Type:
- string
skipped :boolean
Indicates if case skipped or not.
Type:
- boolean
success :boolean
Success status of case, true if case succeeded false otherwise
Type:
- boolean