title: NSURLErrorDomain: Could not connect to the server
body: <p>I'm following this tutorial to a better understanding of UI test automation and API server mockup: <a href="https://marcosantadev.com/run-swift-ui-tests-mock-api-server/" rel="nofollow noreferrer">https://marcosantadev.com/run-swift-ui-tests-mock-api-server/</a></p>
  
  <p>I have correctly setup launched the local server, using <code>WireMock</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/UnGYw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UnGYw.png" alt="enter image description here"></a></p>
  
  <p>I have also added the allowing insecure HTTP loads lines in <code>Info.plist</code></p>
  
  <pre><code>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
  &lt;dict&gt;
      &lt;key&gt;NSExceptionDomains&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;localhost&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;NSTemporaryExceptionAllowsInsecureHTTPLoads&lt;/key&gt;
              &lt;true/&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
  &lt;/dict&gt;
  </code></pre>
  
  <p>But later when I'm launching the tests, I'm getting this error: </p>
  
  <pre><code>Binding error: Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSUnderlyingError=0x2825bd2f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://localhost:1234/users, NSErrorFailingURLKey=http://localhost:1234/users, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}
  </code></pre>
  
  <p>What am I doing wrong? Thanks for your help.</p>