Migrate widgets/* from Cypress to Playwright (#12032)

* Migrate send_event.spec.ts from Cypress to Playwright

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

* Migrate read_events.spec.ts from Cypress to Playwright

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

* Migrate kick.spec.ts from Cypress to Playwright

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

* Migrate get-openid-token.spec.ts from Cypress to Playwright

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

* Migrate layout.spec.ts from Cypress to Playwright

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

* Migrate events.spec.ts from Cypress to Playwright

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

* Migrate stickers.spec.ts from Cypress to Playwright

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

* Migrate widget-pip-close.spec.ts from Cypress to Playwright

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

* Fix types

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

* Add screenshot

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

* expect.poll to stabilise test

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-12 17:26:08 +00:00 committed by GitHub
parent 99ca613818
commit c9008152c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1439 additions and 1563 deletions

View file

@ -314,6 +314,54 @@ export class Client {
}, credentials);
}
/**
* Sets account data for the user.
* @param type The type of account data to set
* @param content The content to set
*/
public async setAccountData(type: string, content: IContent): Promise<void> {
const client = await this.prepareClient();
return client.evaluate(
async (client, { type, content }) => {
await client.setAccountData(type, content);
},
{ type, content },
);
}
/**
* Sends a state event into the room.
* @param roomId ID of the room to send the event into
* @param eventType type of event to send
* @param content the event content to send
* @param stateKey the state key to use
*/
public async sendStateEvent(
roomId: string,
eventType: string,
content: IContent,
stateKey?: string,
): Promise<ISendEventResponse> {
const client = await this.prepareClient();
return client.evaluate(
async (client, { roomId, eventType, content, stateKey }) => {
return client.sendStateEvent(roomId, eventType, content, stateKey);
},
{ roomId, eventType, content, stateKey },
);
}
/**
* Leaves the given room.
* @param roomId ID of the room to leave
*/
public async leave(roomId: string): Promise<void> {
const client = await this.prepareClient();
return client.evaluate(async (client, roomId) => {
await client.leave(roomId);
}, roomId);
}
/**
* Sets the directory visibility for a room.
* @param roomId ID of the room to set the directory visibility for