|
| 1 | +from .telenium_process import TeleniumTestProcess |
| 2 | +from .common import ordered |
| 3 | + |
| 4 | + |
| 5 | +class FileManagerOpening(TeleniumTestProcess): |
| 6 | + """File-manager Opening Functionality Testing""" |
| 7 | + @ordered |
| 8 | + def test_open_file_manager(self): |
| 9 | + """Opening and Closing File-manager""" |
| 10 | + # Checking current Screen(Inbox screen) |
| 11 | + self.assert_wait_no_except('//ScreenManager[@current]', timeout=15, value='inbox') |
| 12 | + # Method to open side navbar |
| 13 | + self.open_side_navbar() |
| 14 | + # Click to open Address Dropdown |
| 15 | + self.assertExists('//NavigationItem[0][@text=\"dropdown_nav_item\"]', timeout=2) |
| 16 | + self.assertExists( |
| 17 | + '//NavigationItem[0][@text=\"dropdown_nav_item\"]' |
| 18 | + '/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=1 |
| 19 | + ) |
| 20 | + # Check the state of dropdown |
| 21 | + self.assertExists( |
| 22 | + '//NavigationItem[0][@text=\"dropdown_nav_item\"]' |
| 23 | + '/IdentitySpinner[@name=\"identity_dropdown\"][@is_open=false]', timeout=1 |
| 24 | + ) |
| 25 | + self.cli.wait( |
| 26 | + '//NavigationItem[0][@text=\"dropdown_nav_item\"]' |
| 27 | + '/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=2 |
| 28 | + ) |
| 29 | + self.cli.wait_click( |
| 30 | + '//NavigationItem[0][@text=\"dropdown_nav_item\"]' |
| 31 | + '/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=1 |
| 32 | + ) |
| 33 | + # Check the state of dropdown. |
| 34 | + self.assertExists( |
| 35 | + '//NavigationItem[0][@text=\"dropdown_nav_item\"]' |
| 36 | + '/IdentitySpinner[@name=\"identity_dropdown\"][@is_open=true]', timeout=1 |
| 37 | + ) |
| 38 | + # List of addresses |
| 39 | + addresses_in_dropdown = self.cli.getattr( |
| 40 | + '//NavigationItem[0][@text=\"dropdown_nav_item\"]/IdentitySpinner[@values]', 'values' |
| 41 | + ) |
| 42 | + # Checking the dropdown options are exists |
| 43 | + self.assertGreaterEqual(len(self.cli.getattr( |
| 44 | + '//MySpinnerOption[@text]', 'text')), len(addresses_in_dropdown) |
| 45 | + ) |
| 46 | + # Selection of an address to set as a default address. |
| 47 | + self.cli.wait_click('//MySpinnerOption[0]', timeout=5) |
| 48 | + # this is for scrolling Nav drawer |
| 49 | + self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]") |
| 50 | + # assert for checking scroll function |
| 51 | + self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=5) |
| 52 | + # checking state of Nav drawer |
| 53 | + self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=5) |
| 54 | + # Checking File-manager icon |
| 55 | + self.assertExists( |
| 56 | + '//ContentNavigationDrawer//MDIconButton[1][@icon=\"file-image\"]', |
| 57 | + timeout=5 |
| 58 | + ) |
| 59 | + # Clicking on file manager icon |
| 60 | + self.cli.wait_click( |
| 61 | + '//ContentNavigationDrawer//MDIconButton[1][@icon=\"file-image\"]', |
| 62 | + timeout=5) |
| 63 | + # Checking the state of file manager is it open or not |
| 64 | + self.assertTrue(self.cli.execute('app.file_manager_open')) |
| 65 | + # Closing the filemanager |
| 66 | + self.cli.execute('app.exit_manager()') |
| 67 | + # Checking the state of file manager is it closed or not |
| 68 | + self.assertTrue(self.cli.execute('app.exit_manager()')) |
0 commit comments