Access xpath of next button

This commit is contained in:
prachi 2020-04-06 22:00:42 +05:30
parent 23a8ab2c19
commit 4ac0d308d1
No known key found for this signature in database
GPG Key ID: 2940E6901747AAAF

41
src/tests_ui_test1.py Normal file
View File

@ -0,0 +1,41 @@
import time
from telenium.tests import TeleniumTestCase
import random
import string
class TestTestCase(TeleniumTestCase):
cmd_entrypoint = [u'/home/cis/peterwork_new/PyBitmessage/src/main.py']
def runTest(self):
print(self,"-------------Welcome To Kivy Testing Application-------------")
def test_press_button(self):
print(self,"---------------------------")
time.sleep(5)
self.cli.drag("/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Login[0]/ScrollView[0]/BoxLayout[0]/MDCheckbox[0]","/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Login[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[0]",2)
time.sleep(5)
self.cli.wait_click(u'/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Login[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[2]/AnchorLayout[0]/MDRaisedButton[0]/MDLabel[0]')
time.sleep(5)
self.cli.setattr(u'/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Random[0]/ScrollView[0]/BoxLayout[0]/MDTextField[0]', "text", self.generate_random_string())
time.sleep(5)
def test_next_button(self):
self.cli.wait_click(u'/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Random[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/AnchorLayout[0]/MDRaisedButton[0]/MDLabel[0]')
time.sleep(5)
def generate_random_string(self):
"""Generate a random string of fixed length """
# return ''.join(random.choice(letters) for i in range(stringLength))
letters = string.ascii_letters
return ''.join(random.choice(letters) for i in range(10))
if __name__ == '__main__':
TeleniumTestCase.start_process()
TestTestCase().runTest()
TestTestCase().test_press_button()
TestTestCase().test_next_button()