rstudio / shinytest2

https://rstudio.github.io/shinytest2/
Other
104 stars 16 forks source link

Chromote is disconnected #331

Closed schloerke closed 1 year ago

schloerke commented 1 year ago

Hi @schloerke, I've run into a wall with this workaround. I just updated the package to see any of these issues have been addressed but it doesn't appear so.

I tried running the app at the console and it encounters the same error as this issue was opened for:

Error in .Call("rs_shinyviewer", url, getwd(), "browser", NULL, PACKAGE = "(embedding)") : 
"rs_shinyviewer" not available for .Call() for package "(embedding)"

However, I'm also now unable to use the terminal session workaround, app$view() results in this error:

image

I've taken a look at the logs for the terminal session and there don't appear to be any R or Javascript errors that would cause it to fail.

I've reset chrome devtools to default settings to no avail. I'm running Chrome Version 111.0.5563.64 (Official Build) (arm64). My coworkers machine does not seem to experience this issue.

Any ideas on how to resolve this? I'm basically SOL on using shinytest2 at all at this point and our testing framework is failing because I can't maintain it due to the bugs with view

Any assistance will be much appreciated πŸ™

`devtools::session_info()` ``` ─ Session info ─────────────────────────────────────────────────────────────────────────────────── setting value version R version 4.2.1 (2022-06-23) os macOS Ventura 13.2.1 system aarch64, darwin20 ui RStudio language (EN) collate en_US.UTF-8 ctype en_US.UTF-8 tz America/New_York date 2023-03-14 rstudio 2022.12.0+353 Elsbeth Geranium (desktop) pandoc 2.19.2 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown) ─ Packages ─────────────────────────────────────────────────────────────────────────────────────── ! package * version date (UTC) lib source assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.2.0) P attempt 0.3.1 2020-05-03 [?] CRAN (R 4.2.0) backports 1.4.1 2021-12-13 [1] CRAN (R 4.2.0) P bit 4.0.4 2020-08-04 [?] CRAN (R 4.2.0) P bit64 4.0.5 2020-08-30 [?] CRAN (R 4.2.0) BOR 0.4.0 2023-01-31 [1] Github (Martin-McCoy/BOR@7ac64a0) brio 1.1.3 2021-11-30 [1] CRAN (R 4.2.0) P bs4Dash 2.2.1 2023-02-11 [?] Github (yogat3ch/bs4Dash@e43aa79) P bslib 0.4.2 2022-12-16 [?] CRAN (R 4.2.0) cachem 1.0.6 2021-08-19 [1] CRAN (R 4.2.0) callr 3.7.2 2022-08-22 [1] CRAN (R 4.2.1) checkmate 2.1.0 2022-04-21 [1] CRAN (R 4.2.0) chromote 0.1.1 2022-09-07 [1] CRAN (R 4.2.0) cicerone 1.0.5.9000 2022-09-29 [1] Github (JohnCoene/cicerone@1f28ea4) P cli 3.6.0 2023-01-09 [?] CRAN (R 4.2.0) P colorspace 2.0-3 2022-02-21 [?] CRAN (R 4.2.0) P config 0.3.1 2020-12-17 [?] CRAN (R 4.2.0) crayon 1.5.2 2022-09-29 [1] CRAN (R 4.2.1) crosstalk 1.2.1 2022-10-26 [1] Github (Martin-McCoy/crosstalk@7f1b582) crssDB 1.0.0 2023-01-31 [1] Github (Martin-McCoy/crssDB@32cd781) P curl 4.3.3 2022-10-06 [?] CRAN (R 4.2.0) data.table 1.14.2 2021-09-27 [1] CRAN (R 4.2.0) DBI 1.1.3 2022-06-18 [1] CRAN (R 4.2.0) P desc 1.4.2 2022-09-08 [?] CRAN (R 4.2.1) devtools 2.4.5 2022-10-11 [1] CRAN (R 4.2.0) P digest 0.6.31 2022-12-11 [?] CRAN (R 4.2.0) P dmdu * 1.1.0 2023-03-03 [?] load_all() P dplyr 1.1.0 2023-01-29 [?] CRAN (R 4.2.0) P DT 0.27 2023-01-17 [?] CRAN (R 4.2.0) P echarts4r 0.4.4 2022-05-28 [?] CRAN (R 4.2.0) echartsUtils 0.4.4 2023-03-09 [1] Github (yogat3ch/echartsUtils@8e62603) echarty 1.4.5 2022-04-01 [1] CRAN (R 4.2.1) P ellipsis 0.3.2 2021-04-29 [?] CRAN (R 4.2.0) english 1.2-6 2021-08-21 [1] CRAN (R 4.2.0) evaluate 0.16 2022-08-09 [1] CRAN (R 4.2.0) P fansi 1.0.3 2022-03-24 [?] CRAN (R 4.2.0) fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.2.0) VP fs 1.5.2 2023-02-06 [?] CRAN (R 4.2.0) (on disk 1.6.1) P generics 0.1.3 2022-07-05 [?] CRAN (R 4.2.0) P ggplot2 3.3.6 2022-05-03 [?] CRAN (R 4.2.0) P glue 1.6.2 2022-02-24 [?] CRAN (R 4.2.0) P golem 0.3.4 2022-09-26 [?] CRAN (R 4.2.0) gtable 0.3.1 2022-09-01 [1] CRAN (R 4.2.0) P hardhat 1.2.0 2022-06-30 [?] CRAN (R 4.2.0) P hms 1.1.2 2022-08-19 [?] CRAN (R 4.2.0) P htmltools 0.5.4 2022-12-07 [?] CRAN (R 4.2.0) htmlwidgets 1.5.4 2021-09-08 [1] CRAN (R 4.2.0) P httpuv 1.6.8 2023-01-12 [?] CRAN (R 4.2.0) httr 1.4.4 2022-08-17 [1] CRAN (R 4.2.0) jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.2.0) P jsonlite 1.8.4 2022-12-06 [?] CRAN (R 4.2.1) knitr 1.40 2022-08-24 [1] CRAN (R 4.2.0) later 1.3.0 2021-08-18 [1] CRAN (R 4.2.0) P lazyeval 0.2.2 2019-03-15 [?] CRAN (R 4.2.0) learnr 0.10.1 2020-02-13 [1] CRAN (R 4.2.0) P lifecycle 1.0.3 2022-10-07 [?] CRAN (R 4.2.0) P lubridate 1.9.0 2022-11-06 [?] CRAN (R 4.2.1) P magrittr 2.0.3 2022-03-30 [?] CRAN (R 4.2.0) markdown 1.1 2019-08-07 [1] CRAN (R 4.2.0) memoise 2.0.1 2021-11-26 [1] CRAN (R 4.2.0) mime 0.12 2021-09-28 [1] CRAN (R 4.2.0) miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 4.2.0) P munsell 0.5.0 2018-06-12 [?] CRAN (R 4.2.0) OpenMCE 1.0.0 2022-11-30 [1] Github (yogat3ch/OpenMCE@ff7549a) P parsnip 1.0.2 2022-10-01 [?] CRAN (R 4.2.0) P pillar 1.8.1 2022-08-19 [?] CRAN (R 4.2.0) pkgbuild 1.3.1 2021-12-20 [1] CRAN (R 4.2.0) P pkgconfig 2.0.3 2019-09-22 [?] CRAN (R 4.2.0) pkgload 1.3.0 2022-06-27 [1] CRAN (R 4.2.0) P plotly 4.10.1 2022-11-07 [?] CRAN (R 4.2.1) P plyr 1.8.7 2022-03-24 [?] CRAN (R 4.2.0) pool 0.1.6 2021-01-14 [1] CRAN (R 4.2.0) P prettyunits 1.1.1 2020-01-24 [?] CRAN (R 4.2.0) processx 3.7.0 2022-07-07 [1] CRAN (R 4.2.0) profvis 0.3.7 2020-11-02 [1] CRAN (R 4.2.0) promises 1.2.0.1 2021-02-11 [1] CRAN (R 4.2.0) ps 1.7.1 2022-06-18 [1] CRAN (R 4.2.0) purrr 1.0.1 2023-01-10 [1] CRAN (R 4.2.0) P R6 2.5.1 2021-08-19 [?] CRAN (R 4.2.0) P RColorBrewer 1.1-3 2022-04-03 [?] CRAN (R 4.2.0) VP Rcpp 1.0.9 2023-01-22 [?] CRAN (R 4.2.0) (on disk 1.0.10) P readr 2.1.2 2022-01-30 [?] CRAN (R 4.2.0) remotes 2.4.2 2021-11-30 [1] CRAN (R 4.2.0) renv 0.16.0 2022-09-29 [1] CRAN (R 4.2.1) P rlang 1.0.6 2022-09-24 [?] CRAN (R 4.2.0) P rmarkdown 2.20 2023-01-19 [?] CRAN (R 4.2.0) RMySQL 0.10.23 2021-12-14 [1] CRAN (R 4.2.0) roxygen2 7.2.1 2022-07-18 [1] CRAN (R 4.2.0) P rpart 4.1.16 2022-01-24 [?] CRAN (R 4.2.1) P rpart.plot 3.1.1 2022-05-21 [?] CRAN (R 4.2.0) rprojroot 2.0.3 2022-04-02 [1] CRAN (R 4.2.0) P rstudioapi 0.14 2022-08-22 [?] CRAN (R 4.2.0) P sass 0.4.5 2023-01-24 [?] CRAN (R 4.2.0) scales 1.2.1 2022-08-20 [1] CRAN (R 4.2.0) sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.2.0) P shiny 1.7.4 2022-12-15 [?] CRAN (R 4.2.0) P shiny.tailwind 0.2.2 2023-02-11 [?] Github (kylebutts/shiny.tailwind@76b7c02) P shinyjs 2.1.0 2021-12-23 [?] CRAN (R 4.2.0) P shinytest2 * 0.2.1.9000 2023-03-14 [?] Github (rstudio/shinytest2@b8fdce6) shinyvalidate 0.1.2 2022-04-21 [1] CRAN (R 4.2.0) shinyVirga 0.20.1 2023-03-06 [1] Github (Martin-McCoy/shinyVirga@267000d) P shinyWidgets 0.7.6 2023-01-08 [?] CRAN (R 4.2.0) snakecase 0.11.0 2019-05-25 [1] CRAN (R 4.2.0) sortable 0.4.6 2022-08-14 [1] CRAN (R 4.2.0) stringi 1.7.8 2022-07-11 [1] CRAN (R 4.2.0) P stringr 1.5.0 2022-12-02 [?] CRAN (R 4.2.0) testthat * 3.1.6 2022-12-09 [1] CRAN (R 4.2.0) P tibble 3.1.8 2022-07-22 [?] CRAN (R 4.2.0) P tidyr 1.2.1 2022-09-08 [?] CRAN (R 4.2.1) tidyrules 0.1.5 2020-06-04 [1] CRAN (R 4.2.0) P tidyselect 1.2.0 2022-10-10 [?] CRAN (R 4.2.0) P timechange 0.1.1 2022-11-04 [?] CRAN (R 4.2.1) P tippy 1.0.0 2023-01-31 [?] Github (JohnCoene/tippy@c3c3a2a) P tzdb 0.3.0 2022-03-28 [?] CRAN (R 4.2.0) urlchecker 1.0.1 2021-11-30 [1] CRAN (R 4.2.0) usethis 2.1.6 2022-05-25 [1] CRAN (R 4.2.0) P utf8 1.2.2 2021-07-24 [?] CRAN (R 4.2.0) UU 1.19.0 2023-03-03 [1] Github (yogat3ch/UU@05f5df3) P vctrs 0.5.2 2023-01-23 [?] CRAN (R 4.2.0) virgaUtils 0.4.0 2023-01-31 [1] Github (Martin-McCoy/virgaUtils@b7477f6) viridisLite 0.4.1 2022-08-22 [1] CRAN (R 4.2.0) P vroom 1.5.7 2021-11-30 [?] CRAN (R 4.2.0) websocket 1.4.1 2021-08-18 [1] CRAN (R 4.2.0) P withr 2.5.0 2022-03-03 [?] CRAN (R 4.2.0) P xfun 0.36 2022-12-21 [?] CRAN (R 4.2.0) xml2 1.3.3 2021-11-30 [1] CRAN (R 4.2.0) xtable 1.8-4 2019-04-21 [1] CRAN (R 4.2.0) yaml 2.3.5 2022-02-21 [1] CRAN (R 4.2.0) P yardstick 1.1.0 2022-09-07 [?] CRAN (R 4.2.0) [1] /Users/stephenholsenbeck/Library/Caches/org.R-project.R/R/renv/library/dmdu-4393acb2/R-4.2/aarch64-apple-darwin20 [2] /Users/stephenholsenbeck/Documents/R/Contributor_Repos/VirgaLabs/dmdu/renv/sandbox/R-4.2/aarch64-apple-darwin20/84ba8b13 V ── Loaded and on-disk version mismatch. P ── Loaded and on-disk path mismatch. ────────────────────────────────────────────────────────────────────────────────────────────────── ```

