dimanche 25 novembre 2018

Using puppeteer to test the frontend of an app that uses websockets

I have a webapp that the majority of its functionality is based on websockets events.

For example:

upon connecting to the websockets server, the server will send the event

{ type: 'server-init', client_id: '1' }

When the client receives that message, it will display the client id on the page.

I would like to test this case using puppeteer - if possible - but I haven't found a reasonable way to mock websockets while using puppeteer.

Any ideas? Is it possible?

Aucun commentaire:

Enregistrer un commentaire