You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Migrate audio-player.spec.ts from Cypress to Playwright (#12008)
* Migrate audio-player.spec.ts from Cypress to Playwright Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Stabilise screenshots Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Stabilise bot MXID length Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Stabilise test user MXID Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Stabilise timestamps Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update screenshots Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update element-web-test.ts * Use deterministic monospace font Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
f9b50938de
commit
6199287fe7
@ -211,7 +211,17 @@ export const test = base.extend<
|
||||
});
|
||||
|
||||
export const expect = baseExpect.extend({
|
||||
async toMatchScreenshot(this: ExpectMatcherState, receiver: Page | Locator, ...args) {
|
||||
async toMatchScreenshot(
|
||||
this: ExpectMatcherState,
|
||||
receiver: Page | Locator,
|
||||
name?: `${string}.png`,
|
||||
options?: {
|
||||
mask?: Array<Locator>;
|
||||
omitBackground?: boolean;
|
||||
timeout?: number;
|
||||
css?: string;
|
||||
},
|
||||
) {
|
||||
const page = "page" in receiver ? receiver.page() : receiver;
|
||||
|
||||
// We add a custom style tag before taking screenshots
|
||||
@ -233,10 +243,11 @@ export const expect = baseExpect.extend({
|
||||
.mx_ReplyChain {
|
||||
border-left-color: var(--cpd-color-blue-1200) !important;
|
||||
}
|
||||
${options?.css ?? ""}
|
||||
`,
|
||||
})) as ElementHandle<Element>;
|
||||
|
||||
await baseExpect(receiver).toHaveScreenshot(...args);
|
||||
await baseExpect(receiver).toHaveScreenshot(name, options);
|
||||
|
||||
await style.evaluate((tag) => tag.remove());
|
||||
return { pass: true, message: () => "", name: "toMatchScreenshot" };
|
||||
|
Reference in New Issue
Block a user