Packages

Webdriver protocol for driving web browsers.

Current section

Files

Jump to
webdriver lib mix tasks webdriver.ex
Raw

lib/mix/tasks/webdriver.ex

defmodule Mix.Tasks.Webdriver do
defmodule Firefox.Install do
use Mix.Task
@download_url "https://raw.githubusercontent.com/stuart/elixir-webdriver/feature/load_firefox_plugin_task/plugins/firefox/webdriver.xpi"
def run(_) do
Mix.shell.info "Downloading the Firefox Webdriver plugin."
File.mkdir_p Path.dirname(plugin_path)
{data, _} = System.cmd "curl",[@download_url]
:ok = File.write plugin_path, data
Mix.shell.info "Done."
:ok
end
defp plugin_path do
Path.join [__DIR__, "..", "..", "..", "plugins", "firefox","webdriver.xpi"]
end
end
end