Example #1
0
 def test_go_to_the_friend_page(self):
     message_form = MessageForm(self.driver)
     message_form_friend_name = message_form.friend_name()
     message_form.go_to_friend_page()
     user_form = UserForm(self.driver)
     friend_name = user_form.user_name()
     self.assertEqual(message_form_friend_name, friend_name)
Example #2
0
 def test_check_time(self):
     message_form = MessageForm(self.driver)
     message_form.set_message_text(self.MESSAGE_TEXT)
     message_form.message_send()
     last_message_time = message_form.get_last_message_time()
     self.assertEqual(datetime.strftime(datetime.now(), '%H:%M:%S'),
                      str(last_message_time))
Example #3
0
 def test_open_close_img_window(self):
     message_form = MessageForm(self.driver)
     message_form.open_img_window()
     self.assertTrue(message_form.display_img_window())
     message_form.close_img_window()
     self.assertFalse(message_form.display_img_window())
Example #4
0
 def test_go_to_the_dialogues(self):
     message_form = MessageForm(self.driver)
     message_form_url = self.driver.current_url
     message_form.back_to_dialogs()
     dialogs_url = self.driver.current_url
     self.assertNotEqual(message_form_url, dialogs_url)
Example #5
0
 def test_send_empty_message(self):
     message_form = MessageForm(self.driver)
     message_form.set_message_text(self.EMPTY_MESSAGE_TEXT)
     message_form.message_send()
     messagebox_text = message_form.get_textarea_value()
     self.assertNotEqual(messagebox_text, u'')
Example #6
0
 def test_send_message(self):
     message_form = MessageForm(self.driver)
     message_form.set_message_text(self.MESSAGE_TEXT)
     message_form.message_send()
     last_message_text = message_form.get_last_message_text()
     self.assertEqual(self.MESSAGE_TEXT, last_message_text)
Example #7
0
 def test_download_big_or_not_img(self):
     message_form = MessageForm(self.driver)
     message_form.open_img_window()
     message_form.choose_img_button()
     message_form.choose_img(self.BIG_IMG_PATH)
     message_form.download_img()
     error_message = message_form.get_error_message()
     self.assertEqual(error_message, self.ERROR_SIZE)
     self.driver.refresh()
     message_form.open_img_window()
     message_form.choose_img_button()
     message_form.choose_img(self.NOT_IMG_PATH)
     message_form.download_img()
     error_message = message_form.get_error_message()
     self.assertEqual(error_message, self.ERROR_TYPE)
Example #8
0
 def test_download_unselected_img(self):
     message_form = MessageForm(self.driver)
     message_form.open_img_window()
     message_form.download_img()
     error_message = message_form.get_error_message()
     self.assertEqual(error_message, self.ERROR_TYPE)
Example #9
0
 def test_cancel_add_img(self):
     message_form = MessageForm(self.driver)
     message_form.open_img_window()
     message_form.cancel_add_img()
     self.assertFalse(message_form.display_img_window())