From version 1.1
edited by Vincent Massol
on 2018/11/25 16:20
To version 2.1
edited by Vincent Massol
on 2018/11/25 16:23
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,8 +1,19 @@
1 -This is currently the official way to write UI functional tests.
1 +{{box cssClass="floatinginfobox" title="**Contents**"}}
2 +{{toc/}}
3 +{{/box}}
2 2  
5 += Usage =
6 +
3 3  * Based on [[TestContainers>>https://www.testcontainers.org/]] and uses Docker to execute the tests under various Databases, Servlet Engines and Browsers.
4 4  * The only requirements for running these tests is to have Docker installed locally and to have the user under which you run your IDE and the Maven build be able to use the docker executable.
5 -* Configurations options:(((
9 +* Tests get injected ##XWikiWebDriver## and ##TestUtils## instances as test method parameters.
10 +* Test results is recording in a FLV file in the ##target## directory.
11 +* A screenshot of the UI when the test is failing is also taken in the ##target## directory.
12 +* When test execute it's possible to connect to the running VNC server and see the UI by using a VNC client and connect to the VNC URL printed in the console, e.g. ##vnc:~/~/vnc:[email protected]:32936##.
13 +* The version for the platform dependencies is specified using the ##platform.version## property in the ##pom.xml## file executing the tests.
14 +
15 += Configurations options =
16 +
6 6  {{info}}
7 7  Note:
8 8  * When passing the options as system properties, the format is ##-Dxwiki.test.ui.<Option Name>=value##
... ... @@ -48,20 +48,9 @@
48 48  )))|When active a VNC container is started to record a video of the tests and more generally to allow connecting to the UI running the tests. Useful when debugging.
49 49  |##properties##|No default (empty)|Check the ##*.vm## files for the configuration files to see the list of possible values.|(% style="word-break: break-all;" %) Velocity properties that are applied when generating XWiki's configuration files: ##xwiki.cfg##, ##xwiki.properties## and ##hibernate.cfg.xml##. Example: Tell XWiki that minification is off: ##-Dxwiki.test.ui.properties.xwikiPropertiesAdditionalProperties=debug.minify=false## or ##@UITest(properties = { "xwikiPropertiesAdditionalProperties=debug.minify=false" })##.
50 50  )))
51 -)))
52 -* Tests get injected ##XWikiWebDriver## and ##TestUtils## instances as test method parameters.
53 -* Test results is recording in a FLV file in the ##target## directory.
54 -* A screenshot of the UI when the test is failing is also taken in the ##target## directory.
55 -* When test execute it's possible to connect to the running VNC server and see the UI by using a VNC client and connect to the VNC URL printed in the console, e.g. ##vnc:~/~/vnc:[email protected]:32936##.
56 -* The version for the platform dependencies is specified using the ##platform.version## property in the ##pom.xml## file executing the tests.
57 57  
58 -General implementation architecture:
63 += Example =
59 59  
60 -{{image reference="testcontainers-xwiki.png"/}}
61 -//See [[Vincent's blog>>https://massol.myxwiki.org/xwiki/bin/view/Blog/EnvironmentTestingExperimentations#HExperimentation5:inJavaTestsusingTestContainers]] for more details//
62 -
63 -Example:
64 -
65 65  {{code language="java"}}
66 66  @UITest
67 67  public class SeleniumTest
... ... @@ -76,3 +76,8 @@
76 76   }
77 77  }
78 78  {{/code}}
79 +
80 += Architecture =
81 +
82 +{{image reference="testcontainers-xwiki.png"/}}
83 +//See [[Vincent's blog>>https://massol.myxwiki.org/xwiki/bin/view/Blog/EnvironmentTestingExperimentations#HExperimentation5:inJavaTestsusingTestContainers]] for more details//

Get Connected