code: function tryConnect() {
      if (!seleniumIP) {
          process.nextTick(buildDriver);
          return;
      }
      const sock = net.connect({
          host: seleniumIP,
          port: +seleniumPort,
      });
      sock.on("connect", function() {
          sock.end();
          attempts = 0;
          process.nextTick(buildDriver);
      }).on("error", function() {
          if (++attempts > 50) {
              throw new Error("Failed to connect selenium server.");
          }
          setTimeout(tryConnect, 200);
      });
  }
docs: //////////////////////////////////////////////////////////////////// Wait for container to become ready