2017-07-29 2 views
0

私はVisual Studioで新しいです。私はSpecFlowでVisual Studio 2015を使用しています。私は、私は、変数の代わりにパラメーターを期待していステップの定義を生成する代わりの方法は、以下のように生成されるとSpecFlowステップのシナリオアウトライン生成不正なメソッドの生成

@mytag 
Scenario Outline: Successful Authentication 
    Given I am a user of type <user> 
    When I hit the application URL 
    And I provide <email> 
    And I click on Log In Button 
    Then I will be landed to the Home Page 
    And I will be able to see <name> on the Home Page 

Examples: 
    | user  | email   | name | 
    | admin  | [email protected] | alpha | 
    | non-admin | [email protected] | beta | 

:下記の機能のファイルである私の代わりに期待していた

[Given(@"I am a user of type admin")] 
public void GivenIAmAUserOfTypeAdmin() 
{ 
    ScenarioContext.Current.Pending(); 
} 

メソッドは次のようになります。

[Given(@"I am a user of type '(.*)'")] 
public void GivenIAmAUserOfType(string p0) 
{ 
    ScenarioContext.Current.Pending(); 
} 

何が欠けていますか?このような''Givenステップで<user>を囲む例として

答えて

1

Given I am a user of type '<user>' 

は、所望の結果を生成します。正規表現を認識するためにはおそらく必要です。

enter image description here

+0

ダニエルに感謝します。はい、問題は解決します。 –

関連する問題