participant Test participant Browser participant Mocky Balboa Client participant Mocky Balboa server participant Application server participant MSW participant External API entryspacing 1.0 group Establish client connection Test->Mocky Balboa Client: Create client note over Mocky Balboa Client:Generate client id Mocky Balboa Client->Mocky Balboa server:Establish connection\nwith client id note over Mocky Balboa server:Store connection\nagainst client id Mocky Balboa server->Mocky Balboa Client: Ack client identification Mocky Balboa Client->Test:Client created\nand connection\nestablished end group Setup route handler Test->Test:Setup callback for handling requests to\nhttp://localhost:3000/api/users end group load page note over Test:Visit page in application\nresulting in outbound http\nrequest on the application server parallel Test->Browser:Open browser\n(send client ID in\ncustom request header\nwith all requests) Browser->Application server:Visit page\ne.g. http://localhost:8080 parallel off group External http request note over Application server:Makes call to external API\nto load data for rendering the page parallel Application server->MSW:Outbound http request\nhttp://localhost:3000/api/users MSW-[#888888;1]->>External API: Intercepted by MSW parallel off MSW->Mocky Balboa server:Send request Mocky Balboa server->Mocky Balboa Client:Send request to\ncorrect client Mocky Balboa Client->Test:Resolve response via\ncallback registered earlier Test->Mocky Balboa Client:Return response Mocky Balboa Client->Mocky Balboa server:Respond to request\nvia client Mocky Balboa server->MSW:HTTP response MSW->Application server:HTTP response end Application server->Browser:Respond with HTML for\npage end note over Test:Rest of test body ...