2017-12-18 9 views

答えて

1

いいえ、それはありません。

examplesテーブルに書き込む例は、シナリオのパラメータと似ています。場合は、あなたが唯一のテーブル全体を取得することができ

Scenario Outline: feeding a suckler cow 
    Given the cow weighs <weight> kg 
    When we calculate the feeding requirements 
    Then the energy should be <energy> MJ 
    And the protein should be <protein> kg 

    Examples: 
    | weight | energy | protein | 
    | 450 | 26500 |  215 | 
    | 500 | 29500 |  245 | 
    | 575 | 31500 |  255 | 
    | 600 | 37000 |  305 | 

- これらの値は、(彼らは<>括弧である)シナリオの段階でプレースホルダを置き換えるガーキンのドキュメント(シナリオ概要https://cucumber.io/docs/reference)から

例ですあなたはパラメータとしてデータテーブルを使用しています。 例:

Given the following users exist: 
    | name | email    | twitter   | 
    | Aslak | [email protected] | @aslak_hellesoy | 
    | Julien | [email protected] | @jbpros   | 
    | Matt | [email protected] | @mattwynne  | 

あなたはこのバインディングでこれにアクセスすることができます迅速なポストのための

[Given(@"the following users exist:") 
public void TheFollowinUsersExists(Table table) 
{ 
    //your code 
} 
+0

ありがとう!私の目標は、スコープされたbeforeEachブロックでこのデータを使用することです。誰もが明るいアイデアを持っている場合は、回避するために開いてください。 – bradkt

関連する問題