It runs tests from specifications in .feature
files found in the path
.
test(
path = "tests/acceptance",
filter = NULL,
reporter = NULL,
env = NULL,
load_helpers = TRUE,
stop_on_failure = TRUE,
stop_on_warning = FALSE,
...
)
Path to directory containing tests.
If not NULL, only features with file names matching this regular expression will be executed. Matching is performed on the file name after it's stripped of ".feature".
Reporter to use to summarise output. Can be supplied
as a string (e.g. "summary") or as an R6 object
(e.g. SummaryReporter$new()
).
See Reporter for more details and a list of built-in reporters.
Environment in which to execute the tests. Expert use only.
Source helper files before running the tests?
If TRUE
, throw an error if any tests fail.
If TRUE
, throw an error if any tests generate
warnings.
Additional arguments passed to grepl()
to control filtering.
Use a separate directory for your acceptance tests, e.g. tests/acceptance
.
It's not prohibited to use tests/testthat
directory, but it's not recommended as those tests
serve a different purpose and are usually run separately.
Use setup-*.R
files for calling step()
, define_parameter_type()
and hook()
to leverage testthat loading mechanism.
If your step()
, define_parameter_type()
and hook()
are called from somewhere else, you are responsible for loading them.
Read more about testthat special files in the testthat documentation.
Use test-*.R
files to test the support code you might have implemented that is used to run Cucumber tests.
Those tests won't be run when calling test()
. To run those tests use
testthat::test_dir("tests/acceptance")
.
if (FALSE) {
cucumber::test("tests/acceptance")
cucumber::test("tests/acceptance", filter = "addition|multiplication")
}
Run the code above in your browser using DataLab