Originally posted by @yogat3ch in https://github.com/rstudio/shinytest2/issues/271#issuecomment-1468116129

schloerke commented 1 year ago

I can reprex this by starting an AppDriver with a local app. **Investigating

yogat3ch commented 1 year ago

Thanks @schloerke , that's relieving to hear

schloerke commented 1 year ago

Smaller reprex (and unrelated to {shinytest2}):

cs <- chromote::ChromoteSession$new()
cs$view()

Screenshot 2023-03-14 at 12 56 47 PM

No errors are being displayed. No hints of {chromote} not working. 😞

schloerke commented 1 year ago

It looks like ChromoteSession is working... just not $view().

cs <- chromote::ChromoteSession$new()
cs$Page$navigate("http://www.google.com")
file <- cs$screenshot()
showimage::show_image(file)

screenshot

This is relieving! 😌 So not crippled, just slower to debug

schloerke commented 1 year ago

I don't see any errors from googling, but that doesn't mean that one exists.

I hope this resolves naturally. Will keep the issue open until more information is found.


@wch chromote::ChromoteSession's $view() is broken. The ChromoteSession works, but $view() turns up a Websocket disconnected message. Nothing has changed in our code. Only updates within Google Chrome. Hopefully time will fix it for {chromote}.

chromote::ChromoteSession$new()$Browser$getVersion()
#> $protocolVersion
#> [1] "1.3"
#> 
#> $product
#> [1] "HeadlessChrome/111.0.5563.64"
#> 
#> $revision
#> [1] "@c710e93d5b63b7095afe8c2c17df34408078439d"
#> 
#> $userAgent
#> [1] "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/111.0.5563.64 Safari/537.36"
#> 
#> $jsVersion
#> [1] "11.1.277.13"
yogat3ch commented 1 year ago

