@@ -14,7 +14,7 @@ Scenario hooks run for every scenario.
1414` Before ` hooks run before the first step of each scenario.
1515
1616``` scala
17- Before {
17+ Before { scenario : Scenario =>
1818 // Do something before each scenario
1919}
2020```
@@ -24,7 +24,7 @@ Before {
2424` After ` hooks run after the last step of each scenario.
2525
2626``` scala
27- After {
27+ After { scenario : Scenario =>
2828 // Do something after each scenario
2929}
3030```
@@ -36,36 +36,25 @@ Step hooks invoked before and after a step.
3636### BeforeStep
3737
3838``` scala
39- BeforeStep {
39+ BeforeStep { scenario : Scenario =>
4040 // Do something before step
4141}
4242```
4343
4444### AfterStep
4545
4646``` scala
47- AfterStep {
47+ AfterStep { scenario : Scenario =>
4848 // Do something after step
4949}
5050```
5151
52- ## Scenario parameter
53-
54- The scenario is available as parameter in all hooks.
55-
56- You can use it like this:
57- ``` scala
58- Before { scenario : Scenario =>
59- // Do something with the scenario
60- }
61- ```
62-
6352## Conditional hooks
6453
6554Hooks can be conditionally selected for execution based on the tags of the scenario.
6655
6756``` scala
68- Before (" @browser and not @headless" ) {
57+ Before (" @browser and not @headless" ) { _ =>
6958 // Do something before each scenario with tag @browser but not @headless
7059}
7160```
@@ -75,11 +64,11 @@ Before("@browser and not @headless") {
7564You can define an order between multiple hooks.
7665
7766``` scala
78- Before (10 ) {
67+ Before (10 ) { _ =>
7968 // Do something before each scenario
8069}
8170
82- Before (20 ) {
71+ Before (20 ) { _ =>
8372 // Do something before each scenario
8473}
8574```
@@ -90,7 +79,7 @@ The **default order is 1000**.
9079
9180You mix up conditional and order hooks with following syntax:
9281``` scala
93- Before (" @browser and not @headless" , 10 ) {
82+ Before (" @browser and not @headless" , 10 ) { _ =>
9483 // Do something before each scenario
9584}
9685```
0 commit comments