* at some point someone changed the return type for nested steps from []string to godog.Steps but they forgot to adjust the type checks. The existing type checks were lax and unable to distinguish []string from godog.Steps but in a couple of places in the code the value is coerced to godog.Steps and so if someone returned []string then the code would blow up. Additionally there were some tests aroudn these types but they also had not been updated but the test was passing for the wrong reason - the particular test expected an error but the cause of the error wasn't the one the code expected.
* CHANGELOG.md
* use chatgpt to regen the top of the code based on the new tests
* use chatgpt to regen the top of the code based on the new tests
* corrected the error messages of the param checks to indicate that the problem is the function signature and not the args being passed to the function, also added numerous extra assertions on the precise error messages returned. Now that the precise error is being verified in the test I have improved certain error messages to that more accurate detail is included in the errors
* added further constraints to the step arg mapping tests
* removed redundant test
* include a step error result in the reported error even when the ctx is nil
* added basic detection for ambiguous steps, but causes an error and not yet recorded in the reports as 'Ambiguous', and no test cases figured out yet
* added initial support for detection of ambiguous steps - further work take a look at how cuke jvm report ambiguous steps and sets the step status to 'ambiguous' rather than my current solution which just blows the test up as a regular step error
* added suite_context_test and also introduced missing 'ambiguous' status to make cucumber jvm'
* update CHANGELOG for ambiguous step defs
* missed file from commit
* added internal/formatters/fmt_multi_test.go
* add tests for other peoples code
* added "ambigous" to the help text
* tests
* added some more tests for attachments
* Update internal/flags/flags.go
Co-authored-by: Viacheslav Poturaev <nanopeni@gmail.com>
---------
Co-authored-by: Viacheslav Poturaev <nanopeni@gmail.com>
* Attempting to provide a useful implementation of something compatible with testing.T
* Handle Fail calls on the TestingT in the right place
* Provide as much of testing.T as possible + tidy up
* Add initial tests for testingT support
* Check compatibility with testing.T and friends
Co-authored-by: Piotr Bocheński <bochenski.piotr@gmail.com>
* Update assert-godogs example to show new usage. Rename 'GetTestingT(ctx)' to 'T(ctx)'
* Update changelog and readme with new usage
* Improve test coverage
* Review updates
---------
Co-authored-by: Piotr Bocheński <bochenski.piotr@gmail.com>
feat(*): create keyword functions
* chore(*): update messages and gherkin, relocate Keyword
* chore(*): update messages and gherkin, relocate Keyword
* chore(*): update messages and gherkin, relocate Keyword
* feat(*): mandate keyword type when unambiguous keyword function is used
* test(*): keyword type in feature files
* docs(*): update step-by-step walkthrough to mention the option of using keyword functions
* docs(*): update CHANGELOG.md
* test(*): keyword substeps
* chore(*): go mod
* Add new contextualized API for hooks and steps
* Make default context configurable
* Run AfterStep hooks even after failed steps, fixes#370
* Update CHANGELOG and README
* Add step result status to After hook, fixes#378
* Elaborate hooks documentation
* Add test to pass state between contextualized steps
* Update README with example of passing state between steps
Issue: It is not possible to use function without return when
matching steps, resulting in a lot of Nil only error
returns.
Fix: Allows to provide empty result function by correctly matching
reflect Calls on step Handler.
When nothing is returned by the Handler, it will return
nil as if errors was nil.