Just reported via Chrome (Alt + Shift + Cmd + I):

chrome
wch commented 1 year ago

I found more information about this in https://github.com/rstudio/chromote/issues/99#issuecomment-1475105814.

I made a workaround for testing in rstudio/chromote#100. You can try it with:

remotes::install_github("rstudio/chromote@origin-testfix")

It will be replaced with a better fix in the future.

wch commented 1 year ago

There is now an improved fix (https://github.com/rstudio/chromote/pull/101) for this in the main branch of chromote.

remotes::install_github("rstudio/chromote")
yogat3ch commented 1 year ago

There is now an improved fix (rstudio/chromote#101) for this in the main branch of chromote.

remotes::install_github("rstudio/chromote")

Awesome, thank you @wch !

@tommywhitney, this should allow forward motion on the shiny tests again!

mjfrigaard commented 1 year ago

Chromium <> shinytest2 issue

Hi there,

Not sure if this is the same issue, but I ran into a similar error while running tests in shinytest2 recently (and landed here when looking for a fix).

  1. I installed Chromium via homebrew and dev version of chromote
==> Downloading https://download-chromium.appspot.com/dl/Mac?type=snapshots
==> Downloading from https://commondatastorage.googleapis.com/chromium-browser-s
######################################################################### 100.0%
Warning: No checksum defined for cask 'chromium', skipping verification.
==> Installing Cask chromium
==> Moving App 'Chromium.app' to '/Applications/Chromium.app'
==> Linking Binary 'chromium.wrapper.sh' to '/usr/local/bin/chromium'
🍺  chromium was successfully installed!
remotes::install_github("rstudio/chromote")
library(chromote)
  1. Located Chromium
chromote::find_chrome()
[1] "/Applications/Chromium.app/Contents/MacOS/Chromium"
Sys.setenv(CHROMOTE_CHROME = "/Applications/Chromium.app/Contents/MacOS/Chromium")
  1. Created new session
b <- ChromoteSession$new()
b$view()

Then I see the following:

Alsoβ€”the same issue arises in shinytest2 when using app driver in console:

  1. With the following app folder (from this example):
β”œβ”€β”€ app.R
β”œβ”€β”€ greet.Rproj
└── tests
    β”œβ”€β”€ testthat
    β”‚   β”œβ”€β”€ _snaps
    β”‚   β”‚   └── shinytest2
    β”‚   β”‚       β”œβ”€β”€ hello-barret-001.json
    β”‚   β”‚       └── hello-barret-001_.png
    β”‚   β”œβ”€β”€ setup-shinytest2.R
    β”‚   └── test-shinytest2.R
    └── testthat.R

5 directories, 7 files

And the contents of test-shinytest2.R containing:

library(shinytest2)

test_that("{shinytest2} recording: hello-barret", {
  app <- AppDriver$new(name = "hello-barret", height = 483, width = 862)
  app$set_inputs(name = "Barret")
  app$click("greet")
  app$expect_values()
})

When I attempt to run the following in the console,

app <- AppDriver$new(name = "hello-barret", height = 483, width = 862)
app$view()

My apologies is this issue is redundant and addressed elsewhere! Thank you for your hard work on these amazing tools!

sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.2.3 (2023-03-15)
 os       macOS Ventura 13.3.1
 system   x86_64, darwin17.0
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/Los_Angeles
 date     2023-04-30
 rstudio  2023.03.0+386 Cherry Blossom (desktop)
 pandoc   NA

─ Packages ──────────────────────────────────────────────────────────────────
 ! package     * version date (UTC) lib source
   backports     1.4.1   2021-12-13 [1] CRAN (R 4.2.0)
   brio          1.1.3   2021-11-30 [1] CRAN (R 4.2.0)
   callr         3.7.3   2022-11-02 [1] CRAN (R 4.2.0)
   checkmate     2.2.0   2023-04-27 [1] CRAN (R 4.2.3)
 V chromote    * 0.1.1   2023-04-30 [1] Github (rstudio/chromote@c4cad74) (on disk 0.1.1.9001)
   cli           3.6.1   2023-03-23 [1] CRAN (R 4.2.2)
   crayon        1.5.2   2022-09-29 [1] CRAN (R 4.2.0)
   curl          5.0.0   2023-01-12 [1] CRAN (R 4.2.0)
   desc          1.4.2   2022-09-08 [1] CRAN (R 4.2.0)
   digest        0.6.31  2022-12-11 [1] CRAN (R 4.2.0)
   ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.2.0)
   fansi         1.0.4   2023-01-22 [1] CRAN (R 4.2.2)
   fastmap       1.1.1   2023-02-24 [1] CRAN (R 4.2.0)
   fs            1.6.2   2023-04-25 [1] CRAN (R 4.2.3)
   glue          1.6.2   2022-02-24 [1] CRAN (R 4.2.0)
   htmltools     0.5.5   2023-03-23 [1] CRAN (R 4.2.2)
   httpuv        1.6.9   2023-02-14 [1] CRAN (R 4.2.2)
   httr          1.4.5   2023-02-24 [1] CRAN (R 4.2.0)
   jsonlite      1.8.4   2022-12-06 [1] CRAN (R 4.2.2)
   later         1.3.0   2021-08-18 [1] CRAN (R 4.2.0)
   lifecycle     1.0.3   2022-10-07 [1] CRAN (R 4.2.0)
   magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.2.0)
   mime          0.12    2021-09-28 [1] CRAN (R 4.2.0)
   pillar        1.9.0   2023-03-22 [1] CRAN (R 4.2.0)
   pkgbuild      1.4.0   2022-11-27 [1] CRAN (R 4.2.0)
   pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 4.2.0)
   prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.2.0)
   processx      3.8.1   2023-04-18 [1] CRAN (R 4.2.0)
   promises      1.2.0.1 2021-02-11 [1] CRAN (R 4.2.0)
   ps            1.7.5   2023-04-18 [1] CRAN (R 4.2.0)
   R6            2.5.1   2021-08-19 [1] CRAN (R 4.2.0)
   Rcpp          1.0.10  2023-01-22 [1] CRAN (R 4.2.0)
   remotes       2.4.2   2021-11-30 [1] CRAN (R 4.2.0)
   rlang         1.1.1   2023-04-28 [1] CRAN (R 4.2.0)
   rprojroot     2.0.3   2022-04-02 [1] CRAN (R 4.2.0)
   rstudioapi    0.14    2022-08-22 [1] CRAN (R 4.2.0)
   sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.2.0)
   shiny         1.7.4   2022-12-15 [1] CRAN (R 4.2.0)
   shinytest2  * 0.2.1   2023-02-21 [1] CRAN (R 4.2.0)
   testthat    * 3.1.7   2023-03-12 [1] CRAN (R 4.2.0)
   tibble        3.2.1   2023-03-20 [1] CRAN (R 4.2.0)
   utf8          1.2.3   2023-01-31 [1] CRAN (R 4.2.2)
   vctrs         0.6.2   2023-04-19 [1] CRAN (R 4.2.0)
   websocket     1.4.1   2021-08-18 [1] CRAN (R 4.2.0)
   withr         2.5.0   2022-03-03 [1] CRAN (R 4.2.0)
   xtable        1.8-4   2019-04-21 [1] CRAN (R 4.2.0)

 [1] /Library/Frameworks/R.framework/Versions/4.2/Resources/library

