Update test to copy formatted text messages
Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
parent
a95520067f
commit
ae0504cbfa
|
@ -630,29 +630,34 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
|
||||||
|
|
||||||
home.join_public_chat(''.join(random.choice(string.ascii_lowercase) for _ in range(7)))
|
home.join_public_chat(''.join(random.choice(string.ascii_lowercase) for _ in range(7)))
|
||||||
chat = sign_in.get_chat_view()
|
chat = sign_in.get_chat_view()
|
||||||
message_text = 'mmmeowesage_text'
|
message_text = {'text_message': 'mmmeowesage_text'}
|
||||||
|
formatted_message = {'message_with_link':'https://status.im',
|
||||||
|
'message_with_tag': '#successishere'}
|
||||||
message_input = chat.chat_message_input
|
message_input = chat.chat_message_input
|
||||||
message_input.send_keys(message_text)
|
message_input.send_keys(message_text['text_message'])
|
||||||
chat.send_message_button.click()
|
chat.send_message_button.click()
|
||||||
|
|
||||||
chat.element_by_text_part(message_text).long_press_element()
|
chat.copy_message_text(message_text['text_message'])
|
||||||
chat.element_by_text('Copy').click()
|
|
||||||
|
|
||||||
message_input.paste_text_from_clipboard()
|
message_input.paste_text_from_clipboard()
|
||||||
if message_input.text != message_text:
|
if message_input.text != message_text['text_message']:
|
||||||
self.errors.append('Message text was not copied in a public chat')
|
self.errors.append('Message %s text was not copied in a public chat' % message_text['text_message'])
|
||||||
|
message_input.clear()
|
||||||
|
|
||||||
chat.get_back_to_home_view()
|
#TODO: uncomment after #11168 and 11161 is fixed
|
||||||
home.add_contact(transaction_senders['M']['public_key'])
|
#for message in formatted_message:
|
||||||
message_input.send_keys(message_text)
|
# message_input.send_keys(formatted_message[message])
|
||||||
chat.send_message_button.click()
|
# chat.send_message_button.click()
|
||||||
|
|
||||||
chat.chat_element_by_text(message_text).long_press_element()
|
# message_bubble = chat.chat_element_by_text(formatted_message[message])
|
||||||
chat.element_by_text('Copy').click()
|
# message_bubble.timestamp_message.long_press_element()
|
||||||
|
# chat.element_by_text('Copy').click()
|
||||||
|
|
||||||
|
# message_input.paste_text_from_clipboard()
|
||||||
|
# if message_input.text != formatted_message[message]:
|
||||||
|
# self.errors.append('Message %s text was not copied in a public chat' % formatted_message[message])
|
||||||
|
# message_input.clear()
|
||||||
|
|
||||||
message_input.paste_text_from_clipboard()
|
|
||||||
if message_input.text != message_text:
|
|
||||||
self.errors.append('Message text was not copied in 1-1 chat')
|
|
||||||
self.errors.verify_no_errors()
|
self.errors.verify_no_errors()
|
||||||
|
|
||||||
@marks.testrail_id(5322)
|
@marks.testrail_id(5322)
|
||||||
|
|
|
@ -427,8 +427,8 @@ class ChatElementByText(BaseText):
|
||||||
class TimeStampText(BaseText):
|
class TimeStampText(BaseText):
|
||||||
def __init__(self, driver, parent_locator: str):
|
def __init__(self, driver, parent_locator: str):
|
||||||
super(TimeStampText, self).__init__(driver)
|
super(TimeStampText, self).__init__(driver)
|
||||||
text = "//*[1]/*[1]/*[6]"
|
suffix = "//android.widget.TextView)[last()]"
|
||||||
self.locator = self.Locator.xpath_selector(parent_locator + text)
|
self.locator = self.Locator.xpath_selector("(" + parent_locator + suffix)
|
||||||
|
|
||||||
return TimeStampText(self.driver, self.locator.value)
|
return TimeStampText(self.driver, self.locator.value)
|
||||||
|
|
||||||
|
@ -898,6 +898,10 @@ class ChatView(BaseView):
|
||||||
self.chat_message_input.send_keys(message)
|
self.chat_message_input.send_keys(message)
|
||||||
self.send_message_button.click()
|
self.send_message_button.click()
|
||||||
|
|
||||||
|
def copy_message_text(self, message_text):
|
||||||
|
self.element_by_text_part(message_text).long_press_element()
|
||||||
|
self.element_by_text('Copy').click()
|
||||||
|
|
||||||
def quote_message(self, message = str):
|
def quote_message(self, message = str):
|
||||||
self.element_by_text_part(message).long_press_element()
|
self.element_by_text_part(message).long_press_element()
|
||||||
self.reply_message_button.click()
|
self.reply_message_button.click()
|
||||||
|
|
Loading…
Reference in New Issue