8

テーブルにスペースを渡す方法は?

Background:
    Given the following books
        |Author         |(here several spaces)Title(here several spaces)|
4

3 に答える 3

12

私はこれを行います:

Given the following books
| Author              | Title               |
| "J. K. Rowling"     | "Harry P     "      |
| " Isaac Asimov   "  | "Robots and Empire" |

次に、スペースを保持しながら、引用符が存在する場合はそれを削除するようにバインディングを作成できます。

これは、後でスペースを追加するというアイデアよりもはるかに好ましいと思います。これは、人間があまり読めないためです。引用符を使用すると、スペースを読んでいる人間(利害関係者/コーダー)にスペースが見えるようになります。

于 2012-10-02T16:31:46.410 に答える
3

ステップを追加することで回避できます。何かのようなもの:

Given the following books
|Author         | Title |
Add append <5> spaces to book title

編集:

完全な機能は次のようになります。

Scenario: Adding books with spaces in the title
Given the following book
| price | title |
And <5> spaces appended to a title
When book is saved
Then the title should be equals to <title without spaces>
于 2012-10-01T17:58:45.047 に答える
0

私はちょうど同じ状況に直面しました、私の解決策はこれでした、次のようにステップにスペースを追加しました:

Scenario: Adding books with spaces in the title
Given the following book '    <title>    '
When book is saved
Then the title should be equals to '<title>'
| price | title        |
| 50.00 | Working hard |

于 2020-08-07T17:25:43.850 に答える