diff --git a/inst/examples/shiny/tests/testthat/_snaps/4.4/shinytest2/shiny-002.png b/inst/examples/shiny/tests/testthat/_snaps/4.4/shinytest2/shiny-002.png deleted file mode 100644 index 68894d8..0000000 Binary files a/inst/examples/shiny/tests/testthat/_snaps/4.4/shinytest2/shiny-002.png and /dev/null differ diff --git a/inst/examples/shiny/tests/testthat/_snaps/4.4/shinytest2/shiny-001.png b/inst/examples/shiny/tests/testthat/_snaps/mac-4.4/shinytest2/shiny-e2e-001.png similarity index 69% rename from inst/examples/shiny/tests/testthat/_snaps/4.4/shinytest2/shiny-001.png rename to inst/examples/shiny/tests/testthat/_snaps/mac-4.4/shinytest2/shiny-e2e-001.png index deacef8..90610bf 100644 Binary files a/inst/examples/shiny/tests/testthat/_snaps/4.4/shinytest2/shiny-001.png and b/inst/examples/shiny/tests/testthat/_snaps/mac-4.4/shinytest2/shiny-e2e-001.png differ diff --git a/inst/examples/shiny/tests/testthat/test-shinytest2.R b/inst/examples/shiny/tests/testthat/test-shinytest2.R index 22fe388..0b94960 100644 --- a/inst/examples/shiny/tests/testthat/test-shinytest2.R +++ b/inst/examples/shiny/tests/testthat/test-shinytest2.R @@ -1,8 +1,8 @@ library(shinytest2) -test_that("{shinytest2} recording: shiny", { - app <- AppDriver$new(variant = platform_variant(os_name = FALSE), name = "shiny", seed = 1, height = 992, - width = 1619, app_dir = system.file("examples/shiny", package = "quill")) - app$expect_screenshot() + +test_that("{shinytest2} recording: shiny-e2e", { + app <- AppDriver$new(variant = platform_variant(), name = "shiny-e2e", seed = 123, + height = 992, width = 1619) app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"h\"},{\"insert\":\"\\n\"}]}", "h\n", "

h

"), allow_no_input_binding_ = TRUE) app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"he\"},{\"insert\":\"\\n\"}]}", @@ -16,29 +16,23 @@ test_that("{shinytest2} recording: shiny", { app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello \"},{\"insert\":\"\\n\"}]}", "hello \n", "

hello

"), allow_no_input_binding_ = TRUE) - app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello \"},{\"attributes\":{\"code\":true},\"insert\":\"w\"},{\"insert\":\"\\n\"}]}", - "hello w\n", "

hello w

"), - allow_no_input_binding_ = TRUE) - app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello \"},{\"insert\":\"\\n\"}]}", - "hello \n", "

hello

"), - allow_no_input_binding_ = TRUE) - app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello \"},{\"attributes\":{\"color\":\"#0066cc\"},\"insert\":\"w\"},{\"insert\":\"\\n\"}]}", - "hello w\n", "

hello w

"), + app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello t\"},{\"insert\":\"\\n\"}]}", + "hello t\n", "

hello t

"), allow_no_input_binding_ = TRUE) - app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello \"},{\"attributes\":{\"color\":\"#0066cc\"},\"insert\":\"wo\"},{\"insert\":\"\\n\"}]}", - "hello wo\n", "

hello wo

"), + app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello th\"},{\"insert\":\"\\n\"}]}", + "hello th\n", "

hello th

"), allow_no_input_binding_ = TRUE) - app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello \"},{\"attributes\":{\"color\":\"#0066cc\"},\"insert\":\"wor\"},{\"insert\":\"\\n\"}]}", - "hello wor\n", "

hello wor

"), + app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello the\"},{\"insert\":\"\\n\"}]}", + "hello the\n", "

hello the

"), allow_no_input_binding_ = TRUE) - app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello \"},{\"attributes\":{\"color\":\"#0066cc\"},\"insert\":\"worl\"},{\"insert\":\"\\n\"}]}", - "hello worl\n", "

hello worl

"), + app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello ther\"},{\"insert\":\"\\n\"}]}", + "hello ther\n", "

hello ther

"), allow_no_input_binding_ = TRUE) - app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello \"},{\"attributes\":{\"color\":\"#0066cc\"},\"insert\":\"world\"},{\"insert\":\"\\n\"}]}", - "hello world\n", "

hello world

"), + app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello there\"},{\"insert\":\"\\n\"}]}", + "hello there\n", "

hello there

"), allow_no_input_binding_ = TRUE) - app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello \"},{\"attributes\":{\"color\":\"#0066cc\"},\"insert\":\"world!\"},{\"insert\":\"\\n\"}]}", - "hello world!\n", "

hello world!

"), + app$set_inputs(editor_1 = c("{\"ops\":[{\"attributes\":{\"color\":\"#e60000\"},\"insert\":\"hello there!\"},{\"insert\":\"\\n\"}]}", + "hello there!\n", "

hello there!

"), allow_no_input_binding_ = TRUE) app$expect_screenshot() })