put asset function on telenium test cases

This commit is contained in:
cis 2021-07-01 21:57:38 +05:30
parent baf423e116
commit 5809689355
No known key found for this signature in database
GPG Key ID: 11DC6F36E8B65B24
19 changed files with 362 additions and 61 deletions

View File

@ -251,10 +251,6 @@ class NavigateApp(MDApp):
kivyuisignaler.release()
super(NavigateApp, self).run()
@staticmethod
def clickNavDrawer():
state.kivyapp.root.ids.nav_drawer.set_state('toggle')
@staticmethod
def showmeaddresses(name="text"):
"""Show the addresses in spinner to make as dropdown"""

View File

@ -0,0 +1,59 @@
[bitmessagesettings]
settingsversion = 0
port = 8444
timeformat = %%c
blackwhitelist = black
startonlogon = false
minimizetotray = false
showtraynotifications = true
startintray = false
socksproxytype = none
sockshostname = localhost
socksport = 9050
socksauthentication = false
socksusername =
sockspassword =
keysencrypted = false
messagesencrypted = false
defaultnoncetrialsperbyte = 1000
defaultpayloadlengthextrabytes = 1000
minimizeonclose = false
replybelow = False
maxdownloadrate = 0
maxuploadrate = 0
stopresendingafterxdays =
stopresendingafterxmonths =
sockslisten = false
userlocale = system
sendoutgoingconnections = True
useidenticons = True
identiconsuffix = qcqQGW6sQtZK
maxacceptablenoncetrialsperbyte = 20000000000
maxacceptablepayloadlengthextrabytes = 20000000000
onionhostname =
onionport = 8444
onionbindip = 127.0.0.1
smtpdeliver =
hidetrayconnectionnotifications = false
ttl = 367200
[BM-2cTpgCn57rYUgqm5BrgmykuV9gK1Ak1THF]
label = test1
enabled = true
decoy = false
noncetrialsperbyte = 1000
payloadlengthextrabytes = 1000
privsigningkey = 5KYCPJ4Vp31UD6k5NWmDKtHhfapW25UJ7V2MjctYxcgL3BpWGA3
privencryptionkey = 5JLER8q2zyj3KDEgGMv682en2SRUkkWWhUrNuqVYfGNNhHJmdkJ
lastpubkeysendtime = 1623160189
[BM-2cVrdzQjCQRqUuET6dc3byVyRTjZcgcJXj]
label = test2
enabled = true
decoy = false
noncetrialsperbyte = 1000
payloadlengthextrabytes = 1000
privsigningkey = 5KhryWvNowFWWA9JRjQnLVStYKwhpKpAG4RtWwzyaQqmK2fTMue
privencryptionkey = 5JKQ9NqX2LRzHBCgyxc1GAL3rDvyDTHPifpL22a6UNN7K6y9BmL
lastpubkeysendtime = 1623160221

View File

