/**
  * Overview:
  *
  * - This teste checks if the message has the search criteria in the folder.
  *
  * - CTV3-893
  *   http://comunidadeexpresso.serpro.gov.br/testlink/linkto.php?tprojectPrefix=CTV3&item=testcase&id=CTV3-893
  */
 public function test_CTV3_893_Find_Search_Text()
 {
     $mailPage = new MailPage($this);
     //load test data
     $MAIL_RECIPENT = $this->getGlobalValue('user.1.email');
     $MAIL1_SUBJECT = $this->getTestValue('mail1.subject');
     $MAIL1_CONTENT = $this->getTestValue('mail1.content');
     $MAIL2_SUBJECT = $this->getTestValue('mail2.subject');
     $MAIL2_CONTENT = $this->getTestValue('mail2.content');
     $MAIL3_SUBJECT = $this->getTestValue('mail3.subject');
     $MAIL3_CONTENT = $this->getTestValue('mail3.content');
     $COMMON_TEXT_FRAGMENT = $this->getTestValue('common.text.fragment');
     $INEXISTENT_TEXT_FRAGMENT = $this->getTestValue('inexistent.text.fragment');
     //testStart
     $mailPage->sendMail(array($MAIL_RECIPENT), $MAIL1_SUBJECT, $MAIL1_CONTENT);
     $this->waitForAjaxAndAnimations();
     $mailPage->sendMail(array($MAIL_RECIPENT), $MAIL2_SUBJECT, $MAIL2_CONTENT);
     $this->waitForAjaxAndAnimations();
     $mailPage->sendMail(array($MAIL_RECIPENT), $MAIL2_SUBJECT, $MAIL2_CONTENT);
     $this->waitForAjaxAndAnimations();
     $mailPage->sendMail(array($MAIL_RECIPENT), $MAIL3_SUBJECT, $MAIL3_CONTENT);
     $this->waitForAjaxAndAnimations();
     $mailPage->waitForEmailToArrive($MAIL1_SUBJECT);
     $mailPage->waitForEmailToArrive($MAIL2_SUBJECT);
     $mailPage->waitForEmailToArrive($MAIL3_SUBJECT);
     $mailPage->typeSearchText($COMMON_TEXT_FRAGMENT);
     $mailPage->clickSearchButton();
     $this->waitForAjaxAndAnimations();
     $messages = $mailPage->getArrayOfHeadlinesEntries();
     $this->assertEquals(3, count($messages), 'There are diferent number of messages after find criteria applied');
     $mailPage->clearSearchField();
     $mailPage->clickSearchButton();
     $this->waitForAjaxAndAnimations();
     $mailPage->typeSearchText($INEXISTENT_TEXT_FRAGMENT);
     $mailPage->clickSearchButton();
     $this->waitForAjaxAndAnimations();
     $messages = $mailPage->getArrayOfHeadlinesEntries();
     $this->assertEquals(0, count($messages), 'The total of messages differs from zero after find criteria applied');
 }
 public function test_Ctv3_1027_Check_Edit_Personal_Contact()
 {
     $USER_LOGIN = $this->getGlobalValue('user.1.login');
     $USER_PASSWORD = $this->getGlobalValue('user.1.password');
     $CONTACT_1_EMAIL = $this->getTestValue('contact.1.mail');
     $CONTACT_1_NAME = $this->getTestValue('contact.1.name');
     $FIELD_COMPANY = $this->getTestValue('field.company');
     $MAIL_SUBJECT = $this->getTestValue('mail.subject');
     $MAIL_CONTENT = $this->getTestValue('mail.content');
     //testStart
     $loginPage = new LoginPage($this);
     $loginPage->doLogin($USER_LOGIN, $USER_PASSWORD);
     //Sending an e-mail to generate the personal contact to be used in the test
     $mailPage = new MailPage($this);
     $mailPage->sendMail(array($CONTACT_1_EMAIL), $MAIL_SUBJECT, $MAIL_CONTENT);
     $mailPage->clickAddressbook();
     $addressbookPage = new AddressbookPage($this);
     $addressbookPage->clickPersonalCatalog();
     $this->waitForAjaxAndAnimations();
     $mailPage->clearSearchField();
     $mailPage->typeSearchText($CONTACT_1_NAME);
     $mailPage->clickSearchButton();
     $this->waitForAjaxAndAnimations();
     $contactListItem = $addressbookPage->getCatalogEntryByName($CONTACT_1_NAME);
     $contactListItem->click();
     $this->waitForAjaxAndAnimations();
     $widgetContactDetails = $addressbookPage->getWidgetContactDetails();
     // Checking other fields will only be possible when the system allows personal contact edition
     $this->assertEquals('true', $widgetContactDetails->isReadonlyField($FIELD_COMPANY), "The field '{$FIELD_COMPANY}' is not readonly");
 }