Bunoon: JUST | Manual | Formatting

Below is a list of functions that are used to control the formatting used for the reports, which are generated as the tests in a TestCase() class are run.

Changes all the log display strings that are used to whatever is specified.

The main arguments for this function are as follows:

  • properties [Object] - The properties that determine the strings to use in the logs (see options below).

    • "NoTestsAvailable" [String] - The message shown when no tests are available.
      • Default: "No tests are available to run at this time".

    • "TestsStarted" [String] - The message shown when the tests are started.
      • Default: "Tests starting, please wait...".

    • "TestsComplete" [String] - The message shown when the tests are complete.
      • Default: "Tests Complete".

    • "TestsOrder" [String] - The message shown to display the order the tests have passed/failed.
      • Default: "Tests Order".

    • "AssertPassed" [String] - The message shown when a assert passes.
      • Default: "Passed".

    • "AssertFailed" [String] - The message shown when a assert fails.
      • Default: "Failed".

    • "AssertWarning" [String] - The message shown when a assert warns.
      • Default: "Warning".

    • "AssertSkipped" [String] - The message shown when a assert is skipped.
      • Default: "Skipped: ".

    • "AssertSkippedIf" [String] - The message shown when a assert is skipped when a condition is met.
      • Default: "Skipped (if condition): ".

    • "AssertSkippedUnless" [String] - The message shown when a assert is skipped because a condition has not been met.
      • Default: "Skipped (unless condition): ".

    • "TestCaseSkipped" [String] - The message shown when a TestCase() is skipped.
      • Default: "Test Case Skipped".

    • "TestCaseSkippedIf" [String] - The message shown when a TestCase() is skipped because of a specific condition has been met.
      • Default: "Test Case Skipped (if condition)".

    • "TestCaseSkippedUnless" [String] - The message shown when a TestCase() is skipped because of a specific condition has not been met.
      • Default: "Test Case Skipped (unless condition)".

    • "TestCaseDescription" [String] - The message shown when the description of the TestCase() is displayed (after it).
      • Default: "Test Case Description".

    • "TestExecution" [String] - The message shown when an execution error occurs with a test.
      • Default: "Execution Error".

    • "Separator" [String] - The separator shown between the various logs.
      • Default: "-".

    • "DiscoverableName" [String] - The message shown when a name of a test is not available.
      • Default: "Test".

    • "TestHeader" [String] - The message shown before the results of a test is displayed.
      • Default: "Test".

    • "TestSkippedHeader" [String] - The message shown before the message stating why the test has been skipped.
      • Default: "Test Skipped".

    • "TestSkippedIfHeader" [String] - The message shown when a test is skipped because of a specific condition has been met.
      • Default: "Test Skipped (if condition)".

    • "TestSkippedUnlessHeader" [String] - The message shown when a test is skipped because of a specific condition has not been met.
      • Default: "Test Skipped (unless condition)".

    • "TestOrderPassed" [String] - The message that is shown for a test that has passed (for the tests order in the summary).
      • Default: ".".

    • "TestOrderFailed" [String] - The message that is shown for a test that has failed (for the tests order in the summary).
      • Default: "F".

    • "TestOrderIgnored" [String] - The message that is shown for a test that has been ignored (for the tests order in the summary).
      • Default: " ".

    • "TestOrderSkipped" [String] - The message that is shown for a test that has been skipped (for the tests order in the summary).
      • Default: "S".

    • "TestDescription" [String] - The message shown when the description of the test is displayed (after it).
      • Default: "Description".

    • "TestsStopped" [String] - The message shown at the bottom of the report if the tests have been stopped.
      • Default: "Tests Stopped".

    • "SetUpCaseErrorMessage" [String] - The message shown after the "TestCaseSkipped" message to state when a TestCase() is skipped due to an error being caught in "SetUpCase".
      • Default: "An error was detected in the 'SetUpCase' function".

    • "SetUpErrorMessage" [String] - The message shown after the "TestSkippedHeader" message to state when a test is skipped due to an error being caught in "SetUp".
      • Default: "An error was detected in the 'SetUp' function".

    • "MaximumDurationReached" [String] - The message shown when the tests are stopped because the maximum duration has been reached.
      • Default: "The maximum duration for the tests has been reached.".

    • "TestDurations" [String] - The header that is printed before each test duration is printed.
      • Default: "Test Durations".

    • "MaximumTestDurationReached" [String] - The message that is printed under the main test details when its maximum duration has been reached.
      • Default: "The maximum duration for this test has been reached.".

    • "VariableTruncate" [String] - The truncate string that should be used for variables after they go over the maximum length (see the "MaximumVariablePrintLength" test property).
      • Default: "...".

    • "Exception" [String] - The exception message that is displayed before the error message (for stack traces and only shown in Safari and Internet Explorer).
      • Default: "Exception".

    • "TestResults" [String] - The message shown when the results of the tests is displayed.
      • Default: "In {cases} Case(s), Passed {tests_passed}, Failed {tests_failed}, Ignored {tests_ignored}, Skipped {cases_skipped} Case(s) and Skipped {tests_skipped} Test(s) in {duration} seconds".

      • Formatting options are as follows:
        • {cases}: Total cases
        • {cases_skipped}: Total cases skipped
        • {cases_repeated}: Total case repeats
        • {tests}: Total tests
        • {tests_passed}: Total tests passed
        • {tests_failed}: Total tests failed
        • {tests_ignored}: Total tests ignored
        • {tests_skipped}: Total tests skipped
        • {tests_repeated}: Total test repeats
        • {tests_added}: Total tests added (during run-time)
        • {tests_removed}: Total tests removed (during run-time)
        • {duration}: Total duration of the tests
        • {execution_failures}: Total execution failures (for tests)
        • {asserts}: Total asserts called
        • {asserts_skipped}: Total asserts skipped

    • "DateTimeLogFormatting" [String] - The formatting that is used in the logs for the Date/Time stamps.
      • Default: "{dy}/{mh}/{yr} {hr}:{mn}:{sd}".

      • Formatting options are as follows:
        • {dy}: Day (in month)
        • {mh}: Month
        • {yr}: Year (full)
        • {hr}: Hours
        • {mn}: Minutes
        • {sd}: Seconds

    • "NumberOfSeparatorCharacters" [Number] - States the number of separator characters that should be displayed between each section that is reported.
      • Default: 170.

Below is an example of how to use this function:

$J.SetupDisplayMessages( {

NoTestsAvailable: "No tests available, oh dear me!",

TestsStarted: "OK, we have started the tests"

} );