From version 19.1
edited by Vincent Massol
on 2019/02/12 16:18
To version 20.1
edited by Vincent Massol
on 2019/02/21 15:20
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -210,6 +210,34 @@
210 210  }
211 211  {{/code}}
212 212  
213 +== Test Reference ==
214 +
215 +A lot of tests need to create a wiki page for testing. Example to do this:
216 +
217 +{{code language="java"}}
218 [email protected]
219 +public void showAndHideEditComments(TestUtils setup, TestReference reference) throws Exception
220 +{
221 + ViewPage vp = setup.gotoPage(reference);
222 +...
223 +{{/code}}
224 +
225 +More generic way (more verbose but can useful in some cases) using JUnit5's ##TestInfo## class:
226 +
227 +{{code language="java"}}
228 +public class MailIT
229 +{
230 + private String testClassName;
231 +
232 + @BeforeEach
233 + public void setUp(TestInfo info)
234 + {
235 + this.testClassName = info.getTestClass().get().getSimpleName();
236 + }
237 + ...
238 +}
239 +{{/code}}
240 +
213 213  = Test Resources =
214 214  
215 215  You might need test resources to be used in interaction with the wiki (e.g. to upload an attachment). Any test resources placed in ##src/test/resources## is made automatically available to the browser container by mounting the dedicated volume mapped to ##target/test-classes##. Then, in your test, you can use the dedicated method to get access to the files located in ##target/test-classes##.

Get Connected