Skip to content

Commit

Permalink
Merge pull request #74 from karollayna/add_shinytest2_demo_GFF3
Browse files Browse the repository at this point in the history
Add shinytest2 for igvShinyDemo-GFF3
  • Loading branch information
gladkia authored Mar 17, 2024
2 parents d536430 + c62695f commit a969950
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 9 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: igvShiny
Title: igvShiny: a wrapper of Integrative Genomics Viewer (IGV - an interactive
tool for visualization and exploration integrated genomic data)
Version: 0.99.5
Date: 2024-03-14
Version: 0.99.6
Date: 2024-03-16
Authors@R: c(
person("Paul","Shannon", role = c("aut"),
email = "[email protected]"),
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## igvShiny 0.99.6 - 2024-03-16
* add shinytest2 for igvShinyDemo-GFF3.R

## igvShiny 0.99.5 - 2024-03-14
* fix issues with GFF3 data
* make igvShiny demo app for GFF3 working
Expand Down
81 changes: 74 additions & 7 deletions inst/unitTests/test_shinyApp.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,61 @@ runAppTests <- function()
test_shinyAppDemo <- function()
{
message(sprintf("--- test_shinyAppDemo"))
options(chromote.timeout = 60)

test_that("{shinytest2} recording: test_app", {

sf <- system.file(package = "igvShiny", "demos", "igvShinyDemo.R")
app <- AppDriver$new(
app_dir = shiny::shinyAppFile(sf),
name = "test_app",
height = 695,
width = 1235,
load_timeout = 1e+6,
timeout = 1e+6
)
Sys.sleep(20)

checkTrue(
.test_click_and_check(
"addBedGraphTrackButton",
"title=\"wig/bedGraph/local\"",
app
)
)
checkTrue(
.test_click_and_check(
"addBedGraphTrackFromURLButton",
"title=\"bedGraph/remote\"",
app
)
)
checkTrue(
.test_click_and_check(
"addBamViaHttpButton",
"title=\"1kg.bam\"",
app
)
)
checkTrue(
.test_click_and_check(
"addCramViaHttpButton",
"title=\"CRAM\"",
app
)
)
})

} # test_shinyAppDemo
#----------------------------------------------------------------------------------------------------
test_shinyAppDemoGFF3 <- function()
{
message(sprintf("--- test_shinyAppDemo-GFF3"))
options(chromote.timeout = 60)


test_that("{shinytest2} recording: test_app", {

sf <- system.file(package = "igvShiny", "demos", "igvShinyDemo.R")
sf <- system.file(package = "igvShiny", "demos", "igvShinyDemo-GFF3.R")
app <- AppDriver$new(
app_dir = shiny::shinyAppFile(sf),
name = "test_app",
Expand All @@ -50,10 +99,28 @@ test_shinyAppDemo <- function()
timeout = 1e+6
)
Sys.sleep(20)
checkTrue(.test_click_and_check("addBedGraphTrackButton", "title=\"wig/bedGraph/local\"", app))
checkTrue(.test_click_and_check("addBedGraphTrackFromURLButton", "title=\"bedGraph/remote\"", app))
checkTrue(.test_click_and_check("addBamViaHttpButton", "title=\"1kg.bam\"", app))
checkTrue(.test_click_and_check("addCramViaHttpButton", "title=\"CRAM\"", app))

checkTrue(
.test_click_and_check(
"addRemoteGFF3TrackButton",
"title=\"url gff3\"",
app
)
)
checkTrue(
.test_click_and_check(
"addRemoteGFF3TrackButtonWithBiotypeColors",
"title=\"url gff3 \\(colors)\\\"",
app
)
)
checkTrue(
.test_click_and_check(
"addLocalGFF3TrackButtonWithBiotypeColors",
"title=\"local gff3 \\(colors)\\\"",
app
)
)
})

} # test_shinyAppDemo
} # test_shinyAppDemoGFF3

0 comments on commit a969950

Please sign in to comment.