test {cucumber}R Documentation

Run Cucumber tests

Description

It runs tests from specifications in .feature files found in the path.

To run Cucumber tests alongside testthat tests, see cucumber::run().

Usage

test(
  path = "tests/acceptance",
  filter = NULL,
  reporter = NULL,
  env = NULL,
  load_helpers = TRUE,
  stop_on_failure = TRUE,
  stop_on_warning = FALSE,
  ...
)

Arguments

path

Path to directory containing tests.

filter

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

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.

env

Environment in which to execute the tests. Expert use only.

load_helpers

Source helper files before running the tests?

stop_on_failure

If TRUE, throw an error if any tests fail.

stop_on_warning

If TRUE, throw an error if any tests generate warnings.

...

Additional arguments passed to grepl() to control filtering.

Good Practices

Examples

## Not run: 
cucumber::test("tests/acceptance")
cucumber::test("tests/acceptance", filter = "addition|multiplication")

## End(Not run)


[Package cucumber version 2.1.1 Index]