-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
“rafal.urn”
committed
Oct 25, 2024
1 parent
fcbb68b
commit 22ebfd4
Showing
9 changed files
with
52 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-250 Bytes
ShinyWizard/tests/testthat/_snaps/shinytest2/source-001-ShinyWizard.new.zip
Binary file not shown.
Binary file removed
BIN
-250 Bytes
ShinyWizard/tests/testthat/_snaps/shinytest2/source-001-ShinyWizard.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
library(shinytest2) | ||
|
||
test_that("{Test ShinyWizard} recording: source", { | ||
# App Dir | ||
appDir <- paste0(base::system.file("", package = "ShinyWizard"), "inst/source") | ||
# Skip on app_dir temporary folder eg. check rather than test() | ||
testthat::skip_if(dir.exists(appDir) == FALSE) | ||
# Test | ||
app <- AppDriver$new(app_dir = appDir, name = "source", height = 731, width = 1139) | ||
# -> | ||
app$click("NavBar-go_1_2") | ||
app$set_inputs(`tab2-AppTitleInput` = "Shiny Wizard2") | ||
app$set_inputs(`tab2-AppSubTitleInput` = "Design, build, deploy!2") | ||
app$set_inputs(`tab2-LogoFilePathInput` = "img/logo2.png") | ||
app$set_inputs(`tab2-FooterTextInput` = "2") | ||
app$set_inputs(`tab2-shinytheme-selector` = "cyborg") | ||
app$click("NavBar-go_2_3") | ||
app$click("tab3-newTab") | ||
app$set_inputs(`tab3-ui1` = "# --- Navigation ---\n# TabName: Tab0\n# TabIcon: file\n# --- Next/Prev buttons\n# ShowButtons: TRUE\n# ButtonsAlignment: center\n# --- Info ---\n# InfoTitle: Tab0\n# InfoMessage: Info about tab\nfluidPage(\nselectInput(ns(\"dataset\"), label = \"Dataset\", choices = ls(\"package:datasets\")),\n verbatimTextOutput(ns(\"summary\")),\n tableOutput(ns(\"table\"))\n )") | ||
app$set_inputs(`tab3-server1` = " output$summary <- renderPrint({\n dataset <- get(input$dataset, \"package:datasets\")\n summary(dataset)\n })\n \n output$table <- renderTable({\n dataset <- get(input$dataset, \"package:datasets\")\n dataset\n })") | ||
app$set_inputs(`tab3-config1` = " # --- Navigation ---\n # TabName: Tab Name\n # TabIcon: paper\n # --- Next/Prev buttons\n # ShowButtons: TRUE\n # --- Info ---\n # InfoTitle: Information\n # InfoMessage: Some info text") | ||
app$set_inputs(`tab3-EditTabs` = "1") | ||
app$click("tab3-newTab") | ||
app$set_inputs(`tab3-ui2` = "# --- Navigation ---\n# TabName: Tab1\n# TabIcon: file\n# --- Next/Prev buttons\n# ShowButtons: TRUE\n# ButtonsAlignment: center\n# --- Info ---\n# InfoTitle: Tab1\n# InfoMessage: Info about tab\nfluidPage(\nselectInput(ns(\"dataset\"), label = \"Dataset\", choices = ls(\"package:datasets\")),\n verbatimTextOutput(ns(\"summary\")),\n tableOutput(ns(\"table\"))\n )") | ||
app$set_inputs(`tab3-server2` = " output$summary <- renderPrint({\n dataset <- get(input$dataset, \"package:datasets\")\n summary(dataset)\n })\n \n output$table <- renderTable({\n dataset <- get(input$dataset, \"package:datasets\")\n dataset\n })") | ||
app$set_inputs(`tab3-config2` = " # --- Navigation ---\n # TabName: Tab Name\n # TabIcon: paper\n # --- Next/Prev buttons\n # ShowButtons: TRUE\n # --- Info ---\n # InfoTitle: Information\n # InfoMessage: Some info text") | ||
app$set_inputs(`tab3-EditTabs` = "2") | ||
app$click("tab3-newTab") | ||
app$set_inputs(`tab3-ui3` = "# --- Navigation ---\n# TabName: Tab2\n# TabIcon: file\n# --- Next/Prev buttons\n# ShowButtons: TRUE\n# ButtonsAlignment: center\n# --- Info ---\n# InfoTitle: Tab2\n# InfoMessage: Info about tab\nfluidPage(\nselectInput(ns(\"dataset\"), label = \"Dataset\", choices = ls(\"package:datasets\")),\n verbatimTextOutput(ns(\"summary\")),\n tableOutput(ns(\"table\"))\n )") | ||
app$set_inputs(`tab3-server3` = " output$summary <- renderPrint({\n dataset <- get(input$dataset, \"package:datasets\")\n summary(dataset)\n })\n \n output$table <- renderTable({\n dataset <- get(input$dataset, \"package:datasets\")\n dataset\n })") | ||
app$set_inputs(`tab3-config3` = " # --- Navigation ---\n # TabName: Tab Name\n # TabIcon: paper\n # --- Next/Prev buttons\n # ShowButtons: TRUE\n # --- Info ---\n # InfoTitle: Information\n # InfoMessage: Some info text") | ||
app$set_inputs(`tab3-EditTabs` = "3") | ||
app$set_inputs(`tab3-EditTabs` = "2") | ||
app$click("tab3-removeTab") | ||
app$set_inputs(`tab3-DelTabConfirmation` = character(0), allow_no_input_binding_ = TRUE) | ||
app$set_inputs(`tab3-DelTabConfirmation` = TRUE, allow_no_input_binding_ = TRUE) | ||
app$click("NavBar-go_3_4") | ||
app$set_window_size(width = 1139, height = 731) | ||
# <- | ||
app$expect_unique_names() | ||
}) |
This file was deleted.
Oops, something went wrong.