@Feature(summary = "The user can contact a language team coordinator",
tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
@Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void translatorContactsLanguageTeamCoordinator() throws Exception {
LanguagesPage languagesPage = new LoginWorkFlow()
.signIn("translator", "translator")
.goToLanguages()
.selectLanguage("fr")
.clickContactCoordinatorsButton()
.enterSubject("contact test")
.enterMessage("I love Zanata")
.clickSend();
List<WiserMessage> messages = emailRule.getMessages();
assertThat(messages.size())
.isEqualTo(1)
.as("One email was sent");
WiserMessage wiserMessage = messages.get(0);
assertThat(wiserMessage.getEnvelopeReceiver())
.isEqualTo("admin@example.com")
.as("The email recipient is the administrator");
String content = HasEmailRule.getEmailContent(wiserMessage);
assertThat(content)
.contains("Dear Language Team Coordinator")
.as("The email is to the language team coordinator");
assertThat(languagesPage.getNotificationMessage())
.contains("Your message has been sent to the administrator")
.as("The user is informed the message was sent");
}