Migrate most read-receipts tests from Cypress to Playwright (#11994)

* Migrate most read-receipts tests from Cypress to Playwright

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Disable failing test

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2023-12-05 10:37:23 +00:00 committed by GitHub
parent 236ea44cc8
commit b691be3bee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 3603 additions and 3319 deletions

View file

@ -52,6 +52,19 @@ export class Client {
return this.client.evaluate(fn, arg);
}
public evaluateHandle<R, Arg, O extends MatrixClient = MatrixClient>(
pageFunction: PageFunctionOn<O, Arg, R>,
arg: Arg,
): Promise<JSHandle<R>>;
public evaluateHandle<R, O extends MatrixClient = MatrixClient>(
pageFunction: PageFunctionOn<O, void, R>,
arg?: any,
): Promise<JSHandle<R>>;
public async evaluateHandle<T>(fn: (client: MatrixClient) => T, arg?: any): Promise<JSHandle<T>> {
await this.prepareClient();
return this.client.evaluateHandle(fn, arg);
}
/**
* @param roomId ID of the room to send the event into
* @param threadId ID of the thread to send into or null for main timeline
@ -91,6 +104,15 @@ export class Client {
);
}
public async redactEvent(roomId: string, eventId: string, reason?: string): Promise<ISendEventResponse> {
return this.evaluate(
async (client, { roomId, eventId, reason }) => {
return client.redactEvent(roomId, eventId, reason);
},
{ roomId, eventId, reason },
);
}
/**
* Create a room with given options.
* @param options the options to apply when creating the room