EDIT: here is a GitHub repo with the files I used in this issue.

gadenbuie commented 1 year ago

@mjfrigaard thanks for being detailed in your issue! From your session info I can see what's most likely the problem.

─ Packages ──────────────────────────────────────────────────────────────────
 ! package     * version date (UTC) lib source
# ...
 V chromote    * 0.1.1   2023-04-30 [1] Github (rstudio/chromote@c4cad74) (on disk 0.1.1.9001)
# ...

That line indicates that you have installed chromote 0.1.1.9001 but are currently using chromote 0.1.1. Restart your R session and try again. If that doesn't work, it'd be helpful to see the error printed in the R console.

mjfrigaard commented 1 year ago

@gadenbuie thank you for catching that! I guess that's what happens when you try to debug at 2:00am lol :)

image

All fixed!

And thank you and @wch for all your had work on this!

evanglass commented 1 year ago

Hi, I appear to be facing a similar issue even with the newest version of chromote installed with remotes::install_github("rstudio/chromote") and the session reloaded.

When I run the following in the R console with my app project opened, it succeeds in connecting to Chrome.

library(shinytest2)

test_that("app_view_in_test", {
  app <- AppDriver$new()
  app$view()
})

However, when I run it using the Run Tests button in RStudio, it fails with the same WebSocket Disconnected error

image

I also tried installing the latest shinytest2 version, but that didn't seem to help either.

