@@ -16,7 +16,7 @@ class AddressBook(TeleniumTestProcess):
1616 test_subject = 'Test Subject'
1717 test_body = 'Hey,This is draft Message Body from Address Book'
1818
19- @skip_screen_checks
19+ # @skip_screen_checks
2020 @ordered
2121 def test_save_address (self ):
2222 """Saving a new Address On Address Book Screen/Window"""
@@ -28,78 +28,68 @@ def test_save_address(self):
2828 self .drag ("//NavigationItem[@text=\" Sent\" ]" , "//NavigationItem[@text=\" Inbox\" ]" )
2929 # assert for checking scroll function
3030 self .assertCheckScrollDown ('//ContentNavigationDrawer//ScrollView[0]' , timeout = 5 )
31- # this is for opening setting screen
31+ # this is for opening addressbook screen
3232 self .cli .wait_click ('//NavigationItem[@text=\" Address Book\" ]' , timeout = 5 )
3333 # Checking current screen
3434 self .assertExists ("//ScreenManager[@current=\" addressbook\" ]" , timeout = 5 )
3535 # This is for checking the Side nav Bar is closed
3636 self .assertExists ('//MDNavigationDrawer[@status~=\" closed\" ]' , timeout = 5 )
3737 # Check for rendered button
38- self .assertExists ('//MDActionTopAppBarButton [@icon=\" account-plus\" ]' , timeout = 5 )
38+ self .assertExists ('//ActionTopAppBarButton [@icon=\" account-plus\" ]' , timeout = 5 )
3939 # Click on "Account-Plus' Icon to open popup to save a new Address
40- self .cli .wait_click ('//MDActionTopAppBarButton [@icon=\" account-plus\" ]' , timeout = 5 )
40+ self .cli .wait_click ('//ActionTopAppBarButton [@icon=\" account-plus\" ]' , timeout = 5 )
4141 # Checking the Label Field shows Validation for empty string
42- self .assertExists ('//GrashofPopup /BoxLayout[0]/MDTextField[@hint_text=\" Label\" ][@text=\" \" ]' , timeout = 5 )
42+ self .assertExists ('//AddAddressPopup /BoxLayout[0]/MDTextField[@hint_text=\" Label\" ][@text=\" \" ]' , timeout = 5 )
4343 # Checking the Address Field shows Validation for empty string
44- self .assertExists ('//GrashofPopup/BoxLayout[0]/MDTextField[@hint_text=\" Address\" ][@text=\" \" ]' , timeout = 5 )
45- # Click On save Button to check Field validation
46- self .cli .wait_click ('//MDRaisedButton[@text=\" Save\" ]' , timeout = 5 )
44+ self .assertExists ('//AddAddressPopup/BoxLayout[0]/MDTextField[@hint_text=\" Address\" ][@text=\" \" ]' , timeout = 5 )
4745 # Add an address Label to label Field
48- self .cli .setattr ('//GrashofPopup /BoxLayout[0]/MDTextField[@hint_text=\" Label\" ]' , 'text' , self .test_label )
46+ self .cli .setattr ('//AddAddressPopup /BoxLayout[0]/MDTextField[@hint_text=\" Label\" ]' , 'text' , self .test_label )
4947 # Checking the Label Field should not be empty
5048 self .assertExists (
51- '//GrashofPopup/BoxLayout[0]/MDTextField[0][@text=\" {}\" ]' .format (self .test_label ), timeout = 2 )
52- # Add incorrect Address to Address Field to check validation
53- self .cli .setattr (
54- '//GrashofPopup/BoxLayout[0]/MDTextField[@hint_text=\" Address\" ]' ,
55- 'text' , test_address ['invalid_address' ])
56- # Checking the Address Field should not be empty
57- self .assertExists (
58- '//GrashofPopup/BoxLayout[0]/MDTextField[1][@text=\" {}\" ]' .format (test_address ['invalid_address' ]),
59- timeout = 2 )
49+ '//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\" {}\" ]' .format (self .test_label ), timeout = 2 )
6050 # Add Correct Address
6151 self .cli .setattr (
62- '//GrashofPopup /BoxLayout[0]/MDTextField[@hint_text=\" Address\" ]' , 'text' ,
52+ '//AddAddressPopup /BoxLayout[0]/MDTextField[@hint_text=\" Address\" ]' , 'text' ,
6353 test_address ['autoresponder_address' ])
6454 # Checking the Address Field contains correct address
6555 self .assertEqual (
66- self .cli .getattr ('//GrashofPopup /BoxLayout[0]/MDTextField[1][@text]' , 'text' ),
56+ self .cli .getattr ('//AddAddressPopup /BoxLayout[0]/MDTextField[1][@text]' , 'text' ),
6757 test_address ['autoresponder_address' ])
6858 # Validating the Label field
6959 self .assertExists (
70- '//GrashofPopup /BoxLayout[0]/MDTextField[0][@text=\" {}\" ]' .format (self .test_label ), timeout = 2 )
60+ '//AddAddressPopup /BoxLayout[0]/MDTextField[0][@text=\" {}\" ]' .format (self .test_label ), timeout = 2 )
7161 # Validating the Valid Address is entered
7262 self .assertExists (
73- '//GrashofPopup /BoxLayout[0]/MDTextField[1][@text=\" {}\" ]' .format (
63+ '//AddAddressPopup /BoxLayout[0]/MDTextField[1][@text=\" {}\" ]' .format (
7464 test_address ['autoresponder_address' ]), timeout = 3 )
75- # Click on Save Button to save the address in address book
76- self .cli .wait_click ('//MDRaisedButton[@text=\" Save\" ]' , timeout = 2 )
77- # Check Current Screen (Address Book)
65+ # Checking cancel button
66+ self .assertExists ('//MDRaisedButton[@text=\" Cancel\" ]' , timeout = 5 )
67+ # Click on 'Cancel' Button to dismiss the popup
68+ self .cli .wait_click ('//MDRaisedButton[@text=\" Cancel\" ]' , timeout = 2 )
69+ # Checking current screen
7870 self .assertExists ("//ScreenManager[@current=\" addressbook\" ]" , timeout = 5 )
79- # Checking new address should be added
80- self .assertExists ('//SwipeToDeleteItem' , timeout = 5 )
8171
8272 @skip_screen_checks
8373 @ordered
8474 def test_dismiss_addressbook_popup (self ):
8575 """This method is to perform Dismiss add Address popup"""
8676 # Checking the "Address saving" Popup is not opened
87- self .assertNotExists ('//GrashofPopup ' , timeout = 5 )
77+ self .assertNotExists ('//AddAddressPopup ' , timeout = 5 )
8878 # Checking the "Add account" Button is rendered
89- self .assertExists ('//MDActionTopAppBarButton [@icon=\" account-plus\" ]' , timeout = 6 )
79+ self .assertExists ('//ActionTopAppBarButton [@icon=\" account-plus\" ]' , timeout = 6 )
9080 # Click on Account-Plus Icon to open popup for add Address
91- self .cli .wait_click ('//MDActionTopAppBarButton [@icon=\" account-plus\" ]' , timeout = 5 )
81+ self .cli .wait_click ('//ActionTopAppBarButton [@icon=\" account-plus\" ]' , timeout = 5 )
9282 # Add Label to label Field
93- self .cli .setattr ('//GrashofPopup /BoxLayout[0]/MDTextField[0]' , 'text' , 'test_label2' )
83+ self .cli .setattr ('//AddAddressPopup /BoxLayout[0]/MDTextField[0]' , 'text' , 'test_label2' )
9484 # Checking the Label Field should not be empty
9585 self .assertExists (
96- '//GrashofPopup /BoxLayout[0]/MDTextField[0][@text=\" {}\" ]' .format ('test_label2' ), timeout = 2 )
86+ '//AddAddressPopup /BoxLayout[0]/MDTextField[0][@text=\" {}\" ]' .format ('test_label2' ), timeout = 2 )
9787 # Add Address to Address Field
9888 self .cli .setattr (
99- '//GrashofPopup /BoxLayout[0]/MDTextField[1]' , 'text' , test_address ['recipient' ])
89+ '//AddAddressPopup /BoxLayout[0]/MDTextField[1]' , 'text' , test_address ['recipient' ])
10090 # Checking the Address Field should not be empty
10191 self .assertExists (
102- '//GrashofPopup /BoxLayout[0]/MDTextField[1][@text=\" {}\" ]' .format (test_address ['recipient' ]),
92+ '//AddAddressPopup /BoxLayout[0]/MDTextField[1][@text=\" {}\" ]' .format (test_address ['recipient' ]),
10393 timeout = 2 )
10494 # Checking for "Cancel" button is rendered
10595 self .assertExists ('//MDRaisedButton[@text=\" Cancel\" ]' , timeout = 5 )
0 commit comments