2017-12-05 15 views
0

나는 Cucumber 3.x를 사용하고 Before hook에서 시나리오 이름을 얻고 싶습니다. 내 코드는 다음과 같다 :Cucumber-js 3.x : Before hook에서 시나리오 이름을 얻는 방법은 무엇입니까?

Before(function (scenario) { 
     let name = scenario.name; 
     console.log(scenario) //debug printing 

     return require("./driver").createDriver(desired); 
    }); 

와 오이 3.X에서 CONSOLE.LOG 보여줍니다에만이 : 나는 시나리오 이름을 얻을 수있는 방법

{ sourceLocation: 
    { uri: 'name_my_feature.feature', 
    line: 206 } } //206 - is line current scenario name 

?

답변

0

찾았습니다. scenario.pickle.name

+0

이 질문에 대한 답변을 제공하지 않습니다. 충분한 [평판] (https://stackoverflow.com/help/whats-reputation)이 있으면 [모든 게시물에 주석 달기] (https://stackoverflow.com/help/privileges/comment) 할 수 있습니다. 대신, [질문자의 설명이 필요없는 답변을 제공하십시오] (https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can- i-do- 대신). - [리뷰에서] (리뷰/저품절 포스트/18343911) – Mamun

+0

나에게 답이 된 것 같습니다. –