package helpers

import "github.com/sclevine/agouti"

func AgoutiDriver() *agouti.WebDriver {
	return agouti.PhantomJS()
}

package helpers

import (
	"fmt"
	"os"
	"os/exec"

	"github.com/onsi/ginkgo"
	"github.com/sclevine/agouti"
)

func AgoutiDriver() *agouti.WebDriver {
	if _, err := exec.LookPath("phantomjs"); err == nil && os.Getenv("FORCE_SELENIUM") != "true" {
		fmt.Fprintln(ginkgo.GinkgoWriter, "WARNING: using phantomjs, which is flaky in CI, but is more convenient during development")
		return agouti.PhantomJS()
	} else {
		return agouti.Selenium(agouti.Browser("firefox"))
	}
}

Revert "never use selenium ever"
Revert "never use selenium ever"

This reverts commit 2b17348c5eb516d3d5b340c8fd28cc065594d42a.
