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)
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))
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())
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)
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'')
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)
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)
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)
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())