Closed maelle closed 4 years ago
Not really monkey-testing, opening 10 random pages.
library("magrittr") pr <- 672 # or NULL if (is.null(pr)) { destdir <- "public" p <- processx::process$new( "hugo", args = c("server", "--destination", destdir), echo = TRUE ) Sys.sleep(120) dest <- "http://localhost:1313/" } else { dest <- glue::glue("https://deploy-preview-{pr}--ropensci.netlify.app/") } paste0(dest, "/sitemap.xml") %>% xml2::read_xml() %>% xml2::xml_ns_strip() %>% xml2::xml_find_all("//loc") %>% xml2::xml_text() %>%stringr::str_remove("\\/$") -> links purrr::walk(sample(links, 10), browseURL) # p$kill()
Not really monkey-testing, opening 10 random pages.