tests/testthat/test-basic.R

skip_on_cran()

library(shinytest2)

test_that("foo", {
  app <- AppDriver$new(app = testthat::test_path("test-apps/basic"))
  # step 1
  app$expect_html(
    selector = "dialog.shepherd-has-title.shepherd-element.shepherd-enabled"
  )
  # step 2
  app$click(selector = "button.shepherd-button:nth-child(2)")
  app$expect_html(
    selector = "dialog.shepherd-has-title.shepherd-element.shepherd-centered.shepherd-enabled"
  )
  # step 3
  app$click(
    selector = "div.shepherd-content:nth-child(1) > footer:nth-child(2) > button:nth-child(2)"
  )
  app$expect_html(selector = "dialog.shepherd-has-title:nth-child(5)")
  # body after tour
  app$click(
    selector = "dialog.shepherd-has-title:nth-child(5) > div:nth-child(2) > footer:nth-child(2) > button:nth-child(2)"
  )
  app$expect_html(selector = "body")
})

Try the conductor package in your browser

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

conductor documentation built on March 16, 2026, 5:08 p.m.