Build and use the menu checker (deprecated)

The purpose of this page is to explain how to run the menu checker. It also contains information about how to create a standalone version, and how to configure it.

Sources

SVN link : https://scm.gforge.inria.fr/svn/gazelle/Maven/gazelle-gui-testing/topmenu/trunk

GForge link : https://gforge.inria.fr/scm/viewvc.php/Maven/gazelle-gui-testing/topmenu/?root=gazelle

Configuration

config.properties

This (internal) file contains several configuration properties and also some xpath.

base.url=http://ovh3.ihe-europe.net:8080/gazelle/ Url of the gazelle to test
base.page.url=home.seam Filename of the home page
admin.login=sballuais Username of an admin account, for mode switching
admin.password=azerty Password of this admin account
gazelle.version.url=rest/version Relative url of the version xml (rest)
administration.preference.url=administration/preferences.seam Relative url of the preference page (administration)
crowdin.default.language=en Default language
war.base.path=/home/sbs/workspace/Gazelle/gazelle-tm-war/ Local absolute path of a version-equivalent Gazelle
headless=false If true, tries to run with an xvfb session
run.span.check=true Turns on or off the check of span (inner text). It is possible to turn if off because it can be slow (it waits for a timeout at each check)
logfile.url=log/ Relative url that will be used to store log
firefox.download.directory=log/download/ Relative url that will be used to store downloads
login.attempts.max=10 The tool tries to log-in several times before giving up. This is this amout of time.
language.change.attempt.max=10 The tool tries several times to change the language before giving up. This is this amount of time
slash.replacement.in.filename=__ The character used to replace the slash when taking a screenshot or saving an error.seam page. If the page where an error is detected is /foo/bar.seam and this properties is "__", the filename of the screenshot will be "foo__bar.seam.png"

errorPages.xml

This file can be used to override the errors that are defined in the class ErrorPages. Is the program find this file in its root, it will use it instead of the class ErrorPages. If not it will use the default values of ErrorPages.

Its functionning is pretty simple. There a three groups of error : pageName, pageTitles and pageSpans. The first one defines what page file-name are considered as errorneous (exactly), the second what title are considered erroneous (exactly) and the third is the list of text samples that make a page erroneous : if a page contains at least one occurence of this test, it is considered as erroneous.

LoginProfiles.xml

Contains all profiles that are used in the test. Note that all profiles must be valid and created in Gazelle.

Use with maven test

Use the command 'mvn test' when you are in the project root. This is how the project should be run by jenkins.

Build a jar

It is possible to build a fat jar (~80MB) that can be run anywhere. To do this, place yourself in the project root with a terminal. use the command 'mvn clean compile assembly:single'. The jar is created in the /target folder. It is advised to add configuration files next to it to allow it to run properly. Those are :

  • config.properties : works the same way as when inside the jar. Overrides the internal config.properties.
  • errorPages.xml : see above

Usage of the jar

To run the tool, just use the command 'java -jar the-jar-name.jar'. Logs and screenshots are created in the /log folder, where the jar is located.