String.format("[[image:image.gif||width=%s]]", (20 + RandomUtils.nextInt(200))), getTestClassName());
// Attach the GIF image.
AttachmentsPane attachmentsPane = viewPage.openAttachmentsDocExtraPane();
attachmentsPane.setFileToUpload(getClass().getResource("/image.gif").getPath());
attachmentsPane.clickAttachFiles();
// clickAttachFiles should wait for the page to load but it doesn't..
viewPage.waitUntilPageIsLoaded();
// XWIKI-5896 shows that the file name becomes image.png
attachmentsPane = viewPage.openAttachmentsDocExtraPane();
Assert.assertTrue(attachmentsPane.attachmentExistsByFileName("image.gif"));