inst/app_template/tests/testthat/test-shinytest2.R

library(shinytest2)

test_that("Initial snapshot values are consistent", {
  app <- AppDriver$new(name = "init")
  app$expect_values()
}){{
if (isTRUE(module)) {
HTML('


test_that("Module values are consistent", {
  app <- AppDriver$new(name = "mod")
  app$click("examplemodule1-button")
  app$click("examplemodule1-button")
  app$expect_values()
})')
}
}}

Try the shiny package in your browser

Any scripts or data that you put into this service are public.

shiny documentation built on Nov. 18, 2023, 1:08 a.m.