Coherent GT provides a webdriver for performing tests on the UI of your application.
To use the Test Driver with your application the
TestDriverPort of the
SystemSettings structure should be set to a port number where the Test Driver can connect. In the sample applications this is facilitated via a "--webdriver=" command line argument.
A system listener can be set using the application's
SetSystemListener method. If the listener implements
CreateView it should return the view that the test driver will listen for events on and use for tests, otherwise a new view will be created. Once the test is completed the listener's
TestRunDone method is called which can be used to close the application for example. Here is how they are implemented in our samples:
Tests can be run using the Selenium WebDriver API. It is important to initialize PhantomJS with the path to the executable you wish to test and a port number and to also set the appropriate working directory. The names of the test methods should begin with test. The following Python example demonstartes a test that checks that the loaded page contains 'Document' in its title: