{% set version = '1.0.5' %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-webdriver
  version: {{ version|replace("-", "_") }}

source:
  fn: webdriver_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/webdriver_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/webdriver/webdriver_{{ version }}.tar.gz
  sha256: eebffc1794b4550b7d58ee527b741bbfe70bec76dde962e79e540ae3def97650

build:
  merge_build_host: True  # [win]
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-r6
    - r-base64enc
    - r-callr >=2.0.0
    - r-curl >=2.0
    - r-debugme
    - r-httr
    - r-jsonlite
    - r-showimage
    - r-withr
    - phantomjs
  run:
    - r-base
    - r-r6
    - r-base64enc
    - r-callr >=2.0.0
    - r-curl >=2.0
    - r-debugme
    - r-httr
    - r-jsonlite
    - r-showimage
    - r-withr
    - phantomjs

test:
  commands:
    - $R -e "library('webdriver')"           # [not win]
    - "\"%R%\" -e \"library('webdriver')\""  # [win]

about:
  home: https://github.com/rstudio/webdriver
  license: MIT
  summary: A client for the 'WebDriver' 'API'. It allows driving a (probably headless) web browser,
    and can be used to test web applications, including 'Shiny' apps. In theory it works
    with any 'WebDriver' implementation, but it was only tested with 'PhantomJS'.
  license_family: MIT

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
