use of org.xwiki.sharepage.test.po.ShareDialog in project xwiki-platform by xwiki.
the class SharePageTest method testShareByEmail.
@Test
public void testShareByEmail() throws Exception {
// Delete any existing test page
getUtil().deletePage(getTestClassName(), getTestMethodName());
ViewPage vp = getUtil().createPage(getTestClassName(), getTestMethodName(), "something", "title");
ShareableViewPage svp = new ShareableViewPage();
svp.clickShareByEmail();
ShareDialog sd = new ShareDialog();
sd.setEmailField("john@doe.com");
sd.setMessage("test");
ShareResultDialog srd = sd.sendMail();
assertEquals("The message has been sent to john.", srd.getResultMessage());
srd.clickBackLink();
// Verify we received the email and that its content is valid
this.mail.waitForIncomingEmail(10000L, 1);
MimeMessage mimeMessage = this.mail.getReceivedMessages()[0];
assertEquals("superadmin wants to share a document with you", mimeMessage.getSubject());
}
Aggregations