run() method from fcf.NUnitest.Unitest class
Package: fcf-framework-unitest
File: fcf-framework-unitest:unitest.js
Available from version: 1.0.1
Runs tests, both on the server side and on the browser side
-
[
string ]|string parts =undefined - The name of the section(s) of the tests to run. The testing section allows you to separate tests, for example, into basic tests that do not require the application to run, and application tests that require the entire application to run. If the parameter isundefined , then no restriction is applied. -
[
string ]|string groups =undefined - The name of the group(s) of tests to run. If the parameter isundefined , then no restriction is applied. -
[
string ]|string tests =undefined - Name is a list of test names to be run. If the parameter isundefined , then no restriction is applied. -
boolean enableWebTests =true - Flag to allow browser side tests to run when running on the NODEJS server side. Browser-side testing (when run from a NODEJS script) will only run if the webTestingPages array is not empty and enableWebTests is set totrue . -
boolean enableLocalTests =true - A flag that allows tests to run on the caller. -
[
string ] include = [] - An array of included JS files during testing. File paths are specified in FCF notation. -
boolean quiet =false - If equal totrue , then the output to the console of information about testing is not performed -
integer timeout =30000 - The time to wait for a single test to run, in milliseconds. -
[
object ] processes = [] - An array describing the processes that will run before testing. When testing is complete, the processes are terminated.Object properties:
-
string |[string ] command - The command to start the process can be given as a single string or as an array of command line arguments. -
integer startTimeout =1000 - Time in milliseconds to wait for the application to start. The executable script transfers control to the following commands only after the specified delay has elapsed.
-
-
[
object ] webProcesses = [] - An array describing the processes that will run before testing on the browser side. Used to start WEB services. Runs only if the enableWebTests parameter is set totrue and the webTestingPages array is not empty. When testing is complete, the processes are terminated.Object properties:
-
string |[string ] command - The start command, which can be given as a single string or an array of command line arguments. -
integer startTimeout =1000 - Time in milliseconds to wait for the application to start. The executable script transfers control to the following commands only after the specified delay has elapsed.
-
-
[
string |[string ]] webBrowsers = [["google-chrome" ,"chrome" ,"chromium" ,"firefox" ,"opera" ,"safari" ]] - An array with a list of browsers for which testing will be carried out. If the array element is an array, then the test will run against the first browser in the nested array that runs successfully.The value of the array element is the name of the command to be executed, so the path to the specified browser must be specified in the PATH environment variable. This is especially important on Windows!
-
[
object ] webTestingPages =[] - An array with information about the pages for which testing will be carried out on the browser sideObject properties:
-
string url - URL of the page being tested -
[
string ] include = [] - An array of additionally included URLs to JS files on the browser side, where tests can be located. -
integer |string wait =0 - Waiting time before testing, after page load. If the parameter is a string, then it must contain the path to a global asynchronous function that will return control after all page components have been loaded.
-
-
integer webTestingPort =4589 - TCP port for sending internal testing commands on the browser side -
function onMessage =undefined - Callback handler function on the event of information output to the consoleFunction signature: onMessage(
object a_info)-
object a_info - An object with information about output to the console-
string part - The name of the test section currently running -
string group - The name of the test group that is currently running -
string test - Name of the current test -
string level - Logging level ("test" |"crash" |"error" |"warning" |"log" |"info" |"debug" |"trace" ) -
string source - The name of the module from which the logging was performed -
string executor - Test executor. If the test was run on the server, then the value is"server" , if the test was run on the browser side, then the value is equal to the name of the browser process. -
Date time - Logging time.
-
-
Object properties:
-
integer errorCount - Number of tests executed with errors -
integer testCount - Number of tests performed -
integer successfulCount - Number of successfully completed tests -
[
object ] tests - Array with information about executed testsObject properties:
-
string part - Test section name -
string group - Test group name -
string test - Test name -
string executor - Test executor. If the test was run on the server, then the value is"server" , if the test was run on the browser side, then the value is equal to the name of the browser process -
string status - Test completion status ("error" |"ok" ) -
Error error =undefined - Error object with which the test ended
-
-
[
object ] output - An array with information about output to the console. For a description of the object's elements, see the description of the onMessage parameter.
Output: