Skip to content

Commit

Permalink
Add selenium test
Browse files Browse the repository at this point in the history
  • Loading branch information
johndharrison committed Dec 8, 2016
1 parent 859b3f7 commit a76cc76
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
1 change: 0 additions & 1 deletion tests/testthat/test-iedriver.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
context("iedriver")

test_that("canCallIEDriver", {
myNP <- normalizePath
with_mock(
`binman::process_yaml` = function(...){},
`binman::list_versions` = function(...){
Expand Down
60 changes: 60 additions & 0 deletions tests/testthat/test-selenium.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
context("selenium")

test_that("canCallSelenium", {
with_mock(
`binman::process_yaml` = function(...){},
`binman::list_versions` = function(...){
list(
generic = c("3.0.0", "3.0.0-beta4", "3.0.1")
)
},
`binman::app_dir` = function(...){
"some.dir"
},
`base::normalizePath` = function(path, winslash, mustWork){
path
},
`base::list.files` = function(...){
"some.path"
},
`subprocess::spawn_process` = function(...){
"hello"
},
`subprocess::process_return_code` = function(...){
NA
},
`base::Sys.info` = function(...){
structure("Windows", .Names = "sysname")
},
# CHROME
`wdman:::chrome_check` = function(...){
list(platform = "some.plat")
},
`wdman:::chrome_ver` = function(...){
list(path = "some.path")
},
# GECKO
`wdman:::gecko_check` = function(...){
list(platform = "some.plat")
},
`wdman:::gecko_ver` = function(...){
list(path = "some.path")
},
# PHANTOMJS
`wdman:::phantom_check` = function(...){
list(platform = "some.plat")
},
`wdman:::phantom_ver` = function(...){
list(path = "some.path")
},
# INTERNET EXPLORER
`wdman:::ie_check` = function(...){
list(platform = "some.plat")
},
`wdman:::ie_ver` = function(...){
list(path = "some.path")
},
selServ <- selenium(iedrver = "latest")
)
expect_identical(selServ$process, "hello")
})

0 comments on commit a76cc76

Please sign in to comment.