@ -0,0 +1,110 @@
[
{
"stream": 1,
"peer": {
"host": "5.45.99.75",
"port": 8444
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "75.167.159.54",
"port": 8444
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "95.165.168.168",
"port": 8444
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "85.180.139.241",
"port": 8444
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "158.222.217.190",
"port": 8080
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "178.62.12.187",
"port": 8448
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "24.188.198.204",
"port": 8111
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "109.147.204.113",
"port": 1195
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "178.11.46.221",
"port": 8444
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
}
]

View File

@ -0,0 +1 @@
16342

View File

@ -15,11 +15,12 @@ class AddressBook(TeleniumTestProcess):
"""Save Address On Address Book Screen/Window"""
print("=====================Test -Save Address In Address Book=====================")
self.cli.sleep(6)
self.cli.execute('app.clickNavDrawer()')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(4)
self.cli.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]", 1)
self.cli.sleep(3)
self.cli.click_on('//NavigationItem[6]')
self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=0)
self.cli.sleep(4)
self.cli.execute('app.addingtoaddressbook()')
self.cli.sleep(3)
@ -53,6 +54,8 @@ class AddressBook(TeleniumTestProcess):
self.cli.sleep(3)
self.cli.click_on('//MDRaisedButton[0]')
self.cli.sleep(4)
address_book_msgs = len(self.cli.select("//SwipeToDeleteItem"))
self.assertEqual(address_book_msgs, 1)
@ordered
def test_cancel_addressbook_popup(self):
@ -66,6 +69,7 @@ class AddressBook(TeleniumTestProcess):
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]', 'text', data[0])
self.cli.sleep(3)
self.cli.click_on('//MDRaisedButton[1]')
self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=1)
@ordered
def test_send_message_to_addressbook(self):
@ -76,6 +80,7 @@ class AddressBook(TeleniumTestProcess):
'//AddressBook/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/SwipeToDeleteItem[0]')
self.cli.sleep(3)
self.cli.click_on('//MDRaisedButton[0]')
self.assertExists("//Create[@name~=\"create\"]", timeout=1)
self.cli.sleep(3)
self.cli.click_on(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]')
@ -91,16 +96,18 @@ class AddressBook(TeleniumTestProcess):
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/TextInput[0]', 'text', random_label)
self.cli.sleep(0.2)
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(2)
self.cli.sleep(4)
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=1)
@ordered
def test_delete_address_from_address_contact(self):
"""Delete Address From Address Book"""
print("=====================Test -Delete Address From Address Book=====================")
self.cli.sleep(3)
self.cli.execute('app.clickNavDrawer()')
self.cli.sleep(2)
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(3)
self.cli.click_on('//NavigationItem[6]')
self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=1)
self.cli.sleep(3)
self.cli.drag(
'//MDList[0]/SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]/BoxLayout[1]',
@ -108,4 +115,4 @@ class AddressBook(TeleniumTestProcess):
self.cli.click_on('//MDList[0]/SwipeToDeleteItem[0]')
self.cli.sleep(2)
self.cli.click_on('//MDList[0]/SwipeToDeleteItem[0]//MDIconButton[0]')
self.cli.sleep(2)
self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=2)

View File

@ -10,10 +10,11 @@ class AllMailMessage(TeleniumTestProcess):
"""Show All Messages on Mail Screen/Window"""
print("=====================Test -Show Messages Of Mail Screen=====================")
self.cli.sleep(5)
self.cli.execute('app.clickNavDrawer()')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(4)
self.cli.click_on('//NavigationItem[5]')
self.cli.sleep(4)
self.assertExists("//Allmails[@name~=\"allmails\"]", timeout=2)
@ordered
def test_delete_message_from_allmail_list(self):
@ -22,6 +23,8 @@ class AllMailMessage(TeleniumTestProcess):
self.cli.sleep(4)
self.cli.click_on(
'//Allmails[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/CutsomSwipeToDeleteItem[0]')
self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=0)
self.cli.sleep(5)
self.cli.click_on('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[1]')
self.cli.sleep(5)
self.assertExists("//Allmails[@name~=\"allmails\"]", timeout=0)

View File

@ -21,9 +21,11 @@ class CreateRandomAddress(TeleniumTestProcess):
"""Clicking on Proceed Button to Proceed to Next Screen."""
print("=====================Test - Login Screen=====================")
self.cli.sleep(3)
self.assertExists("//Login[@name~=\"login\"]", timeout=1)
self.cli.wait_click(
'//ScreenManager[0]/Screen[0]/BoxLayout[0]/AnchorLayout[3]/MDFillRoundFlatIconButton[0]')
self.cli.sleep(3)
self.assertExists("//Random[@name~=\"random\"]", timeout=1)
@ordered
def test_random_screen(self):
@ -43,21 +45,25 @@ class CreateRandomAddress(TeleniumTestProcess):
self.cli.sleep(1)
self.cli.wait_click('//RandomBoxlayout/BoxLayout[0]/AnchorLayout[2]/MDFillRoundFlatIconButton[0]')
self.cli.sleep(5)
self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=3)
@ordered
def test_create_new_address(self):
"""Clicking on Navigation Drawer To Open New Address"""
print("=====================Test - Create New Address=====================")
self.cli.sleep(5)
self.cli.execute('app.root.ids.nav_drawer.set_state("toggle")')
# 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.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]", 1)
self.cli.sleep(3)
self.cli.click_on('//NavigationItem[9]')
self.assertExists("//Login[@name~=\"login\"]", timeout=1)
self.cli.sleep(4)
self.cli.wait_click(
'''//Login/BoxLayout[0]/BoxLayout[0]/ScreenManager[0]/Screen[0]/BoxLayout[0]/AnchorLayout[3]'''
'''/MDFillRoundFlatIconButton[0]''')
self.assertExists("//Random[@name~=\"random\"]", timeout=1)
self.test_random_screen()
@ordered
@ -66,7 +72,7 @@ class CreateRandomAddress(TeleniumTestProcess):
print("=====================Test - Select First Address From Drawer-Box=======================")
self.cli.sleep(3)
# self.cli.execute('app.root.ids.nav_drawer.set_state("toggle")')
self.cli.execute('app.clickNavDrawer()')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(2)
self.cli.drag("//NavigationItem[@text=\"Address Book\"]", "//NavigationItem[@text=\"Settings\"]", 1)
self.cli.sleep(2)
@ -74,3 +80,4 @@ class CreateRandomAddress(TeleniumTestProcess):
self.cli.sleep(2)
self.cli.click_on('//MySpinnerOption[0]')
self.cli.sleep(3)
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=1)

View File

