/**
  * Overview:
  * - This opens a message and then clicks the "Marcar como não lida" options
  *   of the message menu. After that, checks if the message was really marked
  *   as unread and then checks if the system shows the correct message if
  *   the user tries mark them as unread for a second time
  *
  * - CTV3-754
  *   http://comunidadeexpresso.serpro.gov.br/testlink/linkto.php?tprojectPrefix=CTV3&item=testcase&id=CTV3-754
  *
  */
 public function test_CTV3_754_MarkUnreadMail()
 {
     $mailPage = new MailPage($this);
     //load test data
     $MAIL_RECIPENT = $this->getGlobalValue('user.1.email');
     $MAIL_SUBJECT = $this->getTestValue('mail.subject');
     //testStart
     $mailPage->sendMail(array($MAIL_RECIPENT), $MAIL_SUBJECT, 'Marcando como não lido');
     $this->waitForAjaxAndAnimations();
     $mailPage->clickRefreshButton();
     $mailPage->waitForEmailToArrive($MAIL_SUBJECT);
     $mailPage->clickOnHeadlineBySubject($MAIL_SUBJECT);
     $widgetMessages = $mailPage->getWidgetMessages();
     $widgetMessages->getSingleMessageUnitInConversation();
     $mailPage->clickLayoutBackButton();
     $this->waitForAjaxAndAnimations();
     $headlinesEntry = $mailPage->getHeadlinesEntryBySubject($MAIL_SUBJECT);
     $headlinesEntry->toggleCheckbox();
     $mailPage->clickMenuOptionMarkUnread();
     $this->waitForAjaxAndAnimations();
     $headlinesEntry = $mailPage->getHeadlinesEntryBySubject($MAIL_SUBJECT);
     $this->assertEquals(HeadlinesEntry::UNREAD_STATUS, $headlinesEntry->getReadStatus(), 'The message was marked as "Unread", but it was not changed');
     $headlinesEntry->toggleCheckbox();
     $mailPage->clickMenuOptionMarkUnread();
     $this->assertAlertTextEquals('Nenhuma mensagem a ser marcada como não lida.', 'System did not show message indicating no message tobe marked as unread');
     $this->acceptAlert();
 }