Skip to contents

An app may require special settings for a good screenshot. For example, you would usually only be interested in the Module UI part of apps created by module2app(). module2app() supports this by setting the correct DOM selector and exposing it via the crow_screenshot_args.

Usage

get_screenshot_args_attr(appDir)

Arguments

appDir

The application to run. Should be one of the following:

  • A directory containing server.R, plus, either ui.R or a www directory that contains the file index.html.

  • A directory containing app.R.

  • An .R file containing a Shiny application, ending with an expression that produces a Shiny app object.

  • A list with ui and server components.

  • A Shiny app object created by shinyApp().

Value

A list for the screenshot_args argument of shinytest2::AppDriver's $new() method. If no attribute is found, returns rlang::missing_arg(), to keep shinytest2 defaults intact.

Details

The crow_screenshot_args attribute can be set on whatever object you pass to appDir. It should be a list passable to the screenshot_args argument of shinytest2::AppDriver's $new() method. You can set all sorts of screenshot behavior that way, but same of these settings may break functionality in crow. It is known to work for DOM selection.