A test case can be considered a single test. Just as it is a good idea to keep tests simple, it is a recommended to keep test cases simple. A test case contains sessions or SessionTag which represent applications that then contain functional points or FunctionTag which represent functional areas in the application or session.
Out of the three classes listed above, TestCaseTag is the only class that is NOT abstract. TestCaseTag should be generic enough to work with any type of application. The relationship of the three main components is best described as a parent-child relationship with TestCaseTag being the grandparent. Please see the TestCaseTag's javadoc comments to fully understand its purpose.
Currently, TestCaseTag is represented as <testcase> in the macro language. <testcase> has the following properties that can be set as attributes. The jameleon.conf file mentioned below is simply a key=value file that must be in the classpath to be used. The values in this file override all values set in the test-case tag if they are supported:
|Property Name:||Description||Required||In jameleon.conf|
|breakPoint||Used to help debug the script. This attribute is currently recognized by the GUI and it is only usable if the useCSV attribute is set to true. By pressing the debug button while the script is selected, the script will be stepped through for each execution of the test case tag according the CSV file the script is mapped to. The values from the CSV file can then be changed on the fly.||No - Deafaults to "false"||No|
|useCSV||Set this to "true" if the test case is to use a data file (CSV). The location and name of the CSV file depends on the "name", "testEnvironment", and "organization" settings of the test case. In the case where this is not set or set to "false", the values of the test case for each function point must be set as attributes of the function point elements||No - Defaults to "false"||Yes|
|csvCharset||If testing in another language other than UTF-8 (the default), then this can be set at test-case tag level.||No - Defaults to "UTF-8"||Yes|
|csvDir||Sets the directory of which csv files will be searched for. This is based on the baseDir setting.||No - Defaults to "etc"||Yes|
|csvFileName||Can be set in the test-case tag or csv tag. This tells Jameleon not to be smart about finding the CSV file. It does however, using the baseDir and csvDir attributes to begin the csvFileName with. The path should be included in the name. When this is set, the name attribute is ignored when finding the CSV file.||No||No|
|failOnCSVFileNotFound||If set to false, then a test case won't be shown in the results if the corresponding CSV file isn't found.||No - Defaults to true||Yes|
The name of the test case. It is recommended that this name be unique. If useCSV="true", then the test case will look for a file named the name of the test case. For example, if the name is set to "ExampleTestCase", then the test case will look for a file named "ExampleTestCase.csv" in the appropriate directory.
If the name attribute is not set in the test-case tag, then the name will be the name of the file minus the file extension. For example, if the script name is testMe.jml, then the name of the test case will become testMe and if useCsv is enabled, then it will look for a file named testMe.csv.
|testEnvironment||The name of the environment the test case is to be executed against. Some examples of testEnvironment are: prod, beta, dev, and localhost. Please read the documentation on testEnvironment-Applications.properties for more information on using this file to set variables. The testEnvironment value is also used to find the location of the data file if one is used. This is explained more here||No - As of version 1.8, this is no longer required.||Yes|
|organization||The name of the organization the test case is to be executed against. This is used only when the same application is "deployed" or installed to different places with either different look and feels or business rules or both. In this case, the same test case should be valid against the different installs or deployments. The value of organization also influences the location of the data file. If the organization is set, the test case will look for a CSV file in the etc/testEnvironment/organization directory. For example, when a test case with name set to "ExampleTestCase", testEnvironment set to "stg", and organization set to "ACME" is executed, it will look for a file "etc/stg/ACME/ExampleTestCase.csv.||No||Yes|
|assertLevel||The level of asserts which will be executed in the functional points. This is set to one level. Please see AssertLevel for more information on this.||No - Defaults to all levels||Yes|
|assertLevels||A comma separated list of assertLevels which will be executed in the functional points. Please see AssertLevel for more information on this.||No - Defaults to all levels||Yes|
|assertLessThanLevel||The level of asserts which must be less than OR equal to in order to be executed in the functional points. This is set to one level. Please see AssertLevel for more information on this||No - Defaults to all levels||Yes|
|assertGreaterThanLevel||The level of asserts which must be greater than OR equal to in order to be executed in the functional points. This is set to one level. Please see AssertLevel for more information on this||No - Defaults to all levels||Yes|
|storeStateEvent||Sets the event which must occur in order for the application's state to be recorded. Please see setStoreStateEvent() for more information on valid values.||No - Defaults to storeStateOnError.||Yes|
|storeStateNever||The applications state will never be recorded.||No - Defaults to false.||No|
|storeStateOnChange||The applications state will be recorded on any state change.||No - Defaults to false.||No|
|storeStateOnError||The applications state will be recorded on any error state.||No - Defaults to true.||No|
|trace||Print out all functionId's of each test case to the std out log. This is very helpful for debugging which functional point is getting executed and when.||No - Defaults to false.||Yes|
|genTestCaseDocs||Generates the test case documentation and creates links on the TestResults.html page for each test case name. It is assumed that each test case have a unique name. If not then all test cases with the same name will be linked to the last test case with that name generated.. the generated docs.||No - Defaults to true.||Yes|
|executeTestCase||Tells Jameleon to execute or not execute the test case or test cases.||No - Defaults to true which means to execute the test cases.||Yes|
|baseDir||Tells Jameleon where the project being executed is located.||No - Defaults to .||Yes - It is recommended that it be via the jameleon.conf file|
|resultsDir||Tells Jameleon where to put the recorded states of the applications changes.||No - Defaults to jameleon_test_results||Yes - It is recommended that it be via the jameleon.conf file|
|bugTrackerUrl||When the test case docs are being generated, and if there is a bug for that particular test case, then a link will be generated for that bug. Due to the nature of HTTP, the order of the parameters don't matter, so it should be enough to make the bugId parameter the last one. This has been tested against Bugzilla and the Sourceforge tracking site. For example, to use this against the Jameleon SourceForge project, http://sourceforge.net/tracker/index.php?func=detail&group_id=84246&atid=572239&aid= would be used. The aid is the bug id.||No||Yes - It is recommend to set this via the jameleon.conf file unless several bug tracking tools are used.|
|genTestCaseDocsEncoding||Tells Jameleon what encoding type to use when generating the docs.||No - Defaults to UTF-8||Yes|
|maxExecutionTime||The maximum amount of time the test case can run before failing. Anything about zero means to validate the execution time.||No - Defaults to 0||No|
|failOnCSVFileNotFound||If set to false, and an error due to the CSV file not being found happens, then the test case will not get logged. This is useful when trying to make test cases run against another organization or environment and you want to run the entire suite of tests that have the appropriate CSV files, but ignore the ones you haven't had time to port over yet.||No - Defaults to true||Yes|
|propsName||To set variables that can be shared across the entire test case, set this value to the name of the properties file minus the .properties extension. The same properties file will be read in regardless of the testEnvironment setting.||No||No|
|enableSslCertCheck||This is an HTTP Specific tag, but for now to make things a bit easier, this is going here. Basically, if testing against a site with an invalid (expired, wrong host), this can be set to false and the key won't be validated.||No - Defaults to true||Yes|