= LZTestKit This package extends lzunit with behavioral testing, asynchronous test support, test case selection, and automated test sequencing. * Test case selection runs a single test case within a test applet, without modifying the sources. (You supply the name of the test case as a query parameter in the application URL.) It allows you to use your test applet as your debugging scaffolding, without running a lot of code that you aren't interested in. * Automated test sequencing runs all the test applets in a directory, in series, in a single browser window, stopping if one of them has an error. It allows you to run all of a package's test cases from the browser by visiting a single url, instead of navigating to each url in turn. * Behavioral testing implements mocks, stubs, and expectations. It allows you to *test* one class, while *stubbing* the classes that it depends on. You can even verify that the tested class makes functions thatyou expect it to. This is a loose port of rspec to OpenLaszlo. * Asynchronous test support allows you to write a test case that is only considered complete when the callback functions or delegates that it defines return. If a test case creates a callback function, the test case is only complete when the callback function returns. (Except if the callback function creates a callback function, etc.) == Requirements This package requires OpenLaszlo 3.4.0 or 4.0.6. (Other versions might work, but aren't tested.) == Installation * Download the latest version from {download-location}. * Unpack it into your OpenLaszlo webapp directory; for example, at ${OPENLASZLO_HOME}/Server/lps-3.4.0/lztestkit. * Visit e.g. http://127.0.0.1:8080/openlaszlo-4.0.6/lztestkit/examples and http://127.0.0.1:8080/openlaszlo-4.0.6/lztestkit/test. (The first part of the path will be different if you've got a different version of OpenLaszlo, or if you've installed the servlet instead of the server). You should be able to click on the examples and tests in order to run them. == Features === Test case selection If a test application is compiled with support for test case selection, you can invoke it with a testCase={testCaseName} query parameter to run only the test case named {testCaseName}. Include lzunit-extensions.js in your application (or include library.lzx, which includes this). Then, include the testCase={testCaseName} query parameter in the URL that you use to open the application, where {testCaseName} is the name of the test case. Only this test case will execute. See the example in examples/test-selection.lzx. === Automated test sequencing Copy test/autorun/index.jsp into your test directory to run all the test applications in that directory within a single browser window, without user interaction. Copy test/autorun/index.jsp into your test directory, and update the includes at the top of the file to reflect the paths to the lztestkit src and lib subdirectories. By default, this file will run files in its directory that match /test-*.lzx/; this is a configuration parameter that it should be obvious how to change. Each test cases should include autorun-lz.js via