rstudio / shinytest

Automated testing for shiny apps
https://rstudio.github.io/shinytest/
Other
225 stars 55 forks source link

sd_snapshot requires shinytest directory #372

Open samssann opened 3 years ago

samssann commented 3 years ago

Is there a reason why sd_snapshot requires the tests/shinytest directory?

sd_snapshot() --> ShinyDriver$getSnapshotDir() --> sd_getSnapshotDir() --> findTestsDir()

Could the snapshot be saved in the same way that sd_takeScreenshot saves them?

path <- tempfile()
app <- ShinyDriver$new(shinyApp(ui, server))
app$takeScreenshot(path, "plot")
expect_snapshot_file(path, "plot-init.png")

I feel like this would uncomplicate snapshotting when using testthat framework for shiny application unit tests.