element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.03k stars 1.96k forks source link

`percyElementSnapshot` (`percySnapshot`) inside within() #24891

Closed luixxiul closed 5 months ago

luixxiul commented 1 year ago

Steps to reproduce

  1. Run get(…).percyElementSnapshot(…) inside within() to have Percy take snapshots

Outcome

What did you expect?

I expected that percyElementSmapshot() would respect the element specified with get() chained with within().

For example, the command below of https://github.com/matrix-org/matrix-react-sdk/pull/10400 would have Percy take a snapshot of .mx_FilePanel .mx_RoomView_MessageList:

cy.get(".mx_FilePanel").within(() => {

    ...

    cy.get(".mx_RoomView_MessageList").percySnapshotElement("File tiles on FilePanel");
});

What happened instead?

Based on this result, it seems that Percy takes the snapshot of mx_RoomView_MessageList on the main timeline, not on mx_FilePanel. I am not sure if this would be expected, but I assume it is confusing.

Operating system

No response

Browser information

No response

URL for webapp

No response

Application version

No response

Homeserver

No response

Will you send logs?

No

t3chguy commented 5 months ago

Percy tests are gone