@ -12,13 +12,15 @@ class DraftMessage(TeleniumTestProcess):
print("=====================Test - Select A Draft Screen From Navigaion-Drawer-Box=====================")
# OPEN NAVIGATION-DRAWER
self.cli.sleep(4)
self.cli.execute('app.clickNavDrawer()')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(2)
# OPEN INBOX SCREEN
self.cli.click_on('//NavigationItem[1]')
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2)
self.cli.sleep(2)
# CLICK ON PLUS ICON BUTTON
self.cli.click_on('//Inbox/ComposerButton[0]/MDFloatingActionButton[0]')
self.assertExists("//Create[@name~=\"create\"]", timeout=2)
self.cli.sleep(3)
# SELECT - TO ADDRESS
self.cli.click_on(
@ -32,8 +34,10 @@ class DraftMessage(TeleniumTestProcess):
self.cli.sleep(3)
# CLICK BACK-BUTTON
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2)
self.cli.sleep(5)
self.cli.click_on('//Inbox/ComposerButton[0]/MDFloatingActionButton[0]')
self.assertExists("//Create[@name~=\"create\"]", timeout=2)
self.cli.sleep(3)
# SELECT - TO ADDRESS
self.cli.click_on(
@ -53,6 +57,7 @@ class DraftMessage(TeleniumTestProcess):
# CLICK BACK-BUTTON
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(4)
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=1)
@ordered
def test_edit_and_resend_draft_messgae(self):
@ -60,17 +65,20 @@ class DraftMessage(TeleniumTestProcess):
make changes and send it."""
print("=====================Test - Edit A Message From Draft Screen=====================")
# OPEN NAVIGATION-DRAWER
self.cli.execute('app.clickNavDrawer()')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(4)
# OPEN DRAFT SCREEN
self.cli.click_on('//NavigationItem[3]')
self.assertExists("//Draft[@name~=\"draft\"]", timeout=2)
self.cli.sleep(4)
# SHOW DRAFT MESSAGE AND SELECT FIRST MESSAGE
# self.cli.click_on('//Carousel[0]//TwoLineAvatarIconListItem[0]')
self.cli.click_on('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]')
self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=2)
self.cli.sleep(3)
# CLICK EDIT BUTTON
self.cli.click_on('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[0]')
self.assertExists("//Create[@name~=\"create\"]", timeout=2)
self.cli.sleep(5)
random_label = ""
for char in "Hey,This is draft Message Body":
@ -80,7 +88,8 @@ class DraftMessage(TeleniumTestProcess):
self.cli.sleep(0.2)
self.cli.sleep(3)
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(5)
# self.cli.sleep(5)
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=5)
@ordered
def test_delete_draft_message(self):
@ -88,12 +97,15 @@ class DraftMessage(TeleniumTestProcess):
print("=====================Test - Delete A Message From List of Messages=====================")
self.cli.sleep(5)
# self.cli.execute('app.root.ids.nav_drawer.set_state("toggle")')
self.cli.execute('app.clickNavDrawer()')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(4)
self.cli.click_on('//NavigationItem[3]')
self.assertExists("//Draft[@name~=\"draft\"]", timeout=1)
self.cli.sleep(5)
self.cli.click_on('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]')
self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=2)
# self.cli.click_on('//Carousel[0]//TwoLineAvatarIconListItem[0]')
self.cli.sleep(5)
self.cli.click_on('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[1]')
self.cli.sleep(5)
self.assertExists("//Draft[@name~=\"draft\"]", timeout=1)

View File

@ -15,12 +15,13 @@ class MyAddressScreen(TeleniumTestProcess):
"""Select Address From List of Address"""
print("=====================Test -Select Address From List of Address=====================")
self.cli.sleep(4)
self.cli.execute('app.clickNavDrawer()')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(3)
self.cli.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]", 1)
self.cli.sleep(3)
self.cli.click_on('//NavigationItem[11]')
self.cli.sleep(4)
self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=2)
@ordered
def test_show_Qrcode(self):
@ -32,9 +33,11 @@ class MyAddressScreen(TeleniumTestProcess):
'''CustomTwoLineAvatarIconListItem[0]''')
self.cli.sleep(3)
self.cli.click_on('//MyaddDetailPopup/BoxLayout[1]/MDRaisedButton[1]/MDLabel[0]')
self.assertExists("//ShowQRCode[@name~=\"showqrcode\"]", timeout=2)
self.cli.sleep(3)
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(3)
self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=2)
@ordered
def test_send_message_from(self):
@ -46,6 +49,7 @@ class MyAddressScreen(TeleniumTestProcess):
'''CustomTwoLineAvatarIconListItem[0]''')
self.cli.sleep(4)
self.cli.click_on('//MyaddDetailPopup/BoxLayout[1]/MDRaisedButton[0]/MDLabel[0]')
self.assertExists("//Create[@name~=\"create\"]", timeout=2)
self.cli.sleep(3)
self.cli.setattr(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/BoxLayout[0]/MyTextInput', "text", data[1])
@ -61,3 +65,5 @@ class MyAddressScreen(TeleniumTestProcess):
self.cli.sleep(2)
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(4)
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2)

View File

@ -8,7 +8,7 @@ class NetwrokStatusScreen(TeleniumTestProcess):
"""Show NetwrokStatus"""
print("=====================Test -Show NetwrokStatus=====================")
self.cli.sleep(4)
self.cli.execute('app.clickNavDrawer()')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(3)
self.cli.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]", 1)
self.cli.sleep(3)
@ -16,3 +16,4 @@ class NetwrokStatusScreen(TeleniumTestProcess):
self.cli.sleep(4)
self.cli.click_on('//NetworkStat/MDTabs[0]/MDTabsBar[0]/MDTabsScrollView[0]/MDGridLayout[0]/MDTabsLabel[1]')
self.cli.sleep(4)
self.assertExists("//NetworkStat[@name~=\"networkstat\"]", timeout=2)

View File

@ -8,11 +8,12 @@ class PaymentScreen(TeleniumTestProcess):
"""Select Subscripton From List of Subscriptons"""
print("=====================Test -Select Subscripton From List of Subscriptons=====================")
self.cli.sleep(4)
self.cli.execute('app.clickNavDrawer()')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(3)
self.cli.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]", 1)
self.cli.sleep(3)
self.cli.click_on('//NavigationItem[8]')
self.assertExists("//Payment[@name~=\"payment\"]", timeout=2)
self.cli.sleep(3)
self.cli.drag(
'//Payment/BoxLayout[0]/ScrollView[0]/BoxLayout[0]/ProductCategoryLayout[0]/ProductLayout[1]',
@ -24,3 +25,5 @@ class PaymentScreen(TeleniumTestProcess):
self.cli.sleep(2)
self.cli.click_on('//MDRaisedButton[3]')
self.cli.sleep(2)
self.assertExists("//Payment[@name~=\"payment\"]", timeout=2)

View File

@ -19,11 +19,13 @@ class SendMessage(TeleniumTestProcess):
print("=======Test - Sending Message From Inbox Screen with validation Checks=======")
self.cli.sleep(3)
# self.cli.execute('app.root.ids.nav_drawer.set_state("toggle")')
self.cli.execute('app.clickNavDrawer()')
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)
@ -67,42 +69,9 @@ class SendMessage(TeleniumTestProcess):
self.cli.sleep(3)
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(3)
@ordered
def test_sent_multiple_messages(self):
"""
Sending Second Message From Inbox Screen
for testing the search and delete functionality for two messages on the screen
"""
print("=====================Test - Sending Message From Inbox Screen=====================")
self.cli.sleep(3)
# self.cli.execute('app.root.ids.nav_drawer.set_state("toggle")')
self.cli.execute('app.clickNavDrawer()')
self.cli.sleep(5)
self.cli.click_on('//NavigationItem[1]')
self.cli.sleep(3)
self.cli.click_on('//Inbox/ComposerButton[0]/MDFloatingActionButton[0]')
self.cli.sleep(3)
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.setattr(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/BoxLayout[0]/MyTextInput[0]', "text", data[0])
self.cli.sleep(3)
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', 'Second')
self.cli.sleep(3)
random_label = ""
for char in "Hey This Is Second Message Body":
random_label += char
self.cli.setattr(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/TextInput[0]', "text", random_label)
self.cli.sleep(0.2)
self.cli.sleep(2)
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(5)
self.cli.execute('app.clickNavDrawer()')
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)

View File

@ -8,9 +8,11 @@ class SettingScreen(TeleniumTestProcess):
"""Show Setting Screen"""
print("=====================Test -Show Setting Screen=====================")
self.cli.sleep(3)
self.cli.execute('app.clickNavDrawer()')
# self.cli.wait_click("//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]", timeout=20)
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(3)
self.cli.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]", 1)
self.cli.sleep(3)
self.cli.click_on('//NavigationItem[7]')
self.cli.sleep(4)
self.cli.sleep(2)
self.assertExists("//Setting[@name~=\"set\"]", timeout=2)

View File

@ -8,9 +8,10 @@ class TrashMessage(TeleniumTestProcess):
"""Delete Trash message permanently from trash message listing"""
print("=====================Test -Delete Message From Trash Message Listing=====================")
self.cli.sleep(4)
self.cli.execute('app.clickNavDrawer()')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(4)
self.cli.click_on('//NavigationItem[4]')
self.assertExists("//Trash[@name~=\"trash\"]", timeout=2)
self.cli.sleep(4)
self.cli.drag(
'//MDList[0]/CutsomSwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]/BoxLayout[1]',
@ -21,4 +22,6 @@ class TrashMessage(TeleniumTestProcess):
self.cli.sleep(2)
self.cli.click_on('//MDDialog/MDCard[0]/AnchorLayout[0]/MDBoxLayout[0]/MDFlatButton[0]')
# self.cli.click_on('//MDDialog/DialogFakeCard[0]/AnchorLayout[0]/MDBoxLayout[0]/MDFlatButton[0]')
self.cli.sleep(4)
self.cli.sleep(2)
total_trash_msgs = len(self.cli.select("//CutsomSwipeToDeleteItem"))
self.assertEqual(total_trash_msgs, 1)

0
src/mock/__init__.py Normal file
View File

View File

@ -0,0 +1,93 @@
"""
A thread for creating addresses
"""
# import queues
try:
import queue as Queue
except ImportError:
import Queue
import logging
import random
from pybitmessage import state
import threading
from pybitmessage.bmconfigparser import BMConfigParser
# from network.threads import StoppableThread
fake_addresses = [
'BM-2cXDconV3bk6nPwWgBwN7wXaqZoT1bEzGv',
'BM-2cTWjUVedYftZJbnZfs7MWts92v1R35Try',
'BM-2cV1UN3er2YVQBcmJaaeYMXvpwBVokJNTo',
'BM-2cWVkWk3TyKUscdcn9E7s9hrwpv2ZsBBog',
'BM-2cW2a5R1KidMGNByqPKn6nJDDnHtazoere'
]
UISignalQueue = Queue.Queue()
addressGeneratorQueue = Queue.Queue()
class StoppableThread(threading.Thread):
"""Base class for application threads with stopThread method"""
name = None
logger = logging.getLogger('default')
def __init__(self, name=None):
if name:
self.name = name
super(StoppableThread, self).__init__(name=self.name)
self.stop = threading.Event()
self._stopped = False
random.seed()
self.logger.info('Init thread %s', self.name)
def stopThread(self):
"""Stop the thread"""
self._stopped = True
self.stop.set()
class FakeAddressGenerator(StoppableThread):
"""A thread for creating fake addresses"""
name = "addressGenerator"
def stopThread(self):
try:
addressGeneratorQueue.put(("stopThread", "data"))
except:
pass
super(FakeAddressGenerator, self).stopThread()
def run(self):
"""
Process the requests for addresses generation
from `.queues.addressGeneratorQueue`
"""
while state.shutdown == 0:
queueValue = addressGeneratorQueue.get()
streamNumber = 1
try:
if len(BMConfigParser().addresses()) > 0:
address = fake_addresses[len(BMConfigParser().addresses())]
else:
address = fake_addresses[0]
label = queueValue[3]
BMConfigParser().add_section(address)
BMConfigParser().set(address, 'label', label)
BMConfigParser().set(address, 'enabled', 'true')
BMConfigParser().set(
address, 'privencryptionkey', '5KUayt1aPSsNWsxMJnk27kv79wfRE3cWVPYLazyLQc752bXfQP3')
BMConfigParser().save()
UISignalQueue.put((
'updateStatusBar', ""
))
UISignalQueue.put(('writeNewAddressToTable', (
label, address, streamNumber)))
addressGeneratorQueue.task_done()
except IndexError:
self.logger.error(
'Program error: you can only create 5 fake addresses')

29
src/mock/main.py Normal file
View File

@ -0,0 +1,29 @@
"""This module is for thread start."""
from pybitmessage import state
from pybitmessage.bitmessagekivy.mpybit import NavigateApp
from class_addressGenerator import FakeAddressGenerator
# from class_sqlThread import sqlThread
def main():
"""main method for starting threads"""
if state.enableObjProc:
# Start the address generation thread
addressGeneratorThread = FakeAddressGenerator()
# close the main program even if there are threads left
addressGeneratorThread.daemon = True
addressGeneratorThread.start()
# sqlLookup = sqlThread()
# DON'T close the main program even if there are threads left.
# The closeEvent should command this thread to exit gracefully.
# sqlLookup.daemon = False
# sqlLookup.start()
state.kivyapp = NavigateApp()
state.kivyapp.run()
if __name__ == '__main__':
main()

View File

@ -22,7 +22,7 @@ def doCleanShutdown():
objectProcessorQueue.put(('checkShutdownVariable', 'no data'))
for thread in threading.enumerate():
if thread.isAlive() and isinstance(thread, StoppableThread):
if thread.is_alive() and isinstance(thread, StoppableThread):
thread.stopThread()
UISignalQueue.put((