fixed xpaths of telenium test cases

This commit is contained in:
navjot 2021-03-17 00:58:14 +05:30
parent a255840506
commit ab7ef314ef
No known key found for this signature in database
GPG Key ID: 9EE70AFD71357F1C
12 changed files with 25 additions and 46 deletions

View File

@ -1,7 +1,3 @@
import state
# import tempfile
# state.appdata = tempfile.gettempdir()
print('state.appdata (mpybit.py line no. (1))....................................', state.appdata)
# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument
# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation
# pylint: disable=protected-access
@ -25,10 +21,6 @@ from debug import logger
from functools import partial
from helper_sql import sqlExecute, sqlQuery
from kivymd.app import MDApp
import kivy
import kivymd
print('kivy version......................................', kivy.__version__)
print('kivymd version......................................', kivymd.__version__)
from kivy.clock import Clock
from kivy.core.clipboard import Clipboard
from kivy.core.window import Window
@ -910,8 +902,6 @@ class DropDownWidget(BoxLayout):
def send(self, navApp):
"""Send message from one address to another"""
print('in send check state.appdata................................')
print('state.appdata....................................', state.appdata)
fromAddress = self.ids.ti.text.strip()
toAddress = self.ids.txt_input.text.strip()
subject = self.ids.subject.text.strip()
@ -1333,8 +1323,6 @@ class Random(Screen):
def generateaddress(self, navApp):
"""Method for Address Generator"""
# entered_label = str(self.ids.lab.text).strip()
print('address creation.........999999999999999999999999999')
print('state.appdata....................................', state.appdata)
entered_label = str(self.ids.add_random_bx.children[0].ids.lab.text).strip()
if not entered_label:
self.ids.add_random_bx.children[0].ids.lab.focus = True

View File

@ -38,7 +38,7 @@ def set_temp_data():
class TeleniumTestProcess(TeleniumTestCase):
"""Setting Screen Functionality Testing"""
cmd_entrypoint = [os.path.join(os.path.abspath(os.getcwd()), 'main_mock_test.py')]
cmd_entrypoint = [os.path.join(os.path.abspath(os.getcwd()), 'main_test.py')]
@classmethod
def setUpClass(cls):

View File

@ -86,7 +86,7 @@ class AddressBook(TeleniumTestProcess):
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.click_on('//MDIconButton[2]')
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(2)
@ordered
@ -102,3 +102,4 @@ class AddressBook(TeleniumTestProcess):
'//AddressBook/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]//TwoLineAvatarIconListItem[0]/BoxLayout[2]', 2)
self.cli.sleep(2)
self.cli.click_on('//AddressBook/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]//Button[0]')
self.cli.sleep(2)

View File

@ -22,5 +22,5 @@ class AllMailMessage(TeleniumTestProcess):
self.cli.sleep(4)
self.cli.click_on('//Allmails[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]')
self.cli.sleep(5)
self.cli.click_on('//MDToolbar/BoxLayout[2]/MDIconButton[1]')
self.cli.sleep(3)
self.cli.click_on('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[1]')
self.cli.sleep(5)

View File

@ -69,3 +69,4 @@ class CreateRandomAddress(TeleniumTestProcess):
self.cli.click_on('//NavigationItem[0]')
self.cli.sleep(2)
self.cli.click_on('//MySpinnerOption[0]')
self.cli.sleep(3)

View File

@ -29,7 +29,7 @@ class DraftMessage(TeleniumTestProcess):
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/BoxLayout[0]/MyTextInput[0]', "text",'BM-2cSsuH1bUWBski8bvdqnK2DivMqQCeQA1J')
self.cli.sleep(3)
# CLICK BACK-BUTTON
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDIconButton[0]')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(5)
self.cli.click_on('//Inbox/ComposerButton[0]/MDFloatingActionButton[0]')
self.cli.sleep(3)
@ -47,7 +47,7 @@ class DraftMessage(TeleniumTestProcess):
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', random_label)
self.cli.sleep(0.2)
# CLICK BACK-BUTTON
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDIconButton[0]')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(4)
@ordered
@ -65,7 +65,7 @@ class DraftMessage(TeleniumTestProcess):
self.cli.click_on('//Carousel[0]//TwoLineAvatarIconListItem[0]')
self.cli.sleep(3)
# CLICK EDIT BUTTON
self.cli.click_on('//MDToolbar/BoxLayout[2]/MDIconButton[0]')
self.cli.click_on('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[0]')
self.cli.sleep(5)
random_label=""
for char in "Hey,This is draft Message Body":
@ -73,7 +73,7 @@ class DraftMessage(TeleniumTestProcess):
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('//MDIconButton[2]')
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(5)
@ordered
@ -88,5 +88,5 @@ class DraftMessage(TeleniumTestProcess):
self.cli.sleep(5)
self.cli.click_on('//Carousel[0]//TwoLineAvatarIconListItem[0]')
self.cli.sleep(5)
self.cli.click_on('//MDToolbar/BoxLayout[2]/MDIconButton[1]')
self.cli.click_on('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[1]')
self.cli.sleep(2)