devtools::session_info() in Run Tests
``` - Session info --------------------------------------------------------------- setting value version R version 4.1.1 (2021-08-10) os Windows 10 x64 (build 19045) system x86_64, mingw32 ui RTerm language (EN) collate English_United States.1252 ctype English_United States.1252 tz America/Los_Angeles date 2023-05-10 pandoc NA - Packages ------------------------------------------------------------------- ! package * version date (UTC) lib source P brio 1.1.3 2021-11-30 [?] CRAN (R 4.1.3) P bslib 0.4.2 2022-12-16 [?] CRAN (R 4.1.3) P cachem 1.0.6 2021-08-19 [?] CRAN (R 4.1.3) P callr 3.7.3 2022-11-02 [?] CRAN (R 4.1.3) P cli 3.5.0 2022-12-20 [?] CRAN (R 4.1.3) P codetools 0.2-18 2020-11-04 [3] CRAN (R 4.1.1) colorspace 2.0-3 2022-02-21 [1] CRAN (R 4.1.3) colourpicker * 1.2.0 2022-10-28 [1] CRAN (R 4.1.3) P crayon 1.5.2 2022-09-29 [?] CRAN (R 4.1.3) data.table 1.14.6 2022-11-16 [1] CRAN (R 4.1.1) P desc 1.4.2 2022-09-08 [?] CRAN (R 4.1.3) P devtools 2.4.5 2022-10-11 [?] CRAN (R 4.1.1) P digest 0.6.31 2022-12-11 [?] CRAN (R 4.1.3) dplyr * 1.0.7 2021-06-18 [1] CRAN (R 4.1.2) DT * 0.18 2021-04-14 [1] CRAN (R 4.1.1) P ellipsis 0.3.2 2021-04-29 [?] CRAN (R 4.1.3) P fansi 1.0.3 2022-03-24 [?] CRAN (R 4.1.3) P fastmap 1.1.0 2021-01-25 [?] CRAN (R 4.1.3) P foreach 1.5.2 2022-02-02 [?] CRAN (R 4.1.3) P fs 1.5.2 2021-12-08 [?] CRAN (R 4.1.3) P generics 0.1.3 2022-07-05 [?] CRAN (R 4.1.3) P ggplot2 * 3.3.5 2021-06-25 [?] CRAN (R 4.1.3) P glue 1.6.2 2022-02-24 [?] CRAN (R 4.1.3) P gtable 0.3.1 2022-09-01 [?] CRAN (R 4.1.3) P hms 1.1.2 2022-08-19 [?] CRAN (R 4.1.3) P htmltools 0.5.4 2022-12-07 [?] CRAN (R 4.1.3) htmlwidgets 1.6.0 2022-12-15 [1] CRAN (R 4.1.1) P httpuv 1.6.7 2022-12-14 [?] CRAN (R 4.1.1) P httr 1.4.4 2022-08-17 [?] CRAN (R 4.1.3) P iterators 1.0.14 2022-02-05 [?] CRAN (R 4.1.3) P jquerylib 0.1.4 2021-04-26 [?] CRAN (R 4.1.3) P jsonlite 1.8.4 2022-12-06 [?] CRAN (R 4.1.3) P later 1.3.0 2021-08-18 [?] CRAN (R 4.1.3) P lattice 0.20-45 2021-09-22 [?] CRAN (R 4.1.3) P lazyeval 0.2.2 2019-03-15 [?] CRAN (R 4.1.3) P lifecycle 1.0.3 2022-10-07 [?] CRAN (R 4.1.3) P magrittr 2.0.3 2022-03-30 [?] CRAN (R 4.1.3) markdown * 1.1 2019-08-07 [1] CRAN (R 4.1.3) P Matrix 1.5-3 2022-11-11 [?] CRAN (R 4.1.3) P memoise 2.0.1 2021-11-26 [?] CRAN (R 4.1.3) P mime 0.12 2021-09-28 [?] CRAN (R 4.1.1) P miniUI 0.1.1.1 2018-05-18 [?] CRAN (R 4.1.3) P munsell 0.5.0 2018-06-12 [?] CRAN (R 4.1.3) P pillar 1.8.1 2022-08-19 [?] CRAN (R 4.1.3) P pkgbuild 1.4.0 2022-11-27 [?] CRAN (R 4.1.3) P pkgconfig 2.0.3 2019-09-22 [?] CRAN (R 4.1.3) P pkgload 1.3.2 2022-11-16 [?] CRAN (R 4.1.3) P plotly * 4.10.1 2022-11-07 [?] CRAN (R 4.1.3) P plyr 1.8.8 2022-11-11 [?] CRAN (R 4.1.3) P pmartR * 2.3.0 2023-02-28 [?] Github (pmartR/pmartR@5d9dd77) R pmartR-shiny * 0.0.0.1 [?] P png 0.1-8 2022-11-29 [?] CRAN (R 4.1.3) P prettyunits 1.1.1 2020-01-24 [?] CRAN (R 4.1.3) P processx 3.8.1 2023-04-18 [?] CRAN (R 4.1.3) P profvis 0.3.8 2023-05-02 [?] CRAN (R 4.1.1) P promises 1.2.0.1 2021-02-11 [?] CRAN (R 4.1.3) P ps 1.7.5 2023-04-18 [?] CRAN (R 4.1.3) purrr * 0.3.4 2020-04-17 [1] CRAN (R 4.1.3) P R6 2.5.1 2021-08-19 [?] CRAN (R 4.1.3) P Rcpp 1.0.9 2022-07-08 [?] CRAN (R 4.1.3) readr * 2.0.1 2021-08-10 [1] CRAN (R 4.1.1) P remotes 2.4.2 2021-11-30 [?] CRAN (R 4.1.3) renv * 0.16.0 2022-09-29 [1] CRAN (R 4.1.3) P reshape2 * 1.4.4 2020-04-09 [?] CRAN (R 4.1.3) reticulate * 1.26 2022-08-31 [1] CRAN (R 4.1.1) P rlang * 1.1.0 2023-03-14 [?] CRAN (R 4.1.1) P rprojroot 2.0.3 2022-04-02 [?] CRAN (R 4.1.3) P rstudioapi 0.14 2022-08-22 [?] CRAN (R 4.1.3) P sass 0.4.4 2022-11-24 [?] CRAN (R 4.1.3) P scales 1.2.1 2022-08-20 [?] CRAN (R 4.1.3) P sessioninfo 1.2.2 2021-12-06 [?] CRAN (R 4.1.3) P shiny * 1.6.0 2021-01-25 [?] CRAN (R 4.1.1) P shinyalert * 3.0.0 2021-12-20 [?] CRAN (R 4.1.3) shinyBS * 0.61 2015-03-31 [1] CRAN (R 4.1.3) P shinycssloaders * 1.0.0 2020-07-28 [?] CRAN (R 4.1.3) shinyjs * 2.0.0 2020-09-09 [1] CRAN (R 4.1.2) shinytest2 * 0.2.1.9000 2023-05-10 [1] Github (rstudio/shinytest2@6850de4) shinyWidgets * 0.6.0 2021-03-15 [1] CRAN (R 4.1.1) P stringi 1.7.8 2022-07-11 [?] CRAN (R 4.1.1) P stringr * 1.4.0 2019-02-10 [?] CRAN (R 4.1.3) testthat * 3.1.8 2023-05-04 [1] CRAN (R 4.1.1) P tibble 3.1.8 2022-07-22 [?] CRAN (R 4.1.3) P tidyr 1.2.1 2022-09-08 [?] CRAN (R 4.1.1) P tidyselect 1.2.0 2022-10-10 [?] CRAN (R 4.1.1) P tzdb 0.3.0 2022-03-28 [?] CRAN (R 4.1.3) P urlchecker 1.0.1 2021-11-30 [?] CRAN (R 4.1.3) P usethis 2.1.6 2022-05-25 [?] CRAN (R 4.1.3) P utf8 1.2.2 2021-07-24 [?] CRAN (R 4.1.3) P vctrs 0.5.1 2022-11-16 [?] CRAN (R 4.1.1) P viridisLite 0.4.1 2022-08-22 [?] CRAN (R 4.1.3) P withr 2.5.0 2022-03-03 [?] CRAN (R 4.1.3) P xtable 1.8-4 2019-04-21 [?] CRAN (R 4.1.3) P yaml * 2.2.1 2020-02-01 [?] CRAN (R 4.1.1) [1] C:/Users/glas137/AppData/Local/R/cache/R/renv/library/pmart_standalone-30a65451/R-4.1/x86_64-w64-mingw32 [2] C:/Users/glas137/AppData/Local/Temp/RtmpoHY3Mh/renv-system-library [3] C:/Program Files/R/R-4.1.1/library P -- Loaded and on-disk path mismatch. R -- Package was removed from disk. ------------------------------------------------------------------------------ ```
gadenbuie commented 1 year ago

@evanglass Can you try restarting your R session and trying again? Unfortunately, your session info doesn't include chromote, so I can't see which version you have installed (or loaded in your session), but I do see lots of indications that your current session is out of sync with your system's installed packages. Also, with the latest version of chromote you should get a different error message than with the previous version, so it'd be useful to include that in your update.

evanglass commented 1 year ago

The session was restarted. I'm not sure why chromote isn't showing up in the list. For reference, here's the code I was running to get the session info:

library(shinytest2)

test_that("app_view_in_test", {
  print(devtools::session_info())
  app <- AppDriver$new()
  app$view()
})

Adding library(chromote) to the top as well adds it to the list:

chromote * 0.1.1.9001 2023-05-10 [1] Github (rstudio/chromote@c4cad74)

but the problem persists.

EDIT: Also, the package desync is likely because I am using renv for managing the packages for my app.

gadenbuie commented 1 year ago

Can you report which version of Chrome you have installed?

chromote::ChromoteSession$new()$Browser$getVersion()

Can you also try opening a chromote session directly, which will hopefully return a more detailed error message?

cs <- chromote::ChromoteSession$new()
cs$view()
evanglass commented 1 year ago

