Skip to content

Commit

Permalink
v0.2.0 (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke authored Sep 26, 2022
1 parent f3ed1fb commit 1289e35
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 58 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shinytest2
Title: Testing for Shiny Applications
Version: 0.1.1.9000
Version: 0.2.0
Authors@R:
c(
person("Barret", "Schloerke", role = c("cre", "aut"), email = "[email protected]", comment = c(ORCID = "0000-0001-9986-114X")),
Expand Down Expand Up @@ -50,7 +50,8 @@ Suggests:
shinyvalidate (>= 0.1.2),
showimage,
usethis,
vdiffr (>= 1.0.0)
vdiffr (>= 1.0.0),
spelling
Config/Needs/check:
rstudio/shiny
Config/Needs/website:
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shinytest2 (development version)
# shinytest2 0.2.0

## Breaking changes

Expand Down
2 changes: 1 addition & 1 deletion R/app-driver-timeout.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ timeout_value <- function(
option_key,
env_key,
default_value,
timeout_name = checkmate::vname(x)
timeout_name = checkmate::vname(timeout)
) {
# Handle both missing an NULL values
rlang::maybe_missing(timeout, NULL) %||% # user provided
Expand Down
8 changes: 4 additions & 4 deletions R/app-driver.R
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ AppDriver <- R6Class( # nolint
#' * If a [\code{content-disposition} \code{filename}](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) is provided,
#' then a temp file containing this `filename` will be
#' returned.
#' * Otherwise, a tempfile ending in `.download` will be returned.
#' * Otherwise, a temp file ending in `.download` will be returned.
#' @examples
#' \dontrun{
#' app_path <- system.file("examples/10_download", package = "shiny")
Expand Down Expand Up @@ -1677,9 +1677,9 @@ AppDriver <- R6Class( # nolint
#' Typically, this can be paired with a button that when clicked will call
#' `shiny::stopApp(info)` to return `info` from the test app back to the
#' main R session.
#' @param signal_timeout Milliseconds to wait between sending a SIGINT,
#' SIGTERM, and SIGKILL to the Shiny process. Defaults to 500ms and does
#' not utilize the resolved valur from `AppDriver$new(timeout=)`. However,
#' @param signal_timeout Milliseconds to wait between sending a `SIGINT`,
#' `SIGTERM`, and `SIGKILL` to the Shiny process. Defaults to 500ms and does
#' not utilize the resolved value from `AppDriver$new(timeout=)`. However,
#' if \pkg{covr} is currently executing, then the `timeout` is set to
#' 20,000ms to allow for the coverage report to be generated.
#' @return The result of the background process if the Shiny application has
Expand Down
28 changes: 8 additions & 20 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,25 @@
## Comments

#### 2022-09-06
#### 2022-09-19

Releasing a patch to `{shinytest2}` which has documentation by the latest version of `{roxygen2}`.
Many bug fixes and enhancements.

Best,
Barret

#### 2022-08-19

....
R 4.2.0 switched to use HTML5 for documentation pages. Now validation
using HTML Tidy finds problems in the HTML generated from your Rd
files.

To fix, in most cases it suffices to re-generate the Rd files using the
current CRAN version of roxygen2.
....
Please let me know if there is anything else I can provide.

Best,
-k

Barret

## Test environments

* local macOS, R 4.1.3
* r-hub
* GitHub Actions
* macOS
* 4.1
* 4.2
* windows
* 4.1
* 4.2
* ubuntu18
* devel, 4.1, 4.0, 3.6, 3.5, 3.4
* devel, 4.2, 4.1, 4.0, 3.6, 3.5
* devtools::
* check_win_devel()

Expand Down
63 changes: 63 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
AppDriver
CDN
CMD
Chromote
DOI
DOM
DT
DataTable
Devtools
GHA
JS
JSON
Lifecycle
POSIXct
PhantomJS
Prerendered
README
RGBA
Rmd
SIGINT
SIGKILL
SIGTERM
Shiny's
Shinyapps
UI
WebSocket
config
der
doubletap
ession
flexdashboard
htmlwidgets
iframe
incrementing
ing
io
javascript
js
lintr
lockfile
md
milli
mogwais
myfile
plotly
preprocessor
prerendered
prerendering
programmatically
reactives
renderer
renv
repo
reproducibility
selectize
serializable
shinyapps
shinycannon
shinytest
tempfile
testthat
websocket
yaml
8 changes: 4 additions & 4 deletions man/AppDriver.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions revdep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
|collate |en_US.UTF-8 |
|ctype |en_US.UTF-8 |
|tz |America/New_York |
|date |2022-09-06 |
|date |2022-09-19 |
|pandoc |2.19.2 @ /usr/local/bin/pandoc |

# Dependencies

|package |old |new |Δ |
|:-----------|:-----|:--------|:--|
|shinytest2 |0.1.0 |0.1.1 |* |
|shinytest2 |0.1.1 |0.2.0 |* |
|AsioHeaders |NA |1.22.1-1 |* |

# Revdeps
Expand Down
8 changes: 8 additions & 0 deletions tests/spelling.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

if (requireNamespace("spelling", quietly = TRUE)) {
spelling::spell_check_test(
vignettes = TRUE,
error = FALSE,
skip_on_cran = TRUE
)
}
12 changes: 0 additions & 12 deletions tests/testthat/_snaps/app-shiny/app-shiny_app-001.json

This file was deleted.

5 changes: 0 additions & 5 deletions tests/testthat/_snaps/app-shiny/app-shiny_dir-001.json

This file was deleted.

4 changes: 0 additions & 4 deletions tests/testthat/test-app-shiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ test_that("AppDriver can receive a shiny.obj object", {
app$set_inputs(name = "Barret")
app$click("greet")

app$expect_values()

expect_true(fs::path_has_parent(app$get_dir(), tempdir()))
})

Expand All @@ -42,7 +40,5 @@ test_that("AppDriver can receive a shinyAppDir object", {

app$set_inputs(bins = 20)

app$expect_values(input = TRUE)

expect_true(fs::path_has_parent(app$get_dir(), tempdir()))
})
4 changes: 2 additions & 2 deletions vignettes/use-application-audit.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ A load test is composed a three phases:

- Similarly to `{shinytest2}`, `{shinyloadtest}` records a user session with `shinyloadtest::record_session()`.
- This session is subsequently replayed by a Java-based tool, `shinycannon`,
able to simulate multiple sessions during a choosen amount of time.
able to simulate multiple sessions during a chosen amount of time.
- Sessions are analyzed by `shinyloadtest::load_runs()` and an HTML report
generated with `shinyloadtest::shinyloadtest_report()`.

Expand Down Expand Up @@ -315,7 +315,7 @@ We don't forget to clean the target app so as to kill the underlying process.
Note that if you want to deploy the report on GitHub Pages, you have to name it
`index.html`.

### Automating with Github Actions
### Automating with GitHub Actions

Now, it is time to integrate the current pipeline in a CI/CD workflow.
For convenience, we wrap all the previous steps in a single function:
Expand Down
2 changes: 1 addition & 1 deletion vignettes/zzz-faq.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ If your R session is starting to feel more sluggish, you may want to call `app$s

## How can I open the test to see if bookmarks are working?

Testing Shiny bookmarks requires the browser to be loaded with specific query parameters. Luckily, you can use `{shinytest2}` to help you achieve this by running a local `AppDriver` and another `AppDriver` that uses a url with your specific query parameters! ([Original code](https://github.com/rstudio/shinytest2/issues/219#issuecomment-1149162328), [Working example](https://github.com/rstudio/shinytest2/blob/v0.2.0/tests/testthat/apps/download))
Testing Shiny bookmarks requires the browser to be loaded with specific query parameters. Luckily, you can use `{shinytest2}` to help you achieve this by running a local `AppDriver` and another `AppDriver` that uses a url with your specific query parameters! ([Original code](https://github.com/rstudio/shinytest2/issues/219#issuecomment-1149162328), [Working example](https://github.com/rstudio/shinytest2/tree/v0.2.0/tests/testthat/apps/download))

File: `tests/testthat//test-bookmark.R`
```{r}
Expand Down

0 comments on commit 1289e35

Please sign in to comment.