View File

@ -29,7 +29,7 @@ class MyAddressScreen(TeleniumTestProcess):
self.cli.sleep(3)
self.cli.click_on('//MyaddDetailPopup/BoxLayout[1]/MDRaisedButton[1]/MDLabel[0]')
self.cli.sleep(3)
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDIconButton[0]')
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(3)
@ordered
@ -51,5 +51,5 @@ class MyAddressScreen(TeleniumTestProcess):
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('//MDIconButton[2]')
self.cli.sleep(2)
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(4)

View File

@ -15,7 +15,7 @@ class SendMessage(TeleniumTestProcess):
opens a pop-up(screen)which send message from sender to reciever
"""
print("=====================Test - Sending Message From Inbox Screen=====================")
self.cli.sleep(2)
self.cli.sleep(3)
# self.cli.execute('app.root.ids.nav_drawer.set_state("toggle")')
self.cli.execute('app.clickNavDrawer()')
self.cli.sleep(2)
@ -61,7 +61,7 @@ class SendMessage(TeleniumTestProcess):
self.cli.sleep(3)
self.cli.click_on('//MDIconButton[2]')
self.cli.sleep(3)
self.cli.click_on('//MDFlatButton[0]')
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(3)
@ordered
@ -93,7 +93,7 @@ class SendMessage(TeleniumTestProcess):
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('//MDIconButton[2]')
self.cli.click_on('//MDActionTopAppBarButton[2]')
self.cli.sleep(5)
self.cli.execute('app.clickNavDrawer()')
self.cli.sleep(3)

View File

@ -17,5 +17,6 @@ class TrashMessage(TeleniumTestProcess):
self.cli.sleep(4)
self.cli.click_on('//Trash/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]//Button[0]')
self.cli.sleep(2)
self.cli.click_on('//MDDialog/MDCard[0]/AnchorLayout[0]/MDBoxLayout[0]/MDFlatButton[0]')
# 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)

View File

@ -150,9 +150,6 @@ class Main(object):
def start(self):
"""Start main application"""
# pylint: disable=too-many-statements,too-many-branches,too-many-locals
# import tempfile
# state.appdata = tempfile.gettempdir()
# print('line BABAL..........................153(state.appdata)...', state.appdata)
_fixSocket()
adjustHalfOpenConnectionsLimit()
@ -168,7 +165,6 @@ class Main(object):
self.usage()
sys.exit(2)
print('opts......................', opts)
for opt, _ in opts:
if opt in ("-h", "--help"):
self.usage()
@ -259,9 +255,6 @@ class Main(object):
singleWorkerThread.start()
# Start the SQL thread
# import tempfile
# state.appdata = tempfile.gettempdir()
print('state.appdata (bitmessagemain)..........................(258)', state.appdata)
sqlLookup = sqlThread()
# DON'T close the main program even if there are threads left.
# The closeEvent should command this thread to exit gracefully.

View File

@ -1,9 +0,0 @@
"""This module is for thread start."""
import state
if __name__ == '__main__':
state.kivy = True
print("Kivy Loading......")
# from bitmessagemain import main
from bitmessagemain_mock_test import main
main()

View File

@ -1,11 +1,10 @@
"""This module is for thread start."""
import state
from bitmessagekivy.mpybit import NavigateApp
from threads import addressGenerator, sqlThread
def main():
if state.enableObjProc:
print('....................................................line(8)(sqlThread)')
# Start the address generation thread
addressGeneratorThread = addressGenerator()
# close the main program even if there are threads left
@ -20,3 +19,8 @@ def main():
state.kivyapp = NavigateApp()
state.kivyapp.run()
if __name__ == '__main__':
main()