Ents24 / testcafe-browser-provider-fbsimctl

Testcafe browser provider for the iOS Simulator using Facebook's fbsimctl
MIT License
19 stars 7 forks source link

Provider fails to start iOS 8.1 devices #4

Open AndreyBelym opened 7 years ago

AndreyBelym commented 7 years ago

Found it when tried to use fbsimctl:iPhone 4s:iOS 8.1. testcafe hangs for some time, then aborts execution with the Unable to start the browser. ... Command failed: fbsimctl {UUID} boot error . The reason is here: https://github.com/facebook/FBSimulatorControl/issues/368

dig412 commented 7 years ago

This is interesting - one of the reasons I chose fbsimctl is because it will wait for devices to boot before returning. The low-level xcrun simctl tool will just return immediately and you have no idea if you can ask the device to open a URL yet.

I suppose it would be good to catch failures and throw a nicer error back to the user.

Does this happen for you repeatedly? I found that the first time I booted a device it would be very slow, but it would start quickly on the second or third try.

dig412 commented 7 years ago

Ah I see, the Simulator opens correctly (and quite quickly), but fbsimctl keeps waiting, as it is checking for services that will never start on older iOS versions.

Our options are:

  1. Wait for fbsimctl to issue a fix for this
  2. Detect that an iOS version <9 is being booted, and use xcrun simctl boot directly, then check that the desired services start using xcrun spawn launchctl list
AndreyBelym commented 7 years ago

IMHO it would be nice to implement 2. while we are waiting for 1. 😃 I will send a PR, if you are not against it.

dig412 commented 7 years ago

That would be great! I did have a version of this working in an early prototype of the plugin, so if you get stuck / bored / busy let me know and I'll take over.

dig412 commented 7 years ago

I'll leave this open as a reminder to check on fbsimctl's progress - this is fixed by @AndreyBelym in 0.0.4.