>
> buster-capture-server provides a test helper module, you should use it to capture slaves.
Forgot to mention - this is what I'm using.
>
> The list of slaves in this promise has the same source as the list of slaves for someServerProcess.slaves(), so it should work.
>
> However, the pubsub client that is created for the non-browser slave is disconnected before the promise for captureSlave() on the test helper is resolved. This will cause the server to consider the slave a "closed browser" in some asynchronous future after the resolve, so you can't reliably do asynchronous stuff and later check .slaves() on the server, it might be gone.
That explains it then. My expectation was that captureSlave would capture a persistent slave.
>
> One fix would be to just use e.slaves, which is a list of the slaves at the time of capture.
I'm integration testing this via the webpage buster-server-cli serves, so that won't work.
>
> Another would be to resolve the captureSlave() promise with a function you can call to manually "close" the mock browser.
That sounds like it would do the trick. Just to be clear - you're thinking of changing the helper now, right?
C
>
> buster-capture-server provides a test helper module, you should use it to capture slaves.Forgot to mention - this is what I'm using.
>
> The list of slaves in this promise has the same source as the list of slaves for someServerProcess.slaves(), so it should work.
>
> However, the pubsub client that is created for the non-browser slave is disconnected before the promise for captureSlave() on the test helper is resolved. This will cause the server to consider the slave a "closed browser" in some asynchronous future after the resolve, so you can't reliably do asynchronous stuff and later check .slaves() on the server, it might be gone.That explains it then. My expectation was that captureSlave would capture a persistent slave.
>
> One fix would be to just use e.slaves, which is a list of the slaves at the time of capture.I'm integration testing this via the webpage buster-server-cli serves, so that won't work.
>
> Another would be to resolve the captureSlave() promise with a function you can call to manually "close" the mock browser.That sounds like it would do the trick. Just to be clear - you're thinking of changing the helper now, right?