Fix flaky Cypress test cypress/e2e/widgets/stickers.spec.ts (#11440)
* Fix tests choosing the wrong room by matching on exact room name in viewRoomByName * Allow either of the two different URLs for thumbnails in sticker test * Find room by looking inside Rooms for something with the right text * Check for the download URL of a thumbnail only, which will appear after the thumbnail 404s * Click the title div instead of the contained span, to avoid clicking something potentially off-screen * Find by label text because that works when room list is folded * Find room by title because label text is different * Attempt to allow opening room by name in all needed cases
This commit is contained in:
parent
9d417cea7c
commit
c6d9228f94
2 changed files with 22 additions and 12 deletions
|
@ -86,10 +86,10 @@ function expectTimelineSticker(roomId: string) {
|
|||
// Make sure it's in the right room
|
||||
cy.get(".mx_EventTile_sticker > a").should("have.attr", "href").and("include", `/${roomId}/`);
|
||||
|
||||
// Make sure the image points at the sticker image
|
||||
cy.get<HTMLImageElement>(`img[alt="${STICKER_NAME}"]`)
|
||||
.should("have.attr", "src")
|
||||
.and("match", /thumbnail\/somewhere\?/);
|
||||
// Make sure the image points at the sticker image. We will briefly show it
|
||||
// using the thumbnail URL, but as soon as that fails, we will switch to the
|
||||
// download URL.
|
||||
cy.get<HTMLImageElement>(`img[alt="${STICKER_NAME}"][src*="download/somewhere"]`).should("exist");
|
||||
}
|
||||
|
||||
describe("Stickers", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue