@@ -99,12 +99,14 @@ function runAction(action: string, data: JSONValue): string | undefined {
99
99
cy . get ( '.mx_Login_submit' ) . click ( ) ;
100
100
// Try to restore from key backup if needed
101
101
if ( data [ "key_backup_passphrase" ] ) {
102
+ cy . log ( "Restoring from keybackup ..." ) ;
102
103
cy . get ( ".mx_CompleteSecurity_actionRow .mx_AccessibleButton_kind_primary" ) . click ( ) ;
103
104
cy . get ( "#mx_passPhraseInput" ) . clear ( ) . type ( data [ "key_backup_passphrase" ] ) ;
104
105
cy . get ( ".mx_AccessSecretStorageDialog_primaryContainer [data-test-id='dialog-primary-button']" ) . click ( ) ;
105
106
cy . get ( ".mx_CompleteSecurity_actionRow .mx_AccessibleButton_kind_primary" ) . click ( ) ;
106
107
} else {
107
- cy . wait ( 2000 ) . then ( ( ) => {
108
+ cy . log ( "Skipping security popup ..." ) ;
109
+ cy . wait ( 3000 ) . then ( ( ) => {
108
110
Cypress . $ ( ".mx_CompleteSecurity_skip" ) ?. first ( ) ?. trigger ( "click" ) ;
109
111
Cypress . $ ( ".mx_AccessibleButton_kind_danger_outline" ) ?. first ( ) ?. trigger ( "click" ) ;
110
112
} ) ;
@@ -121,14 +123,30 @@ function runAction(action: string, data: JSONValue): string | undefined {
121
123
return "logged_out" ;
122
124
}
123
125
case 'start_crosssign' :
124
- cy . get ( '.mx_CompleteSecurity_actionRow > .mx_AccessibleButton' ) . click ( ) ;
126
+ if ( data ?. [ "userId" ] ) {
127
+ cy . get ( ".mx_RightPanel_roomSummaryButton" ) . click ( ) ;
128
+ cy . get ( ".mx_RoomSummaryCard_icon_people" ) . click ( ) ;
129
+ cy . get ( ".mx_MemberList_query" ) . type ( data [ "userId" ] ) ;
130
+ cy . get ( ".mx_MemberList_wrapper .mx_EntityTile" ) . click ( ) ;
131
+ cy . get ( ".mx_UserInfo_verifyButton" ) . click ( ) ;
132
+ cy . get ( ".mx_UserInfo_startVerification" ) . click ( ) ;
133
+ } else {
134
+ cy . gotoAllSettings ( ) ;
135
+ cy . get ( "[data-testid='settings-tab-USER_SECURITY_TAB']" ) . click ( ) ;
136
+ cy . contains ( "Verify" ) . first ( ) . click ( ) ;
137
+ cy . contains ( "Verify with another device" ) . click ( ) ;
138
+ }
125
139
return 'started_crosssign' ;
126
140
case 'accept_crosssign' :
127
141
// Can we please tag some buttons :)
128
142
// Click 'Verify' when it comes up
129
143
cy . get ( '.mx_Toast_buttons > .mx_AccessibleButton_kind_primary' ) . click ( ) ;
130
144
// Click to move to emoji verification
131
- cy . get ( '.mx_VerificationPanel_QRPhase_startOption > .mx_AccessibleButton' ) . click ( ) ;
145
+ cy . wait ( 1000 ) . then ( ( ) => {
146
+ // Choose whichever exists
147
+ Cypress . $ ( ".mx_VerificationPanel_verifyByEmojiButton" ) ?. trigger ( "click" ) ;
148
+ Cypress . $ ( '.mx_VerificationPanel_QRPhase_startOption > .mx_AccessibleButton' ) ?. trigger ( "click" ) ;
149
+ } ) ;
132
150
return 'accepted_crosssign' ;
133
151
case 'verify_crosssign_emoji' :
134
152
cy . get ( '.mx_VerificationShowSas_buttonRow > .mx_AccessibleButton_kind_primary' ) . click ( ) ;
@@ -151,6 +169,12 @@ function runAction(action: string, data: JSONValue): string | undefined {
151
169
cy . get ( '.mx_Dialog_primary' ) . click ( ) ;
152
170
//cy.get('.mx_RoomHeader_nametext').should('contain', data['name']);
153
171
return "room_created" ;
172
+ case 'create_dm' :
173
+ cy . get ( '.mx_RoomListHeader_plusButton' ) . click ( ) ;
174
+ cy . get ( '.mx_ContextualMenu' ) . contains ( 'Start new chat' ) . click ( ) ;
175
+ cy . get ( '[data-testid="invite-dialog-input"]' ) . type ( `@${ data [ "userId" ] } ` ) ;
176
+ cy . get ( '.mx_InviteDialog_goButton' ) . click ( ) ;
177
+ return "dm_created" ;
154
178
case 'send_message' :
155
179
cy . get ( '.mx_SendMessageComposer div[contenteditable=true]' )
156
180
. click ( )
@@ -206,6 +230,8 @@ function runAction(action: string, data: JSONValue): string | undefined {
206
230
. type ( `@${ data [ "userId" ] } ` )
207
231
. type ( "{enter}" ) ;
208
232
cy . get ( ".mx_InviteDialog_goButton" ) . click ( ) ;
233
+ cy . get ( ".mx_AccessibleButton.mx_BaseCard_back" ) . click ( ) ;
234
+ cy . get ( ".mx_AccessibleButton.mx_BaseCard_close" , { timeout : 30000 } ) . click ( ) ;
209
235
return "invited" ;
210
236
}
211
237
case "open-room" : {
0 commit comments