9 Projects
Projects provide a better overview, simplify navigation between test suites and expand the scope for search and replace operations. Also, QF-Test automatically manages dependencies resulting from includes or absolute references between test suites belonging to the same project (see "Referencing nodes in another test suite"). Many other features have already been implemented or are under development.
Technically a QF-Test project is a set of test suites located in one or more directories with a common root. There is a 1:1 relation between the project and its directory and the name of the directory automatically becomes the name of the project.
To create a new project, use the menu item »File«-»New Project...«. Then select the directory. QF-Test will create a file
named qftest.qpj in that directory to designate it as a project.
This file can also be used to define options and project-specific library paths
as described in "The file qftest.qpj".
9.1 Subprojects
A subproject is a subdirectory of a project which is itself a project. Test suites within a subproject also belong to all parent projects. The project of a test suite is the innermost subproject to which the suite belongs. Automatic dependency resolution always includes the entire outermost project of a test suite, including all subprojects.
9.2 Project View
The project view with one or more projects can be toggled on or off via the menu item »View«-»Show Projects«. The project tree displays the directory hierarchy of a project with its test suites, starting from the project root, possibly limited by the filter above the tree, which applies to test suite names. Double-clicking a test suite opens it, as does pressing the Return key. You can select several files or directories to be opened in one go, including all test suites located under the selected directories.
The hierarchy is refreshed automatically at intervals defined in the option Project refresh interval (s). You can refresh a directory including its complete hierarchy at any time by selecting it and pressing F5. For a more thorough rescan that does not rely on modification times but may take significantly longer for large projects, press Shift+F5 instead.
To switch keyboard focus between the test suite and the project view, press F6. To quickly navigate from the current test suite to its node in the project tree, press Shift+F6. If necessary, the project view and project tree will be opened automatically for this action.
9.3 The file qftest.qpj
The qftest.qpj file designates the root directory of a project.
All test suites under this directory automatically belong to the project,
except those excluded either by project-specific entries in "Section [exclude]" or via the global option Project files and directories to exclude.
For more information about project options, see "Project settings".
Normally, this file is empty. However, you can add entries in different sections, each beginning with a line like [SectionName]. Blank lines or lines beginning with "#" are ignored.
Note
The contents of the qftest.qpj file must be encoded in UTF-8.
9.3.1 Section [config]
This section contains settings for the project as Name=Value entries. Possible settings include:
- readgitignore
-
Determines whether files or directories defined in a
.gitignorefile should be excluded (for the format specification, please refer to the documentation for Git version control). Possible values are "true", "false", or a file name to be read instead of the.gitignorefile in the project directory.The default value is "false". Using a
.gitignorefile is recommended when combining a QF-Test project with a large project containing many files not relevant for QF-Test.
9.3.2 Section [librarypath]
In this section, you can specify library paths which apply only to this project.
Each line contains a path, either relative to the project's root directory or absolute.
For variable specifications, you can use ${env:...} or ${system:...}.
The respective values must be set at test execution, for example, ${env:myLibpath}
requires the environment variable myLibpath to be set,
${system:myLibpath} uses the Java system property myLibpath.
See also the example in "Example".
The library paths are searched sequentially if relative file names cannot be resolved relative to the calling suite. If nested projects exist, the library paths for the innermost project are searched first, followed by those of each outer project. If still not resolved, the files specified in the global library paths are searched (see Referencing nodes in another test suite).
9.3.3 Section [exclude]
Here you can explicitly specify files and directories to exclude from the project. Each line contains a path, either relative to the project's root directory or absolute.
9.3.4 Section [include]
Here you can explicitly re-include individual files or subdirectories located within a
directory excluded via the [exclude] section. Each line contains a path,
either relative to the project's root directory or absolute.
9.3.5 Example
[config]
gitignore = ../.gitignore # include .gitignore file from parent directory
[librarypath]
../myLibFolderOutsideTheProject # path relative to the project's root directory
C:/testing/myLibraries # absolute path
${env:myLibpath} # the environment variable 'myLibpath' contains the value
${system:myLibpath} # the system property 'myLibpath' contains the value
[exclude]
scratch # exclude directory
[include]
scratch/wichtig.qft # exception: include this file
Note Always use the '/' character as the directory separator – even on Windows. QF-Test will automatically use the correct separator at runtime for each system. This ensures your test suites remain portable across different systems.