Playwright: Convert e2e/threads (#12066)

* Convert tests

* Update comment

* Use addInitScript

* Add thread-id to sendMessage method

* Update screenshot

* Change signature

* Fix prettier
This commit is contained in:
R Midhun Suresh 2024-01-05 15:26:54 +05:30 committed by GitHub
parent fd64eccd4a
commit a8949ea97c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 459 additions and 518 deletions

View file

@ -107,8 +107,13 @@ export class Client {
* Send a message into a room
* @param roomId ID of the room to send the message into
* @param content the event content to send
* @param threadId optional thread id
*/
public async sendMessage(roomId: string, content: IContent | string): Promise<ISendEventResponse> {
public async sendMessage(
roomId: string,
content: IContent | string,
threadId: string | null = null,
): Promise<ISendEventResponse> {
if (typeof content === "string") {
content = {
msgtype: "m.text",
@ -118,12 +123,13 @@ export class Client {
const client = await this.prepareClient();
return client.evaluate(
(client, { roomId, content }) => {
return client.sendMessage(roomId, content);
(client, { roomId, content, threadId }) => {
return client.sendMessage(roomId, threadId, content);
},
{
roomId,
content,
threadId,
},
);
}