Add test cases for network screen
This commit is contained in:
parent
1f9defbdf8
commit
38c283ba25
|
@ -20,3 +20,31 @@ class NetworkStatusScreen(TeleniumTestProcess):
|
||||||
self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]")
|
self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]")
|
||||||
# assert for checking scroll function
|
# assert for checking scroll function
|
||||||
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=5)
|
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=5)
|
||||||
|
# Clicking on Network Status tab
|
||||||
|
self.cli.wait_click('//NavigationItem[@text=\"Network status\"]', timeout=2)
|
||||||
|
# Checking the drawer is in 'closed' state
|
||||||
|
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5)
|
||||||
|
# Checking for current screen (Network Status)
|
||||||
|
self.assertExists("//NetworkStat[@name~=\"networkstat\"]", timeout=2)
|
||||||
|
# Checking state of Total Connections tab
|
||||||
|
self.assertExists(
|
||||||
|
'//NetworkStat/MDTabs[0]//MDTabsLabel[@text=\"Total connections\"][@state=\"down\"]', timeout=5
|
||||||
|
)
|
||||||
|
# Getting the value of total connections
|
||||||
|
total_connection_text = self.cli.getattr('//NetworkStat//MDRaisedButton[@text]', 'text')
|
||||||
|
# Splitting the string from total connection numbers
|
||||||
|
number_of_connections = int(total_connection_text.split(' ')[-1])
|
||||||
|
# Checking Total connections
|
||||||
|
self.assertGreaterEqual(number_of_connections, 1)
|
||||||
|
# Checking the state of Process tab
|
||||||
|
self.assertExists(
|
||||||
|
'//NetworkStat/MDTabs[0]//MDTabsLabel[@text=\"Processes\"][@state=\"normal\"]', timeout=5
|
||||||
|
)
|
||||||
|
# Clicking on Processes Tab
|
||||||
|
self.cli.wait_click(
|
||||||
|
'//NetworkStat/MDTabs[0]//MDTabsLabel[@text=\"Processes\"]', timeout=1
|
||||||
|
)
|
||||||
|
# Checking the state of Process tab
|
||||||
|
self.assertExists(
|
||||||
|
'//NetworkStat/MDTabs[0]//MDTabsLabel[@text=\"Processes\"][@state=\"down\"]', timeout=5
|
||||||
|
)
|
||||||
|
|
Reference in New Issue
Block a user