public function test_CTV3_987_Schedules_Views_Week()
 {
     $SENDER_LOGIN = $this->getGlobalValue('user.1.login');
     $SENDER_PASSWORD = $this->getGlobalValue('user.1.password');
     $loginPage = new LoginPage($this);
     $loginPage->doLogin($SENDER_LOGIN, $SENDER_PASSWORD);
     $mailPage = new MailPage($this);
     $mailPage->clickCalendar();
     $calendar = new CalendarPage($this);
     $calendar->clickViewWeek();
     $this->waitForAjaxAndAnimations();
     $this->assertContains(DateUtils::getNumericDayMonth(), $calendar->getDayWeekToday(), "The today does not match in day and month of Calendar of week");
     $this->assertContains(DateUtils::getShortDayOfWeek(), $calendar->getDayWeekToday(), "The today does not match in today's day of Calendar of week");
     //Verify if has the format date in layout title
     $this->assertTrue(preg_match_all("/\\A\\d{1,2}( [a-z]{3})? - \\d{1,2} [a-z]{3,}, \\d{4}\\z/", $calendar->getMonthAndYearInLayoutTitle(), $matches) == 1, "No match date of week in layout title  on Calendar of week");
     $calendar->clickLastWeekButton();
     $this->assertTrue(preg_match_all("/\\A\\d{1,2}( [a-z]{3})? - \\d{1,2} [a-z]{3,}, \\d{4}\\z/", $calendar->getMonthAndYearInLayoutTitle(), $matches) == 1, "No match date of last week in layout title on Calendar of week");
     $calendar->clickNextWeekButton();
     $calendar->clickNextWeekButton();
     $this->assertTrue(preg_match_all("/\\A\\d{1,2}( [a-z]{3})? - \\d{1,2} [a-z]{3,}, \\d{4}\\z/", $calendar->getMonthAndYearInLayoutTitle(), $matches) == 1, "No match date of Next week in layout title  on Calendar of week");
 }
 /**
  * Checks the reply e-mail feature. In this test, user 1 sends an e-mail
  * to new user and this recipient is saved in the personal catalog
  *
  * CTV3-1015
  * http://comunidadeexpresso.serpro.gov.br/testlink/linkto.php?tprojectPrefix=CTV3&item=testcase&id=CTV3-1015
  */
 public function test_CTV3_1015_Send_Mail_Saved_Recipient()
 {
     //load test data
     $SENDER_LOGIN = $this->getGlobalValue('user.1.login');
     $SENDER_PASSWORD = $this->getGlobalValue('user.1.password');
     $RECIPIENT_MAIL = $this->getTestValue('recipient.mail');
     $RECIPIENT_NAME = $this->getTestValue('recipient.name');
     $MAIL_SUBJECT = $this->getTestValue('mail.subject');
     $MAIL_CONTENT = $this->getTestValue('mail.content');
     //testStart
     $loginPage = new LoginPage($this);
     $loginPage->doLogin($SENDER_LOGIN, $SENDER_PASSWORD);
     $mailPage = new MailPage($this);
     $mailPage->sendMail(array($RECIPIENT_MAIL), $MAIL_SUBJECT, $MAIL_CONTENT);
     $mailPage->clickAddressbook();
     $addressbookPage = new AddressbookPage($this);
     $addressbookPage->clickPersonalCatalog();
     $this->waitForAjaxAndAnimations();
     $contactListItem = $addressbookPage->getCatalogEntryByName($RECIPIENT_NAME);
     $this->assertEquals($RECIPIENT_NAME, $contactListItem->getNameFromContact(), 'Mail was send but, the new recipient is not created in personal catalog ');
 }
 /**
  * Checks a login attempt where only the user login is typed,
  * but not the password
  *
  * CTV3-954
  * http://comunidadeexpresso.serpro.gov.br/testlink/linkto.php?tprojectPrefix=CTV3&item=testcase&id=CTV3-954
  *
  * - valid.user: a valid user login
  */
 public function test_CTV3_954_NoPassword()
 {
     $loginPage = new LoginPage($this);
     //load test data
     $VALID_USER = $this->getGlobalValue('user.1.login');
     $loginPage->typeUser($VALID_USER);
     $loginPage->clickLogin();
     $this->assertAlertTextEquals("Por favor, digite sua senha.", 'Problems with password not informed message');
     $this->dismissAlert();
 }
 /**
  * Performs a login operation. This is just a shortcut to avoid having to add
  * LoginPage in tests in which it is not really necessary
  */
 public function doLogin($user, $password)
 {
     $loginPage = new LoginPage($this);
     $loginPage->doLogin($user, $password);
 }
 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");
 }