Repository navigation
Closed
Description
- Make sure test works:
> devtools::test_active_file("tests/testthat/apps/upload/tests/testthat/test-app-upload.R")
══ Testing test-app-upload.R ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 1 ] Done!
- Now replace
cars.csvby the absolute path in that file,app$upload_file(file = "/home/bers/shinytest2/tests/testthat/apps/upload/tests/testthat/cars.csv")
devtools::test_active_file("tests/testthat/apps/upload/tests/testthat/test-app-upload.R")
══ Testing test-app-upload.R ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 1 ] Done!
- Now replace
cars.csvby the~-path in that file,app$upload_file(file = "~/shinytest2/tests/testthat/apps/upload/tests/testthat/cars.csv")
> devtools::test_active_file("tests/testthat/apps/upload/tests/testthat/test-app-upload.R")
══ Testing test-app-upload.R ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 0 ]
── Error (test-app-upload.R:6:3): Make sure upload can take use a local file ───────────────────────────
Error: Chromote: timed out waiting for response to command Runtime.evaluate
Backtrace:
1. app$upload_file(file = "~/shinytest2/tests/testthat/apps/upload/tests/testthat/cars.csv")
at test-app-upload.R:6:2
2. shinytest2::app_upload_file(...)
at shinytest2/R/app-driver.R:386:6
3. self$get_js(...)
at shinytest2/R/app-driver-upload-file.R:32:2
4. shinytest2::app_get_js(...)
at shinytest2/R/app-driver.R:882:6
5. shinytest2::chromote_eval(...)
at shinytest2/R/app-driver-expect-js.R:24:2
...
at chromote/R/protocol.R:144:6
9. self$parent$wait_for(p)
at chromote/R/chromote_session.R:413:6
10. chromote:::synchronize(p, loop = private$child_loop)
at chromote/R/chromote.R:148:6
14. base::tryCatch(...)
at chromote/R/synchronize.R:112:4
15. base tryCatchList(expr, classes, parentenv, handlers)
16. base tryCatchOne(expr, names, parentenv, handlers[[1L]])
17. base doTryCatch(return(expr), name, parentenv, handler)
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 0 ]
Warning message:
In callback(...) :
Chromote has received a Inspector.targetCrashed event. This means that the ChromoteSession has probably crashed.
Calls: tryCatch ... tryCatchList -> tryCatchOne -> doTryCatch -> callback
>
- Now change the path to a non-existing file - same error message as above.
3 is easy to fix on the user side with path.expand - I am reporting this because it worked without it in shinytest.
4 could use a better error message if the uploaded file does not exist.
Activity
Better error messages when uploading files
Add `compare` to `$expect_download()`; Better error messages when upl…