Граф коммитов

30 коммитов

Автор SHA1 Сообщение Дата
John Lonergan
223efc3b14
Fix some type checks on the signatures of nested step handlers (#647)
* 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
2024-10-15 13:25:13 +01:00
John Lonergan
bcf6bce793
ambiguous step def detection akin to cucumber jvm (#636)
* 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>
2024-07-01 10:28:39 +01:00
Mark Hughes
7017c73ef8
Provide a useful implementation of something compatible with testing.T (#571)
* 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>
2024-04-29 10:26:25 +02:00
Viacheslav Poturaev
3e0f9026f3
Improve hooks invocation flow (#568) 2023-07-13 09:31:56 +02:00
Viacheslav Poturaev
7f75c5d4ee Remove redundant return 2023-05-26 16:43:48 +02:00
Viacheslav Poturaev
561cb85371 Add test for context cancellation 2023-04-04 01:30:19 +02:00
Viacheslav Poturaev
aba6a689a4
Update CI for go1.20 (#552) 2023-04-04 00:11:09 +02:00
Tighearnán Carroll
6ce2b8696b
Use fs.FS abstraction for filesystem (#550)
* compiles

* mock fs in tests

* fix parser tests

* fix run.go

* rename FeatureFS to FS

* fix docs typos

* remove debug log

* add os.DirFS("./") to default options

* reword docstring

* add fs wrapper

* updated readme and changelog

* added note

* fix changelog

* remove ./ gating from defaults

* add new storage.FS tests

* increase coverage of parser.parsePath

* increase coverage of TestSuite.RetrieveFeatures

* remove another os.Stat

---------

Co-authored-by: Tighearnán Carroll <tighearnan.carroll@gamil.com>
2023-03-27 21:52:51 +02:00
Alexandru Chitu
62d84eedbc
Implement unambiguous keywords (#509)
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
2023-01-23 14:22:19 +00:00
Alexandru Chitu
2264a0037b
chore(*): BREAKING CHANGE, use new repos for cucumber and messages (#515)
* chore(*): use new repos for cucumber and messages

* chore(*): go mod tidy _examples

Co-authored-by: otrava7 <alexandru.chit@gmail.com>
2023-01-05 12:41:56 +01:00
Wichert Akkerman
b2672bb933
Do not discard context from substeps (#488) 2022-07-25 13:43:36 +02:00
Viacheslav Poturaev
b850b44b48
Invoke After Scenario hooks after After Step hooks (#444)
* Invoke After Scenario hooks after After Step hooks

* Update CHANGELOG.md

Co-authored-by: Matt Wynne <matt@cucumber.io>
2021-12-02 16:09:23 -08:00
Levi Noecker
c6c2a0885b
Export internal formatters (#372) 2021-08-10 11:27:17 +02:00
Viacheslav Poturaev
8cf3f415b3
Add scenario hook errors to first and last steps (#417) 2021-08-08 22:42:41 +02:00
Viacheslav Poturaev
b1728ff551
Add new contextualized API for hooks and steps (#409)
* 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
2021-08-03 17:48:05 +02:00
tfreville
fbed999ad8 feat(step_definition): Allows to define step function without return.
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.
2021-07-13 10:31:39 +02:00
MBow
5414f3c5da update gherkin-go to v19.0.3
update messages-go to v16.0.1
bump gomod version
comment on log line in std os.Stderr
examples to non rc version
go mod tidy
update circle (tbd)
2021-06-28 17:19:43 +01:00
Hiram Chirino
2b6c9dc82e feat: support auto converting doc strings to plain strings 2021-03-16 09:40:37 +01:00
Fredrik Lönnblad
813312606f Moved the parser code to a new internal pkg 2020-07-05 18:40:56 +02:00
Fredrik Lönnblad
150c400163 Created internal packages for formatters, storage and models 2020-07-02 08:51:31 +02:00
Fredrik Lönnblad
e38c6ed719 Added an internal package for tags filtering 2020-06-30 22:52:50 +02:00
Fredrik Lönnblad
dbd8cdf723 Removed deprecated code 2020-06-27 19:13:38 +02:00
Fredrik Lönnblad
0ef3d6d5e1 Deprecated SuiteContext and ConcurrentFormatter 2020-06-20 23:18:24 +02:00
Fredrik Lönnblad
39940f55bc Added support for concurrent scenarios 2020-06-14 19:21:01 +02:00
Fredrik Lönnblad
b717039e16 Refactored some states in the formatters and feature struct 2020-06-14 09:49:22 +02:00
Fredrik Lönnblad
b1a69ae142 Added features to the in-mem storage 2020-06-13 06:45:14 +02:00
Fredrik Lönnblad
cd7663fccf Added Pickle and PickleStep results to the in-mem storage 2020-06-10 21:45:23 +02:00
Fredrik Lönnblad
4356addf9f Added an in-mem storage for pickles 2020-06-09 13:30:32 +02:00
Fredrik Lönnblad
df3ce739e8 Unexported some exported properties in unexported structs 2020-06-07 15:22:50 +02:00
Fredrik Lönnblad
6b2e72016b Copied the SuiteContext for testing of TestSuite{}.Run() 2020-06-06 16:12:19 +02:00