Migrate read-receipts.spec.ts from Cypress to Playwright (#11995)

* Migrate read-receipts.spec.ts from Cypress to Playwright

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

* Update client.ts

* Serialise test message sending

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 13:24:10 +00:00 committed by GitHub
parent 447d2ce415
commit 99b580d501
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 359 additions and 374 deletions

View file

@ -19,14 +19,12 @@ limitations under the License.
import type {
MatrixClient,
Room,
MatrixEvent,
IContent,
FileType,
Upload,
UploadOpts,
ICreateRoomOpts,
ISendEventResponse,
ReceiptType,
} from "matrix-js-sdk/src/matrix";
import Chainable = Cypress.Chainable;
import { UserCredentials } from "./login";
@ -76,13 +74,6 @@ declare global {
eventType: string,
content: IContent,
): Chainable<ISendEventResponse>;
/**
* @param {MatrixEvent} event
* @param {ReceiptType} receiptType
* @param {boolean} unthreaded
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
sendReadReceipt(event: MatrixEvent, receiptType?: ReceiptType, unthreaded?: boolean): Chainable<{}>;
/**
* @param {string} name
* @param {module:client.callback} callback Optional.
@ -209,15 +200,6 @@ Cypress.Commands.add(
},
);
Cypress.Commands.add(
"sendReadReceipt",
(event: MatrixEvent, receiptType?: ReceiptType, unthreaded?: boolean): Chainable<{}> => {
return cy.getClient().then(async (cli: MatrixClient) => {
return cli.sendReadReceipt(event, receiptType, unthreaded);
});
},
);
Cypress.Commands.add("setDisplayName", (name: string): Chainable<{}> => {
return cy.getClient().then(async (cli: MatrixClient) => {
return cli.setDisplayName(name);