Shubham - Hey team , customer Am-I is looking t...
# dev-help
s
Hey team , customer Am-I is looking to add some tests to for their embed app such as Ensuring the Liveboard loads successfully in the embedded iframe. Verifying that all visualizations on the Liveboard are rendered correctly. Confirming that filters applied on the Liveboard work as expected and update the data correctly. I initially recommended them using following events - -- for testing liveboard rendering , you can use https://developers.thoughtspot.com/docs/Enumeration_EmbedEvent#_liveboardrendered For ex. .on(EmbedEvent.LiveboardRendered, (payload) => { console.log('.... -- To verify visuals rendered correctly use For https://developers.thoughtspot.com/docs/Enumeration_HostEvent#_download const renderedVizs = []; .on(EmbedEvent.Data, (payload) => ... -- To confirm visuals are loaded correctly use- https://developers.thoughtspot.com/docs/Enumeration_EmbedEvent#_filterchanged .on(EmbedEvent.FilterChanged, (payload) => {... In response  they said , `We use Playwright to write end-to-end tests for our web application, and we're looking for guidance on the best way to test ThoughtSpot Liveboards embedded in our host app. Since the Liveboard is rendered inside an iframe, we want to understand the recommended testing approach and best practices. Specifically, we'd like to know which parts of the embedded Liveboard are stable enough to rely on in E2E tests. For example, are there stable selectors or test IDs we can depend on, and can we reliably verify whether each visualization has rendered correctly? At the moment, we are thinking of using Playwright's frameLocator() to access and interact with the iframe, so any guidance on whether that is the recommended approach would also be helpful.' I have convyed that using selector is subject to change, and events is the most reliable option . What they want is some documented approach around this. Have we helped customer in the past with any documented approach around , if yes please let me know.
a
@Shubham I would suggest to use Embed Event and selectors only for E2Es. It could be that selectors might change with different release but we update selectors when it changes. That's how we also add playwright tests to prevent regressions.
s
@Aditya thank you so much for the response. Can you please confirm if I understood you correctly. since selectors might change , should we be tracking them after every TS update and replace with the new selectors if changed? Can they access events in playwright test to build it? Could you please detaile me a bit if I misunderstood things ?
@Aditya appreciate your help with this. If you can provide any additional info on this would be great or may be an example of such tests developed in the past if possible.