chromote::ChromoteSession$new()$Browser$getVersion() :

$protocolVersion
[1] "1.3"

$product
[1] "HeadlessChrome/113.0.5672.93"

$revision
[1] "@b6f521170062a1fa8a82c33fb223b06fec566da1"

$userAgent
[1] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/113.0.5672.93 Safari/537.36"

$jsVersion
[1] "11.3.244.8"

Running the second code box you provided using Run Tests results in an empty page with no error message visible on the page or in RStudio. Running it in the console succeeds in opening the normal devtools.

gadenbuie commented 1 year ago

Thanks @evanglass

Running the second code box you provided using Run Tests results in an empty page with no error message visible on the page or in RStudio.

I'm not completely certain I know what you mean, but this sounds expected? Or at least, if you were encountering the problem seen with chromote < 0.1.1.9001 I'd expect another WebSocket disconnected error.

Picking up on something you said earlier, I wonder if you're now encountering some kind of environmental mismatch.

Also, the package desync is likely because I am using renv for managing the packages for my app.

So in https://github.com/rstudio/shinytest2/issues/331#issuecomment-1542794478 when you said the problem still persists, are you sure renv is not using an earlier version of chromote?

evanglass commented 1 year ago

I'm not completely certain I know what you mean, but this sounds expected? Or at least, if you were encountering the problem seen with chromote < 0.1.1.9001 I'd expect another WebSocket disconnected error.

It is just a completely blank page: image

So in #331 (comment) when you said the problem still persists, are you sure renv is not using an earlier version of chromote?

Yes. Just to make sure, I completely uninstalled R, installed R 4.3.0 release, reinstalled all the packages necessary without renv, and it still has the same behavior.

devtools::session_info()
``` ─ Session info ─────────────────────────────────────────────────────────────── setting value version R version 4.3.0 (2023-04-21 ucrt) os Windows 10 x64 (build 19045) system x86_64, mingw32 ui RTerm language (EN) collate English_United States.utf8 ctype English_United States.utf8 tz America/Los_Angeles date 2023-05-11 pandoc NA ─ Packages ─────────────────────────────────────────────────────────────────── ! package * version date (UTC) lib source brio 1.1.3 2021-11-30 [1] CRAN (R 4.3.0) bslib 0.4.2 2022-12-16 [1] CRAN (R 4.3.0) cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.0) callr 3.7.3 2022-11-02 [1] CRAN (R 4.3.0) chromote * 0.1.1.9001 2023-05-11 [1] Github (rstudio/chromote@c4cad74) cli 3.6.1 2023-03-23 [1] CRAN (R 4.3.0) codetools 0.2-19 2023-02-01 [2] CRAN (R 4.3.0) colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.3.0) colourpicker * 1.2.0 2022-10-28 [1] CRAN (R 4.3.0) crayon 1.5.2 2022-09-29 [1] CRAN (R 4.3.0) data.table 1.14.8 2023-02-17 [1] CRAN (R 4.3.0) desc 1.4.2 2022-09-08 [1] CRAN (R 4.3.0) devtools 2.4.5 2022-10-11 [1] CRAN (R 4.3.0) digest 0.6.31 2022-12-11 [1] CRAN (R 4.3.0) dplyr * 1.1.2 2023-04-20 [1] CRAN (R 4.3.0) DT * 0.27 2023-01-17 [1] CRAN (R 4.3.0) ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.3.0) fansi 1.0.4 2023-01-22 [1] CRAN (R 4.3.0) fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0) foreach 1.5.2 2022-02-02 [1] CRAN (R 4.3.0) fs 1.6.2 2023-04-25 [1] CRAN (R 4.3.0) generics 0.1.3 2022-07-05 [1] CRAN (R 4.3.0) ggplot2 * 3.4.2 2023-04-03 [1] CRAN (R 4.3.0) glue 1.6.2 2022-02-24 [1] CRAN (R 4.3.0) gtable 0.3.3 2023-03-21 [1] CRAN (R 4.3.0) hms 1.1.3 2023-03-21 [1] CRAN (R 4.3.0) htmltools 0.5.5 2023-03-23 [1] CRAN (R 4.3.0) htmlwidgets 1.6.2 2023-03-17 [1] CRAN (R 4.3.0) httpuv 1.6.10 2023-05-08 [1] CRAN (R 4.3.0) httr 1.4.6 2023-05-08 [1] CRAN (R 4.3.0) iterators 1.0.14 2022-02-05 [1] CRAN (R 4.3.0) jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.3.0) jsonlite 1.8.4 2022-12-06 [1] CRAN (R 4.3.0) later 1.3.1 2023-05-02 [1] CRAN (R 4.3.0) lattice 0.21-8 2023-04-05 [1] CRAN (R 4.3.0) lazyeval 0.2.2 2019-03-15 [1] CRAN (R 4.3.0) lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.3.0) magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.0) markdown * 1.6 2023-04-07 [1] CRAN (R 4.3.0) Matrix 1.5-4 2023-04-04 [1] CRAN (R 4.3.0) memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.0) mime 0.12 2021-09-28 [1] CRAN (R 4.3.0) miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 4.3.0) munsell 0.5.0 2018-06-12 [1] CRAN (R 4.3.0) pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.0) pkgbuild 1.4.0 2022-11-27 [1] CRAN (R 4.3.0) pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.0) pkgload 1.3.2 2022-11-16 [1] CRAN (R 4.3.0) plotly * 4.10.1 2022-11-07 [1] CRAN (R 4.3.0) plyr 1.8.8 2022-11-11 [1] CRAN (R 4.3.0) pmartR * 2.3.0 2023-05-11 [1] local (C:\\Users\\glas137\\GitHub\\pmartR_2.3.0.tar.gz) R pmartR-shiny * 0.0.0.1 [?] png 0.1-8 2022-11-29 [1] CRAN (R 4.3.0) prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.3.0) processx 3.8.1 2023-04-18 [1] CRAN (R 4.3.0) profvis 0.3.8 2023-05-02 [1] CRAN (R 4.3.0) promises 1.2.0.1 2021-02-11 [1] CRAN (R 4.3.0) ps 1.7.5 2023-04-18 [1] CRAN (R 4.3.0) purrr * 1.0.1 2023-01-10 [1] CRAN (R 4.3.0) R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0) Rcpp 1.0.10 2023-01-22 [1] CRAN (R 4.3.0) readr * 2.1.4 2023-02-10 [1] CRAN (R 4.3.0) remotes 2.4.2 2021-11-30 [1] CRAN (R 4.3.0) renv * 0.17.3 2023-04-06 [1] CRAN (R 4.3.0) reshape2 * 1.4.4 2020-04-09 [1] CRAN (R 4.3.0) reticulate * 1.28 2023-01-27 [1] CRAN (R 4.3.0) rlang * 1.1.1 2023-04-28 [1] CRAN (R 4.3.0) rprojroot 2.0.3 2022-04-02 [1] CRAN (R 4.3.0) rstudioapi 0.14 2022-08-22 [1] CRAN (R 4.3.0) sass 0.4.6 2023-05-03 [1] CRAN (R 4.3.0) scales 1.2.1 2022-08-20 [1] CRAN (R 4.3.0) sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0) shiny * 1.7.4 2022-12-15 [1] CRAN (R 4.3.0) shinyalert * 3.0.0 2021-12-20 [1] CRAN (R 4.3.0) shinyBS * 0.61.1 2022-04-17 [1] CRAN (R 4.3.0) shinycssloaders * 1.0.0 2020-07-28 [1] CRAN (R 4.3.0) shinyjs * 2.1.0 2021-12-23 [1] CRAN (R 4.3.0) shinytest2 0.2.1.9000 2023-05-11 [1] Github (rstudio/shinytest2@6850de4) shinyWidgets * 0.7.6 2023-01-08 [1] CRAN (R 4.3.0) stringi 1.7.12 2023-01-11 [1] CRAN (R 4.3.0) stringr * 1.5.0 2022-12-02 [1] CRAN (R 4.3.0) testthat * 3.1.8 2023-05-04 [1] CRAN (R 4.3.0) tibble 3.2.1 2023-03-20 [1] CRAN (R 4.3.0) tidyr 1.3.0 2023-01-24 [1] CRAN (R 4.3.0) tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.3.0) tzdb 0.3.0 2022-03-28 [1] CRAN (R 4.3.0) urlchecker 1.0.1 2021-11-30 [1] CRAN (R 4.3.0) usethis 2.1.6 2022-05-25 [1] CRAN (R 4.3.0) utf8 1.2.3 2023-01-31 [1] CRAN (R 4.3.0) vctrs 0.6.2 2023-04-19 [1] CRAN (R 4.3.0) viridisLite 0.4.2 2023-05-02 [1] CRAN (R 4.3.0) websocket 1.4.1 2021-08-18 [1] CRAN (R 4.3.0) withr 2.5.0 2022-03-03 [1] CRAN (R 4.3.0) xtable 1.8-4 2019-04-21 [1] CRAN (R 4.3.0) yaml * 2.3.7 2023-01-23 [1] CRAN (R 4.3.0) [1] C:/Users/glas137/AppData/Local/R/win-library/4.3 [2] C:/Program Files/R/R-4.3.0/library R ── Package was removed from disk. ────────────────────────────────────────────────────────────────────────────── ```
evanglass commented 1 year ago

