You are confusing Cucumber hooks with Watir hooks. Watir only has the After hook - https://www.rubydoc.info/gems/watir/Watir/AfterHooks
Anyway, here is how you can use the 3 hooks you mentioned: *Before*: Do something before the test starts (before first step). For example: Launch browser, log into the application, or to setup Watir's AfterHook to check for errors (see the link above). *After*: Do something after the test finishes (after last step). For example: Log out of the application, close browser, or data cleanup. *AfterStep*: Do something after each step in the Scenario. For example: Take a screenshot if the step fails. You can read more here - https://docs.cucumber.io/cucumber/api/#hooks On Monday, January 28, 2019 at 9:47:10 PM UTC-8, NaviHan wrote: > > Hi all > > Im just looking for some good documentation which explains the usage of > blocks in hooks.rb > > For example "Before", "After" , "AfterStep" etc... > > Thanks in advance > -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
