-
Notifications
You must be signed in to change notification settings - Fork 26
Automated conformance tests
Conformance test quality in toolkit release can be improved by testing the actual release downloadable before the release. Automating these tests will make it easier and more convenient to test the status of the embedded conformance tests that are bundled with a Toolkit release, which is packaged as a WAR file.
The webui-tests module, part of the toolkit build and optionally run using the WebUI-Tests maven profile, has automated this approach using a combination of HtmlUnit, Jetty, and Spock tests. HtmlUnit is "a GUI-Less browser for Java programs", so that interactions between Toolkit and the browser are simulated through the API. A WAR file is required to load it into a Servlet container that supports war file deployment. Jetty is used to deploy the WAR file that is packaged by the xdstools2 module. Spock specification tests are used program the interations to launch all conformance tests for a given actor.
Each actor webUI conformance test class extends from ConformanceActor. This abstract class calls three methods, overridden in the subclass, in its construtor: composeToolkitBaseUrl() setupSpi() setupSim()
-
composeToolkitBaseUrl composes the toolkit Url with the port number to send SPI commands to.
-
setupSpi creates a new instance of the SimulatorBuilder class.
-
setupSim deletes any old simulator actor with the same name and creates a new simulator actor that will be used for the conformance actor tests.
-
When the constructor finished the setup, all actor specific tests will be run in a sequantial order starting with the base class first.
(It is required because the UI steps need to be executed in a particular order just as a user would navigate through the application.)
5 a. The Simulators page will be checked to see if the name of the newly created sim exists in the page.
5 b. The conformance page will be opened to select the newly created sim in the Test Context box.
Class annotations
The test method ordering is managed throught the @Stepwise class level annotation. The @Timeout(120) annotation limits the entire execution of this test to 5 minutes.
For example the repository actor has
- def 'Get repository conformance actor page.' This method will retrive the conformance actor web page using the conformance GWT place URL method.
- def 'No weird popup or error message presented in a dialog box.' This method looks for any unexcepted alert type popup messages using the HTML element class name.
- def 'Check Conformance page loading status and its title.' This method looks for the Initializing and the Loading messages that are displayed while loading the conformance actor page.
- def 'Click Reset (or Initialize) Environment using defaults.' This method clicks the Reset checkbox in the orchestrated test environment (OTE) panel.
- def 'Click Initialize.' This method clicks the Initialize button in the OTE panel.
- def 'Update register endpoint using the supporting sim.' According to the Repository OTE instructions, the SUT must to configured to use the registry from the OTE and then click Reset again.
- def 'Get (again) repository conformance actor page.' This method reloads the page again to have a fresh start.
- def 'Click Reset Environment (again) using defaults after updating the Register endpoint.' According to the orchestration environment instructions, this method resets the environment.
- def 'Find and Click the RunAll Test Registry Conformance Actor image button.' This method will run all conformance tests for the SUT.
- def 'Number of failed tests count should be zero.' This method looks for the failed test count cell by the 'testFail' CSS class in the HTML test summary table.
Since all of the automated tests are run behind the scenes, viewing the log output is critical to troubleshooting.
The log output of the server startup and the spock tests are saved off to the disk in the webui-tests module's target folder. For example, on a Windows machine, it would look like this: C:\tk\webui-tests\target\2017_07_03.stderrout.log.
See webui-tests\src\test\etc\jetty-logging.xml
and
The jetty-maven-plugin bound to the pre-integration-test
and post-integration-test
phases of the maven build lifecycle in the webui-tests maven module POM file.
Toolkit
Downloads
Installing Toolkit
Configuring Toolkit for Imaging Tests
Reporting Toolkit Installation Problems
Environment
Test Session
Conformance Test Tool
Writing Conformance Tests
Overview of Imaging Tests
Test Context Definition
Launching Conformance Tool from Gazelle
Inspector
External Cache
Support Tools
Test Organization
Configuring Test Kits
Managing Multiple Test Kits
SAML Validation against Gazelle
Renaming Toolkit
Toolkit API
Managing system configurations
Configuring Toolkit for Connectathon
Developer's blog