Run before step hooks before matching (#425)

* Run before step hooks before matching

* Add note to CHANGELOG.md

Co-authored-by: nhatthm <nt@hellofresh.com>
Этот коммит содержится в:
Viacheslav Poturaev 2021-08-24 23:02:41 +02:00 коммит произвёл GitHub
родитель afaebf26c1
коммит 7d984effb3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -8,6 +8,12 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
---
## [Unreleased]
### Fixed
- Unintended change of behavior in before step hook ([424](https://github.com/cucumber/godog/pull/424) - [nhatthm])
## [v0.12.0]
### Added
@ -190,7 +196,8 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
<!-- Releases -->
[unreleased]: https://github.com/cucumber/godog/compare/v0.11.0...main
[unreleased]: https://github.com/cucumber/godog/compare/v0.12.0...main
[v0.12.0]: https://github.com/cucumber/godog/compare/v0.11.0...v0.12.0
[v0.11.0]: https://github.com/cucumber/godog/compare/v0.10.0...v0.11.0
[v0.10.0]: https://github.com/cucumber/godog/compare/v0.9.0...v0.10.0
[0.9.0]: https://github.com/cucumber/godog/compare/v0.8.1...v0.9.0
@ -215,3 +222,4 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
[chirino]: https://github.com/chirino
[radtriste]: https://github.com/radtriste
[karfrank]: https://github.com/karfrank
[nhatthm]: https://github.com/nhatthm

Просмотреть файл

@ -134,13 +134,13 @@ func (s *suite) runStep(ctx context.Context, pickle *Scenario, step *Step, prevS
ctx, err = s.runBeforeScenarioHooks(ctx, pickle)
}
// run before step handlers
ctx, err = s.runBeforeStepHooks(ctx, step, err)
match = s.matchStep(step)
s.storage.MustInsertStepDefintionMatch(step.AstNodeIds[0], match)
s.fmt.Defined(pickle, step, match.GetInternalStepDefinition())
// run before step handlers
ctx, err = s.runBeforeStepHooks(ctx, step, err)
if err != nil {
sr = models.NewStepResult(pickle.Id, step.Id, match)
sr.Status = models.Failed