Cypress tests for read receipts, threaded and unthreaded (#10872)

This commit is contained in:
Andy Balaam 2023-05-12 09:04:33 +01:00 committed by GitHub
parent f758cbd38a
commit 415fcde5e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 169 additions and 5 deletions

View file

@ -102,6 +102,19 @@ declare global {
* @param message the message body to send
*/
botSendMessage(cli: MatrixClient, roomId: string, message: string): Chainable<ISendEventResponse>;
/**
* Send a message as a bot into a room in a specific thread
* @param cli The bot's MatrixClient
* @param threadId the thread within which this message should go
* @param roomId ID of the room to join
* @param message the message body to send
*/
botSendThreadMessage(
cli: MatrixClient,
roomId: string,
threadId: string,
message: string,
): Chainable<ISendEventResponse>;
}
}
}
@ -249,3 +262,16 @@ Cypress.Commands.add(
);
},
);
Cypress.Commands.add(
"botSendThreadMessage",
(cli: MatrixClient, roomId: string, threadId: string, message: string): Chainable<ISendEventResponse> => {
return cy.wrap(
cli.sendMessage(roomId, threadId, {
msgtype: "m.text",
body: message,
}),
{ log: false },
);
},
);