This repository has been archived on 2025-02-03. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2025-02-03/src/bitmessagekivy/tests/test_sent_message.py

78 lines
3.5 KiB
Python
Raw Normal View History

from .telenium_process import TeleniumTestProcess
from .common import ordered
2021-04-08 14:09:05 +02:00
data = [
'BM-2cWmjntZ47WKEUtocrdvs19y5CivpKoi1h',
'BM-2cVpswZo8rWLXDVtZEUNcDQvnvHJ6TLRYr'
]
2021-03-06 00:14:43 +01:00
class SendMessage(TeleniumTestProcess):
"""Sent Screen Functionality Testing"""
@ordered
def test_send_message_and_validation(self):
"""
Sending Message From Inbox Screen
opens a pop-up(screen)which send message from sender to reciever
"""
2021-05-19 10:27:10 +02:00
print("=======Test - Sending Message From Inbox Screen with validation Checks=======")
2021-03-16 20:28:14 +01:00
self.cli.sleep(3)
2021-03-06 00:14:43 +01:00
# self.cli.execute('app.root.ids.nav_drawer.set_state("toggle")')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(2)
self.cli.click_on('//NavigationItem[1]')
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2)
self.cli.sleep(2)
self.cli.click_on('//Inbox/ComposerButton[0]/MDFloatingActionButton[0]')
self.assertExists("//Create[@name~=\"create\"]", timeout=2)
self.cli.sleep(3)
self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/MyMDTextField[0]')
self.cli.sleep(3)
self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/MyTextInput[0]')
self.cli.sleep(3)
2021-05-19 10:27:10 +02:00
self.cli.setattr(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/MyTextInput[0]', "text", "second add")
self.cli.sleep(3)
self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]')
self.cli.sleep(4)
self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/TextInput[0]')
self.cli.sleep(4)
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(3)
self.cli.click_on('//MDFlatButton[0]')
self.cli.sleep(5)
2021-05-19 10:27:10 +02:00
self.cli.click_on(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]')
self.cli.sleep(2)
self.cli.click_on('//MyTextInput[0]')
self.cli.sleep(3)
self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]')
self.cli.sleep(2)
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', 'heyyyyyy')
self.cli.sleep(3)
self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/TextInput[0]')
self.cli.sleep(4)
2021-05-19 10:27:10 +02:00
random_label = ""
for char in "how are you this is message body":
random_label += char
2021-05-19 10:27:10 +02:00
self.cli.setattr(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/TextInput[0]', 'text', random_label)
self.cli.sleep(0.2)
self.cli.sleep(3)
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(3)
self.cli.click_on('//MDFlatButton[0]')
self.cli.sleep(6)
2021-05-19 10:27:10 +02:00
self.cli.setattr(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/BoxLayout[0]/MyTextInput[0]', "text", data[0])
self.cli.sleep(3)
2021-03-16 20:28:14 +01:00
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(3)
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(3)
self.cli.click_on('//NavigationItem[2]')
self.cli.sleep(3)
total_sent_msgs = len(self.cli.select("//SwipeToDeleteItem"))
self.assertEqual(total_sent_msgs, 2)