Skip to content

Commit

Permalink
restored accidentally deleted code
Browse files Browse the repository at this point in the history
restored accidentally deleted codes for page loading reliability and delay. deleted unnecessary line related to docker.
  • Loading branch information
siddhesh195 committed Jun 28, 2024
1 parent 31ba2a3 commit ec0b8a9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tests/testthat/helper-HTML.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ animint2HTML <- function(plotList) {
res <- animint2dir(plotList, out.dir = "animint-htmltest",
open.browser = FALSE)
remDr$refresh()
Sys.sleep(1)
Sys.sleep(2)
res$html <- getHTML()
## [ERROR - 2019-06-05T18:30:55.358Z] Session [e7c4e500-871e-11e9-a9b5-8dab1f486f7e] - page.onError - msg: TypeError: 'undefined' is not an object (evaluating 's_info.type')
## [ERROR - 2019-06-05T18:30:55.360Z] Session [e7c4e500-871e-11e9-a9b5-8dab1f486f7e] - page.onError - stack:
Expand Down Expand Up @@ -47,12 +47,18 @@ tests_init <- function(dir = ".", port = 4848, ...) {
if(OS == "Linux") {
animint_server <- "localhost"
}
if(OS == "Windows" || OS == "Darwin") {
animint_server <- "host.docker.internal"
}

chrome.session <- chromote::ChromoteSession$new()
chrome.session$view()
chrome.session$refresh <- function()chrome.session$Page$reload()
chrome.session$refresh <- function(){
## from https://github.com/rstudio/chromote?tab=readme-ov-file#loading-a-page-reliably
prom <- chrome.session$Page$loadEventFired(wait_ = FALSE) # Get the promise for the loadEventFired
chrome.session$Page$reload()
# Block until p resolves
chrome.session$wait_for(prom)
}


chrome.session$navigate <- function(u){
chrome.session$Page$navigate(u)
}
Expand Down

0 comments on commit ec0b8a9

Please sign in to comment.