diff --git a/kivy-requirements.txt b/kivy-requirements.txt index 632404a5..8a0bc7a4 100644 --- a/kivy-requirements.txt +++ b/kivy-requirements.txt @@ -1,34 +1,6 @@ -certifi==2020.12.5 -chardet==4.0.0 -cheroot==8.5.2 -CherryPy==18.6.0 -docutils==0.16 -idna==2.10 -jaraco.classes==3.2.1 -jaraco.collections==3.2.0 -jaraco.functools==3.2.1 -jaraco.text==3.5.0 -json-rpc==1.13.0 Kivy==2.0.0 -Kivy-Garden==0.1.4 kivy-garden.qrcode==2021.314 -e git+https://github.com/kivymd/KivyMD#egg=kivymd -Mako==1.1.4 -MarkupSafe==1.1.1 -more-itertools==8.7.0 -numpy==1.20.1 opencv-python==4.5.1.48 -Pillow==8.1.2 -portend==2.7.1 -Pygments==2.8.1 -pytz==2021.1 pyzbar==0.1.8 -qrcode==6.1 -requests==2.25.1 -six==1.15.0 -telenium==0.5.0 -tempora==4.0.1 -urllib3==1.26.4 -Werkzeug==1.0.1 -ws4py==0.5.1 -zc.lockfile==2.0 +telenium==0.5.0 \ No newline at end of file diff --git a/src/bitmessagekivy/tests/telenium_process.py b/src/bitmessagekivy/tests/telenium_process.py index cd7ac94a..484f10e9 100644 --- a/src/bitmessagekivy/tests/telenium_process.py +++ b/src/bitmessagekivy/tests/telenium_process.py @@ -1,3 +1,7 @@ +""" + Base class for telenium test cases which run kivy app as background process +""" + import os import shutil import tempfile @@ -28,10 +32,10 @@ def cleanup(home=None, files=_files): def set_temp_data(): """Set temp data in tmp directory""" - for file in tmp_db_file: + for file_name in tmp_db_file: old_source_file = os.path.join( - os.path.abspath(os.path.dirname(__file__)), 'sampleData', file) - new_destination_file = os.path.join(os.environ['BITMESSAGE_HOME'], file) + os.path.abspath(os.path.dirname(__file__)), 'sampleData', file_name) + new_destination_file = os.path.join(os.environ['BITMESSAGE_HOME'], file_name) shutil.copyfile(old_source_file, new_destination_file) @@ -49,9 +53,17 @@ class TeleniumTestProcess(TeleniumTestCase): @classmethod def tearDownClass(cls): """Ensures that pybitmessage stopped and removes files""" + # pylint: disable=no-member + try: + cls.cli.app_quit() + except: + pass + + try: + cls.process.kill() + except: + pass cleanup() - cls.cli.app_quit() - cls.process.kill() def click_on(self, xpath, seconds=0.3): """this methos is used for on_click event with time""" @@ -60,15 +72,16 @@ class TeleniumTestProcess(TeleniumTestCase): def drag(self, xpath1, xpath2): """this method is for dragging""" - self.cli.drag(xpath1, xpath2, 1.5) + self.cli.drag(xpath1, xpath2, 1) self.cli.sleep(0.3) - def assertCheckScrollDown(self, scroll_distance, destination, timeout=-1): + def assertCheckScrollDown(self, selector, timeout=-1): """this method is for checking scroll""" start = time() while True: - if scroll_distance <= destination: - self.assertLessEqual(scroll_distance, destination) + scroll_distance = self.cli.getattr('//ContentNavigationDrawer//ScrollView[0]', 'scroll_y') + if scroll_distance > 0.0: + self.assertGreaterEqual(scroll_distance, 0.0) return True if timeout == -1: return False diff --git a/src/bitmessagekivy/tests/test_setting_screen.py b/src/bitmessagekivy/tests/test_setting_screen.py index a5c66951..d9d9183f 100644 --- a/src/bitmessagekivy/tests/test_setting_screen.py +++ b/src/bitmessagekivy/tests/test_setting_screen.py @@ -17,8 +17,7 @@ class SettingScreen(TeleniumTestProcess): # this is for scrolling Nav drawer self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]") # assert for checking scroll funcation - scroll_distance = self.cli.getattr('//ContentNavigationDrawer//ScrollView[0]', 'scroll_y') - self.assertCheckScrollDown(scroll_distance, -0.0, timeout=1) + self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=3) # this is for opening setting screen self.cli.wait_click('//NavigationItem[@text=\"Settings\"]', timeout=1) # Checking current screen