2021-03-03 23:58:11 +01:00
|
|
|
import os
|
|
|
|
import tempfile
|
2021-03-11 08:43:26 +01:00
|
|
|
|
2021-06-10 17:14:19 +02:00
|
|
|
from .telenium_process import TeleniumTestProcess, cleanup
|
2021-03-11 08:43:26 +01:00
|
|
|
from .common import ordered
|
2021-03-03 23:58:11 +01:00
|
|
|
from random import choice
|
|
|
|
from string import ascii_lowercase
|
|
|
|
|
|
|
|
|
2021-03-06 00:14:43 +01:00
|
|
|
class CreateRandomAddress(TeleniumTestProcess):
|
2021-05-21 13:36:11 +02:00
|
|
|
"""This is for testing randrom address creation"""
|
2021-05-19 10:27:10 +02:00
|
|
|
|
2021-03-11 08:43:26 +01:00
|
|
|
@classmethod
|
|
|
|
def setUpClass(cls):
|
|
|
|
os.environ["BITMESSAGE_HOME"] = tempfile.gettempdir()
|
|
|
|
cleanup()
|
|
|
|
super(TeleniumTestProcess, cls).setUpClass()
|
|
|
|
|
|
|
|
@ordered
|
2021-03-03 23:58:11 +01:00
|
|
|
def test_login_screen(self):
|
|
|
|
"""Clicking on Proceed Button to Proceed to Next Screen."""
|
|
|
|
print("=====================Test - Login Screen=====================")
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-07-01 18:27:38 +02:00
|
|
|
self.assertExists("//Login[@name~=\"login\"]", timeout=1)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.wait_click(
|
2021-05-20 16:07:56 +02:00
|
|
|
'//ScreenManager[0]/Screen[0]/BoxLayout[0]/AnchorLayout[3]/MDFillRoundFlatIconButton[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-07-01 18:27:38 +02:00
|
|
|
self.assertExists("//Random[@name~=\"random\"]", timeout=1)
|
2021-03-03 23:58:11 +01:00
|
|
|
|
2021-03-11 08:43:26 +01:00
|
|
|
@ordered
|
2021-03-03 23:58:11 +01:00
|
|
|
def test_random_screen(self):
|
|
|
|
"""Creating New Adress For New User."""
|
|
|
|
print("=====================Test - Create New Address=====================")
|
|
|
|
self.cli.click_on('//RandomBoxlayout/BoxLayout[0]/AnchorLayout[1]/MDTextField[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-03 23:58:11 +01:00
|
|
|
self.cli.wait_click('//RandomBoxlayout/BoxLayout[0]/AnchorLayout[2]/MDFillRoundFlatIconButton[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-03 23:58:11 +01:00
|
|
|
self.cli.click_on('//RandomBoxlayout/BoxLayout[0]/AnchorLayout[1]/MDTextField[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-03 23:58:11 +01:00
|
|
|
random_label = ""
|
|
|
|
for _ in range(10):
|
|
|
|
random_label += choice(ascii_lowercase)
|
|
|
|
self.cli.setattr('//RandomBoxlayout/BoxLayout[0]/AnchorLayout[1]/MDTextField[0]', "text", random_label)
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(0.2)
|
|
|
|
self.cli.sleep(1)
|
2021-03-03 23:58:11 +01:00
|
|
|
self.cli.wait_click('//RandomBoxlayout/BoxLayout[0]/AnchorLayout[2]/MDFillRoundFlatIconButton[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(5)
|
2021-07-01 18:27:38 +02:00
|
|
|
self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=3)
|
2021-03-03 23:58:11 +01:00
|
|
|
|
2021-03-11 08:43:26 +01:00
|
|
|
@ordered
|
2021-03-03 23:58:11 +01:00
|
|
|
def test_create_new_address(self):
|
|
|
|
"""Clicking on Navigation Drawer To Open New Address"""
|
|
|
|
print("=====================Test - Create New Address=====================")
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(5)
|
2021-07-01 18:27:38 +02:00
|
|
|
# self.cli.execute('app.root.ids.nav_drawer.set_state("toggle")')
|
|
|
|
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(2)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]", 1)
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-03 23:58:11 +01:00
|
|
|
self.cli.click_on('//NavigationItem[9]')
|
2021-07-01 18:27:38 +02:00
|
|
|
self.assertExists("//Login[@name~=\"login\"]", timeout=1)
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(4)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.wait_click(
|
|
|
|
'''//Login/BoxLayout[0]/BoxLayout[0]/ScreenManager[0]/Screen[0]/BoxLayout[0]/AnchorLayout[3]'''
|
|
|
|
'''/MDFillRoundFlatIconButton[0]''')
|
2021-07-01 18:27:38 +02:00
|
|
|
self.assertExists("//Random[@name~=\"random\"]", timeout=1)
|
2021-03-11 08:43:26 +01:00
|
|
|
self.test_random_screen()
|
2021-03-03 23:58:11 +01:00
|
|
|
|
2021-03-11 08:43:26 +01:00
|
|
|
@ordered
|
2021-03-03 23:58:11 +01:00
|
|
|
def test_select_address(self):
|
|
|
|
"""Select First Address From Drawer-Box"""
|
|
|
|
print("=====================Test - Select First Address From Drawer-Box=======================")
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-03 23:58:11 +01:00
|
|
|
# self.cli.execute('app.root.ids.nav_drawer.set_state("toggle")')
|
2021-07-01 18:27:38 +02:00
|
|
|
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(2)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.drag("//NavigationItem[@text=\"Address Book\"]", "//NavigationItem[@text=\"Settings\"]", 1)
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(2)
|
2021-03-03 23:58:11 +01:00
|
|
|
self.cli.click_on('//NavigationItem[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(2)
|
2021-03-03 23:58:11 +01:00
|
|
|
self.cli.click_on('//MySpinnerOption[0]')
|
2021-03-16 20:28:14 +01:00
|
|
|
self.cli.sleep(3)
|
2021-07-01 18:27:38 +02:00
|
|
|
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=1)
|