Testing websockets server with protractor

I have my own WebSockets server that runs route changes in the AngularJS client. I would like to conduct e2e integration tests using a protractor. Since route change events occur every 30 seconds and include multi-user interactions, it seems that creating a service layout is the best approach. Is there a recommended way to do this in the protractor?

+4
source share
2 answers

I'm not sure if this is exactly what you are looking for, but you can define mock services in Protractor and then load them into the browser using the Protractors browser.addMockModule function. A loaded module will replace the real one that the application will usually use. See the next blog post for more information.

http://eitanp461.blogspot.com/2014/01/advanced-protractor-features.html

+3
source

I recently had a similar problem and decided to use it with addMockModule as above. I wrote a post about this describing my solution.

http://www.functionalimperative.com/2015/04/22/protractor-socket-mocks.html

I found that organizing my code definitely helped when taunting socket modules.

0
source

Source: https://habr.com/ru/post/1534680/


All Articles