@@ -72,7 +72,7 @@ function runAction(action: string, data: JSONValue): string | undefined {
72
72
switch ( action ) {
73
73
case 'register' :
74
74
cy . visit ( '/#/register' ) ;
75
- cy . get ( '.mx_ServerPicker_change' , { timeout : 15000 } ) . click ( ) ;
75
+ cy . get ( '.mx_ServerPicker_change' ) . click ( ) ;
76
76
cy . get ( '.mx_ServerPickerDialog_continue' ) . should ( 'be.visible' ) ;
77
77
cy . get ( '.mx_ServerPickerDialog_otherHomeserver' ) . type ( data [ 'homeserver_url' ] [ 'local' ] ) ;
78
78
cy . get ( '.mx_ServerPickerDialog_continue' ) . click ( ) ;
@@ -88,7 +88,7 @@ function runAction(action: string, data: JSONValue): string | undefined {
88
88
return 'registered' ;
89
89
case 'login' :
90
90
cy . visit ( '/#/login' ) ;
91
- cy . get ( '#mx_LoginForm_username' , { timeout : 15000 } ) . should ( 'be.visible' ) ;
91
+ cy . get ( '#mx_LoginForm_username' ) . should ( 'be.visible' ) ;
92
92
cy . get ( '.mx_ServerPicker_change' ) . click ( ) ;
93
93
cy . get ( '.mx_ServerPickerDialog_otherHomeserver' ) . clear ( ) . type ( data [ 'homeserver_url' ] [ 'local' ] ) ;
94
94
cy . get ( '.mx_ServerPickerDialog_continue' ) . click ( ) ;
@@ -100,9 +100,9 @@ function runAction(action: string, data: JSONValue): string | undefined {
100
100
// Try to restore from key backup if needed
101
101
if ( data [ "key_backup_passphrase" ] ) {
102
102
cy . log ( "Restoring from keybackup ..." ) ;
103
- cy . get ( ".mx_CompleteSecurity_actionRow .mx_AccessibleButton_kind_primary" ) . click ( ) ;
103
+ cy . get ( ".mx_CompleteSecurity_actionRow .mx_AccessibleButton_kind_primary" ) . last ( ) . click ( ) ;
104
104
cy . get ( "#mx_passPhraseInput" ) . clear ( ) . type ( data [ "key_backup_passphrase" ] ) ;
105
- cy . get ( ".mx_AccessSecretStorageDialog_primaryContainer [data-test-id ='dialog-primary-button']" ) . click ( ) ;
105
+ cy . get ( ".mx_AccessSecretStorageDialog_primaryContainer [data-testid ='dialog-primary-button']" ) . click ( ) ;
106
106
cy . get ( ".mx_CompleteSecurity_actionRow .mx_AccessibleButton_kind_primary" ) . click ( ) ;
107
107
} else {
108
108
cy . log ( "Skipping security popup ..." ) ;
@@ -152,6 +152,13 @@ function runAction(action: string, data: JSONValue): string | undefined {
152
152
cy . get ( '.mx_VerificationShowSas_buttonRow > .mx_AccessibleButton_kind_primary' ) . click ( ) ;
153
153
cy . get ( '.mx_UserInfo_container > .mx_AccessibleButton' ) . click ( ) ;
154
154
return 'verified_crosssign' ;
155
+ case "verify_trusted_device" :
156
+ cy . gotoAllSettings ( ) ;
157
+ cy . get ( "[data-testid='settings-tab-USER_SECURITY_TAB']" ) . click ( ) ;
158
+ // For now, we only care if there are any verified devices
159
+ cy . contains ( / ^ V e r i f i e d d e v i c e s $ / ) ;
160
+ cy . get ( ".mx_DevicesPanel_device" ) . children ( ) ;
161
+ return "verified" ;
155
162
case 'idle' :
156
163
cy . wait ( 5000 ) ;
157
164
break ;
@@ -205,18 +212,18 @@ function runAction(action: string, data: JSONValue): string | undefined {
205
212
cy . get ( "[data-testid='settings-tab-USER_SECURITY_TAB']" ) . click ( ) ;
206
213
cy . get ( ".mx_SecureBackupPanel_buttonRow" ) . contains ( "Set up" ) . click ( ) ;
207
214
cy . get ( ".mx_CreateSecretStorageDialog_optionIcon_securePhrase" ) . click ( ) ;
208
- cy . get ( "[data-test-id ='dialog-primary-button']" ) . click ( ) ;
215
+ cy . get ( ".mx_CreateSecretStorageDialog [data-testid ='dialog-primary-button']" ) . click ( ) ;
209
216
const password = data [ "key_backup_passphrase" ] ;
210
217
if ( ! password ) {
211
218
throw new Error ( "'key_backup_passphrase' not in data for action 'enable_dehydrated_device'" ) ;
212
219
}
213
220
cy . get ( ".mx_CreateSecretStorageDialog_passPhraseContainer input[type='password']" ) . type ( password ) ;
214
- cy . get ( "[data-test-id ='dialog-primary-button']" ) . click ( ) ;
221
+ cy . get ( "[data-testid ='dialog-primary-button']" ) . click ( ) ;
215
222
// confirm the password again
216
223
cy . get ( ".mx_CreateSecretStorageDialog_passPhraseContainer input[type='password']" ) . type ( password ) ;
217
- cy . get ( "[data-test-id ='dialog-primary-button']" ) . click ( ) ;
224
+ cy . get ( "[data-testid ='dialog-primary-button']" ) . click ( ) ;
218
225
// Continue to next screen
219
- cy . get ( "[data-test-id ='dialog-primary-button']" ) . click ( ) ;
226
+ cy . get ( "[data-testid ='dialog-primary-button']" ) . click ( ) ;
220
227
// Classic flakiness fix
221
228
cy . wait ( 500 ) ;
222
229
cy . get ( ".mx_CreateSecretStorageDialog" ) . contains ( "Continue" ) . click ( ) ;
0 commit comments