Mussel icon indicating copy to clipboard operation
Mussel copied to clipboard

Wait for server request to complete so UI test breakpoints work as expected

Open RobinDaugherty opened this issue 3 years ago • 0 comments

The problem I experienced is:

  1. Set a breakpoint in your UI test right after a call to e.g. MusselUniversalLinkTester.open(link)
  2. UI test runs until breakpoint is reached
  3. Mussel Server never receives the request

This is caused by the fact that URLRequest does work in another queue once the task is resumed, and by setting a breakpoint directly after resuming the task, the other queue never performs the work. The fix is to have Mussel wait until the URLRequest task completes before returning. I did this using a DispatchGroup.

I also added some debugPrint calls so that when the request is complete, there's some evidence of it in the debug logs.

RobinDaugherty avatar Oct 28 '21 17:10 RobinDaugherty