February 2015
Intermediate to advanced
338 pages
8h 16m
English
Doc strings allow you to specify a larger piece of text than you could fit on a single line. For example, if you need to describe the precise content of an email message, you could do it like this:
| | Scenario: Ban Unscrupulous Users |
| | When I behave unscrupulously |
| | Then I should receive an email containing: |
| | """ |
| | Dear Sir, |
| | |
| | Your account privileges have been revoked due to your unscrupulous behavior. |
| | |
| | Sincerely, |
| | The Management |
| | """ |
| | And my account should be locked |
Just like a data table, the entire string between the """ triple quotes is attached to the step above it. The indentation of the opening """ is not important, although common practice is to indent two spaces from the enclosing step, as we’ve ...
Read now
Unlock full access