From 157a3bbdb064727896c79983a995afc3c21d5d16 Mon Sep 17 00:00:00 2001 From: shekhar-cis Date: Mon, 25 Oct 2021 19:04:09 +0530 Subject: [PATCH] updated: setting screen test, clicks and scrolling screens --- .../tests/test_setting_screen.py | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/bitmessagekivy/tests/test_setting_screen.py b/src/bitmessagekivy/tests/test_setting_screen.py index f3c18d87..949a6f51 100644 --- a/src/bitmessagekivy/tests/test_setting_screen.py +++ b/src/bitmessagekivy/tests/test_setting_screen.py @@ -12,14 +12,8 @@ class SettingScreen(TeleniumTestProcess): """Show Setting Screen""" # This is for checking Current screen self.assert_wait_no_except('//ScreenManager[@current]', timeout=15, value='inbox') - # This is for checking the Side nav Bar is closed - self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5) - # This is for checking the menu button is appeared - self.assertExists('//MDActionTopAppBarButton[@icon~=\"menu\"]', timeout=5) - # this is for opening Nav drawer - self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=5) - # checking state of Nav drawer - self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=5) + # Method to open side navbar + self.open_side_navbar() # this is for scrolling Nav drawer self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]") # assert for checking scroll function @@ -27,4 +21,23 @@ class SettingScreen(TeleniumTestProcess): # this is for opening setting screen self.cli.wait_click('//NavigationItem[@text=\"Settings\"]', timeout=3) # Checking current screen - self.assertExists("//ScreenManager[@current=\"set\"]", timeout=2) + self.assertExists("//ScreenManager[@current=\"set\"]", timeout=3) + # Scrolling down currrent screen + self.cli.wait_drag( + '//MDTabs[0]//MDLabel[@text=\"Close to tray\"]', + '//MDTabs[0]//MDLabel[@text=\"Minimize to tray\"]', 1, timeout=5) + # Checking state of 'Network Settings' sub tab should be 'normal'(inactive) + self.assertExists('//MDTabs[0]//MDTabsLabel[@text=\"Network Settings\"][@state=\"normal\"]', timeout=5) + # Click on "Network Settings" subtab + self.cli.wait_click('//MDTabs[0]//MDTabsLabel[@text=\"Network Settings\"]', timeout=5) + # Checking state of 'Network Settings' sub tab should be 'down'(active) + self.assertExists('//MDTabs[0]//MDTabsLabel[@text=\"Network Settings\"][@state=\"down\"]', timeout=5) + # Scrolling down currrent screen + self.cli.wait_drag( + '//MDTabs[0]//MDLabel[@text=\"Username:\"]', '//MDTabs[0]//MDLabel[@text=\"Port:\"]', 1, timeout=5) + # Checking state of 'Resends Expire' sub tab should be 'normal'(inactive) + self.assertExists('//MDTabs[0]//MDTabsLabel[@text=\"Resends Expire\"][@state=\"normal\"]', timeout=5) + # Scrolling down currrent screen + self.cli.wait_click('//MDTabs[0]//MDTabsLabel[@text=\"Resends Expire\"]', timeout=5) + # Checking state of 'Resends Expire' sub tab should be 'down'(active) + self.assertExists('//MDTabs[0]//MDTabsLabel[@text=\"Resends Expire\"][@state=\"down\"]', timeout=5)