File actions
I attach "<filepath>" as "<name>"
or since v3.0.0
I attach "<filepath>" as <name>
Attaches a local file to the Gwen report and assigns it a name. The link to the attachment in the report will have the given name.
I attach "<filepath>" as "<name>"
I attach "<filepath>" as <name>
I attach "<filepath>"
Attaches a local file to the Gwen report and assigns it the same name as the file.
I attach "<filepath>"
I <write|append> "<text>" to "<filepath>" file
Writes or appends text to a file.
I <write|append> "<text>" to "<filepath>" file
Where
<write|append>is one of:<write>to overwrite entire content of file with the provided text<append>to append the provided text to existing content in file
<text>the text to write or append to the file<filepath>the path to the local file to write or append the text to
Example
When I write "automation" to "path/to/file.txt" file
I <write|append> <textRef> to "<filepath>" file
Writes or appends a text reference value to a file.
I <write|append> <textRef> to "<filepath>" file
Where
<write|append>is one of:<write>to overwrite entire content of file with the provided text<append>to append the provided text to existing content in file
<textRef>is the name of the binding containing the text to write or append to the file- Can be the name of any binding that contains or resolves to a text value, including a web element in which case the text in the element will be dynamically retrieved and used.
<filepath>the path to the local file to write or append the text to
Example
Given my content is
"""
Automation and robotics
for Gherkin
"""
When I write my content to "path/to/file.txt" file
I <write|append> new line to "<filepath>" file
Writes or appends a new line to a file.
I <write|append> new line to "<filepath>" file
I <write|append> "<text>" to <filepathRef file>
Writes or appends text to a referenced file.
I <write|append> "<text>" to <filepathRef file>
Where
<write|append>is one of:<write>to overwrite entire content of file with the provided text<append>to append the provided text to existing content in file
<text>the text to write or append to the file<filepathRef file>is the name of the binding containing the path of the file to write or append the provided text to
Example
Given my file is "path/to/file.txt"
When I append "automation" to my file
I <write|append> <textRef> to <filepathRef file>
Writes or appends a text reference value to a referenced file.
I <write|append> <textRef> to <filepathRef file>
Where
<write|append>is one of:<write>to overwrite entire content of file with the provided text<append>to append the provided text to existing content in file
<textRef>is the name of the binding containing the text to write or append to the file- Can be the name of any binding that contains or resolves to a text value, including a web element in which case the text in the element will be dynamically retrieved and used.
<filepathRef file>is the name of the binding containing the path of the file to write or append the provided text to
Example
Given my file is "path/to/file.txt"
And my content is
"""
Automation and robotics
for Gherkin
"""
When I write my content to my file
I <write|append> new line to <filepathRef file>
Writes or appends a new line to a referenced file.
I <write|append> new line to <filepathRef file>
Where
<write|append>is one of:<write>to overwrite entire content of file with a new line<append>to append a new line to existing content in file
<filepathRef file>is the name of the binding containing the path of the file to write or append the new line to
Example
Given my file is "path/to/file.txt"
When I append new line to my file
I log record to <resultsFileId> file
Logs a record to the results file having the given ID (if results is specifed in the format launch option only).
I log record to <resultsFileId> file
Where
<resultsFileId>the ID of the results file to log a record to
Example
When I log record to my.results file