|
ConfigurationFile
Configuration file for test runner.
IntroductionConfiguration file is written in YAML and is used to tell the test runner which files to load to browser and in which order. By default the JsTestDriver looks for the configuration file in the current directory and with the name jsTestDriver.conf. You can use --config command line option to specify a different file. Example: server: http://localhost:4224
load:
- src/*.js
test:
- src-test/*.js
exclude:
- uselessfile.js
serve:
- css/main.css
proxy:
- {matcher: "*", server: "http://localhost/whatever"}
plugin:
- name: "coverage"
jar: "lib/jstestdriver/coverage.jar"
module: "com.google.jstestdriver.coverage.CoverageModule"
timeout: 90
server:Specifies the default location of the server. This value can be overridden with a command line option --server. See CommandLineFlags. load:List of files to load to browser before the test can be run. We support globing with *. The files are loaded in the same order as specified in the configuration file or alphabetically if using globing. You can declare external scripts by adding the http address of the script as a loadedable item. test:A list of test sources to run. exclude:Never load this file. Used in conjunction with globing and load. Useful saying load everything except these files. serve:Load static files (images, css, html) so that they can be accessed on the same domain as jstd. proxy:Set jstd to behave as proxy. See proxy. plugin:Load jstd plugin. See plugins. timeout:Timeout in seconds. |
Is there a way to load an external scripts ?
Can it load files in "../x/"? Thanks.
From what I can see the web server component does not support paths with "../". But it looks like you can pass a --basePath option when running the jar to load files relative to a parent directory.
Is there a way to include and exclue files recursively?
E.g.:
load:
exclude:
how can I load jsp files containing javascript in script tags?
Is there a recommended way to integrate JsTestDriver? with Closure Library? First, it's a pain to depend on each Closure directory (or even each directory of my own source). Second, I have to order the dependencies properly.
How exactly does the serve directive work? I've added the it as detailed above but none of the css is ever applied.
I have managed to install and apply some tests in jsTestDriver on eclipse, but there is a very unusual flaw in the output. It displays all the tests in a jumbled order that the tests were created? For example: If I write:
TestCase('Hello World 123',{
});Then the output is:
Hello World 123
Can I change the order of the display with the conf file?
serve files can be called at runtime with the prefix:
/test/
is there a way of passing config info that the test can pick up such as an environment variable. would be helpful in some cases to have the test perform conditional behaviour based on it rather than having separate test configs.
Note that you cannot use https:// in the load section.
load:
It resolves this as /test/https://ajax.googleapis.etc
I'm not sure if that should be a feature or not. It's available as http:// so in this case an easy workaround.
Is there a way to use a variable for the server value? That way I can set the server in one file and for multiple configs use the variable to easily update it. Instead of changing loads of config files to the new server.
Also, it states that I can use --port to override the config file. But when my command line port value is different from the config file it shoots out an error that cannot be resolved without having both the config file and command line port argument be the vale value.
I'm using the serve directive to mock an AJAX call:
In my test code I make a GET request for 'data.html'. I'm getting a 200 repsonse, but the body of the response is empty. How do I get my data?