Typically we build a lot of library utilities to assist our test automation effort. If these are utilities specific to only a few test cases, then you can use it in the corresponding WET tests by adding a 'requires' statement in each of the WET tests that need this utility. However you may also have a lot of other utilities which are used in all of your tests. For such utilities, it would be a tedious effort to add the requires header to each one of the WET test. Instead you can add these library utilities to your global configuration and all of your WET tests will have access to these libraries. The global configuration file is a config file that is stored in %QWT_HOME%\etc\global-config.cfg. This file has a (commented by default) section:
===========
[Include]
###either provide a single file or directory listing or a directory
###from which all script files should be included
#
#path=C:/wet/samples/SampleScript;C:/wet/samples/sandbox
###Pattern of known script files - syntax - *.a or *.
{a,b,c}
##
pattern=*.
{rb,qws}
#test=#
{ENV['tests']}/common_precondition
===========
In the above lines, replace the #path parameter with:
path =/lib/lib_file1.rb;/lib/lib_file2.rb;...;/lib/lib_fileN.rb
OR
path =/lib/
Where lib_file1.rb, lib_file2.rb, etc are the ruby files that you want WET to use at runtime. The assumption being made here is that these library files are all stored in the /lib directory.
If you want WET to load all the files in the lib directory, then simply choose the second option - specify path as a directory rather than file name(s). In case of the latter, all files matching the value specified by the pattern parameter are loaded.
After you specify the libraries, you can then call classes and utilities defined in your libraries anywhere from your test scripts.