Well, I don't know exactly what changed, but I reverted to R 4.1.1 which I was using originally, reinstalled all the packages I needed using renv, and to my surprise it works now (with the GitHub version of chromote). Thanks for all your help.

EDIT: I think I found the cause, in the console the AppDriver object is held onto after the test_that finishes, but using Run Tests it immediately deletes it since it's "no longer in use." Adding a delay at the end of the original code I posted makes it show up properly.

``` - Session info --------------------------------------------------------------- setting value version R version 4.1.1 (2021-08-10) os Windows 10 x64 (build 19045) system x86_64, mingw32 ui RTerm language (EN) collate English_United States.1252 ctype English_United States.1252 tz America/Los_Angeles date 2023-05-11 pandoc NA - Packages ------------------------------------------------------------------- ! package * version date (UTC) lib source P backports 1.4.1 2021-12-13 [?] CRAN (R 4.1.2) P brio 1.1.3 2021-11-30 [?] CRAN (R 4.1.3) P bslib 0.4.2 2022-12-16 [?] CRAN (R 4.1.3) P cachem 1.0.6 2021-08-19 [?] CRAN (R 4.1.3) P callr 3.7.3 2022-11-02 [?] CRAN (R 4.1.3) P checkmate 2.2.0 2023-04-27 [?] CRAN (R 4.1.1) P chromote 0.1.1.9001 2023-05-11 [?] Github (rstudio/chromote@c4cad74) P cli 3.5.0 2022-12-20 [?] CRAN (R 4.1.3) P codetools 0.2-18 2020-11-04 [3] CRAN (R 4.1.1) colorspace 2.0-3 2022-02-21 [1] CRAN (R 4.1.3) colourpicker * 1.2.0 2022-10-28 [1] CRAN (R 4.1.3) P crayon 1.5.2 2022-09-29 [?] CRAN (R 4.1.3) P curl 4.3.3 2022-10-06 [?] CRAN (R 4.1.3) data.table 1.14.6 2022-11-16 [1] CRAN (R 4.1.1) P desc 1.4.2 2022-09-08 [?] CRAN (R 4.1.3) P devtools 2.4.5 2022-10-11 [?] CRAN (R 4.1.1) P digest 0.6.31 2022-12-11 [?] CRAN (R 4.1.3) dplyr * 1.0.7 2021-06-18 [1] CRAN (R 4.1.2) DT * 0.18 2021-04-14 [1] CRAN (R 4.1.1) P ellipsis 0.3.2 2021-04-29 [?] CRAN (R 4.1.3) P fansi 1.0.3 2022-03-24 [?] CRAN (R 4.1.3) P fastmap 1.1.0 2021-01-25 [?] CRAN (R 4.1.3) P foreach 1.5.2 2022-02-02 [?] CRAN (R 4.1.3) P fs 1.5.2 2021-12-08 [?] CRAN (R 4.1.3) P generics 0.1.3 2022-07-05 [?] CRAN (R 4.1.3) P ggplot2 * 3.3.5 2021-06-25 [?] CRAN (R 4.1.3) P glue 1.6.2 2022-02-24 [?] CRAN (R 4.1.3) P gtable 0.3.1 2022-09-01 [?] CRAN (R 4.1.3) P here 1.0.1 2020-12-13 [?] CRAN (R 4.1.3) P hms 1.1.2 2022-08-19 [?] CRAN (R 4.1.3) P htmltools 0.5.4 2022-12-07 [?] CRAN (R 4.1.3) htmlwidgets 1.6.0 2022-12-15 [1] CRAN (R 4.1.1) P httpuv 1.6.7 2022-12-14 [?] CRAN (R 4.1.1) P httr 1.4.4 2022-08-17 [?] CRAN (R 4.1.3) P iterators 1.0.14 2022-02-05 [?] CRAN (R 4.1.3) P jquerylib 0.1.4 2021-04-26 [?] CRAN (R 4.1.3) P jsonlite 1.8.4 2022-12-06 [?] CRAN (R 4.1.3) P later 1.3.0 2021-08-18 [?] CRAN (R 4.1.3) P lattice 0.20-45 2021-09-22 [?] CRAN (R 4.1.3) P lazyeval 0.2.2 2019-03-15 [?] CRAN (R 4.1.3) P lifecycle 1.0.3 2022-10-07 [?] CRAN (R 4.1.3) P magrittr 2.0.3 2022-03-30 [?] CRAN (R 4.1.3) mapDataAccess * 0.0.0.10 2023-03-09 [1] local (C:\\Users\\glas137\\GitHub\\mapDataAccess_0.0.0.10.zip) markdown * 1.1 2019-08-07 [1] CRAN (R 4.1.3) P Matrix 1.5-3 2022-11-11 [?] CRAN (R 4.1.3) P memoise 2.0.1 2021-11-26 [?] CRAN (R 4.1.3) P mime 0.12 2021-09-28 [?] CRAN (R 4.1.1) P miniUI 0.1.1.1 2018-05-18 [?] CRAN (R 4.1.3) P munsell 0.5.0 2018-06-12 [?] CRAN (R 4.1.3) P pillar 1.8.1 2022-08-19 [?] CRAN (R 4.1.3) P pingr 2.0.2 2022-10-26 [?] CRAN (R 4.1.3) P pkgbuild 1.4.0 2022-11-27 [?] CRAN (R 4.1.3) P pkgconfig 2.0.3 2019-09-22 [?] CRAN (R 4.1.3) P pkgload 1.3.2 2022-11-16 [?] CRAN (R 4.1.3) P plotly * 4.10.1 2022-11-07 [?] CRAN (R 4.1.3) P plyr 1.8.8 2022-11-11 [?] CRAN (R 4.1.3) P pmartR * 2.3.0 2023-02-28 [?] Github (pmartR/pmartR@5d9dd77) R pmartR-shiny * 0.0.0.1 [?] P png 0.1-8 2022-11-29 [?] CRAN (R 4.1.3) P prettyunits 1.1.1 2020-01-24 [?] CRAN (R 4.1.3) P processx 3.8.1 2023-04-18 [?] CRAN (R 4.1.3) P profvis 0.3.8 2023-05-02 [?] CRAN (R 4.1.1) P promises 1.2.0.1 2021-02-11 [?] CRAN (R 4.1.3) P ps 1.7.5 2023-04-18 [?] CRAN (R 4.1.3) purrr * 0.3.4 2020-04-17 [1] CRAN (R 4.1.3) P R6 2.5.1 2021-08-19 [?] CRAN (R 4.1.3) P rappdirs 0.3.3 2021-01-31 [?] CRAN (R 4.1.3) P Rcpp 1.0.9 2022-07-08 [?] CRAN (R 4.1.3) readr * 2.0.1 2021-08-10 [1] CRAN (R 4.1.1) P remotes 2.4.2 2021-11-30 [?] CRAN (R 4.1.3) P renv * 0.16.0 2022-09-29 [?] CRAN (R 4.1.3) P reshape2 * 1.4.4 2020-04-09 [?] CRAN (R 4.1.3) reticulate * 1.26 2022-08-31 [1] CRAN (R 4.1.1) P rlang * 1.1.0 2023-03-14 [?] CRAN (R 4.1.1) P rprojroot 2.0.3 2022-04-02 [?] CRAN (R 4.1.3) P rstudioapi 0.14 2022-08-22 [?] CRAN (R 4.1.3) P sass 0.4.4 2022-11-24 [?] CRAN (R 4.1.3) P scales 1.2.1 2022-08-20 [?] CRAN (R 4.1.3) P sessioninfo 1.2.2 2021-12-06 [?] CRAN (R 4.1.3) P shiny * 1.6.0 2021-01-25 [?] CRAN (R 4.1.1) P shinyalert * 2.0.0 2020-09-12 [?] CRAN (R 4.1.2) shinyBS * 0.61 2015-03-31 [1] CRAN (R 4.1.3) P shinycssloaders * 1.0.0 2020-07-28 [?] CRAN (R 4.1.3) shinyjs * 2.0.0 2020-09-09 [1] CRAN (R 4.1.2) P shinytest2 * 0.2.1 2023-02-21 [?] CRAN (R 4.1.3) shinyWidgets * 0.6.0 2021-03-15 [1] CRAN (R 4.1.1) P stringi 1.7.8 2022-07-11 [?] CRAN (R 4.1.1) P stringr * 1.4.0 2019-02-10 [?] CRAN (R 4.1.3) testthat * 3.1.8 2023-05-04 [1] CRAN (R 4.1.1) P tibble 3.1.8 2022-07-22 [?] CRAN (R 4.1.3) P tidyr 1.2.1 2022-09-08 [?] CRAN (R 4.1.1) P tidyselect 1.2.0 2022-10-10 [?] CRAN (R 4.1.1) P tzdb 0.3.0 2022-03-28 [?] CRAN (R 4.1.3) P urlchecker 1.0.1 2021-11-30 [?] CRAN (R 4.1.3) P usethis 2.1.6 2022-05-25 [?] CRAN (R 4.1.3) P utf8 1.2.2 2021-07-24 [?] CRAN (R 4.1.3) P vctrs 0.5.1 2022-11-16 [?] CRAN (R 4.1.1) P viridisLite 0.4.1 2022-08-22 [?] CRAN (R 4.1.3) P websocket 1.4.1 2021-08-18 [?] CRAN (R 4.1.3) P withr 2.5.0 2022-03-03 [?] CRAN (R 4.1.3) P xtable 1.8-4 2019-04-21 [?] CRAN (R 4.1.3) P yaml * 2.2.1 2020-02-01 [?] CRAN (R 4.1.1) [1] C:/Users/glas137/AppData/Local/R/cache/R/renv/library/pmart_standalone-30a65451/R-4.1/x86_64-w64-mingw32 [2] C:/Users/glas137/AppData/Local/Temp/Rtmp4Qf7FO/renv-system-library [3] C:/Program Files/R/R-4.1.1/library P -- Loaded and on-disk path mismatch. R -- Package was removed from disk. - Python configuration ------------------------------------------------------- python: C:/venv/Scripts/python.exe libpython: C:/Users/glas137/AppData/Local/Programs/Python/Python310/python310.dll pythonhome: C:/venv version: 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Architecture: 64bit numpy: [NOT FOUND] minio: C:\venv\lib\site-packages\minio NOTE: Python version was forced by use_python function ------------------------------------------------------------------------------ ```
gadenbuie commented 1 year ago

@evanglass I'm glad you figured it all out, thanks for letting us know! If that behavior tends to cause you problems you can add on.exit(app$stop(), add = TRUE) inside your test_that() block just after you start the app. That way, when the test_ block exits, the app will be stopped and cleaned up.

cpsievert commented 1 year ago

Seems the core issue here has been addressed in the latest releases of {chromote} (and {shinytest2})