In Cucumber, is it possible to programmatically get the current step being executed?

后端 未结 11 2671
清歌不尽
清歌不尽 2020-12-04 00:22
Scenario: As a user, I want to login to the system
Given I am on my website
When I enter valid credentials
Then I am taken to the home page

The sce

11条回答
  •  半阙折子戏
    2020-12-04 01:00

    These hooks will help:

    @BeforeStep
    public void beforeStep(Scenario scenario){
      System.out.println(scenario.toString());
    }
    
    @AfterStep
    public void afterStep(Scenario scenario){
      System.out.println(scenario.toString());
    }
    

提交回复
热议问题