playwright icon indicating copy to clipboard operation
playwright copied to clipboard

Testing for SPA with heavy initial load

Open nssidhu opened this issue 1 year ago • 1 comments

I have Blazor WebAssembly app for which initial loads are very time consuming anywhere between 2-5 min depending on connection speeds. And when i try to run the test, say for two or thirty users, each having seperate login, it takes forever to run the test and many times test just times out. My web App is using JWT authentication, so each user will have their own independent login.

Is it possible to cache the initial downloaded files and re-use those downloaded content for other user testing, excluding JWT Token ? Other users would still require different username and password

nssidhu avatar May 15 '23 14:05 nssidhu

If the slow part is fetching the initial load over the network, browser disk cache should help. Unfortunately, that's not implemented yet, see issue #22865.

If the slow part is executing the initial load in the page, then you can only save time by reusing the page between tests. Note that reusing is discouraged, because your tests will not be isolated. You'll have to cleanup state in the page between tests, and probably re-login with different tokens when needed.

dgozman avatar May 15 '23 18:05 dgozman

Closing as per above, in favor of #22865.

dgozman avatar May 19 '23 17:05 dgozman