Commenting ¶
Comments may be inserted into Feature Files, UI Steps Files and Steps Files.
Feature File Comments¶
Using the hash character #
within Feature Files will comment out one line of code. It will neither appear in the log protocol, nor in the trace log.
Example
1 2 3 4 | Feature: a feature # This comment is not included in the protocol log Scenario: a scenario Then verify true |
Including Comments in the Protocol Log File¶
Comments belonging to scenarios and steps, which start with the prefix #->
will be included in the protocol log file of the test case.
Example
1 2 3 4 5 6 7 8 | Feature: a feature # This comment is not included in the protocol log file #-> This comment will be included in the protocol log file Scenario: a scenario # step comment not included in the protocol log file Then verify true |
The execution of the test case above will result to the following content of the associated protocol log file:
Protocol Log File Example
1 2 3 4 | 2017.06.22 10:13:48.6 This comment will be included in the protocol log file 2017.06.22 10:13:48.6 Scenario started: a scenario 2017.06.22 10:13:48.6 Step started: verify true 2017.06.22 10:13:48.6 Step ended with status: passed |
Single Commenter¶
The single commenter comments out a line of code with (//
).
-
For Windows/Linux users, press:
Ctrl
+/
. -
For Mac OS users, press:
Command
+/
.
Example
1 2 3 4 5 6 7 8 | model TestModel1 func testing // These lines are now commented out. end end |
Block Comment¶
The block commenter comments out entire blocks of code.
-
For Windows/Linux users, press:
Ctrl
+Shift
+/
. -
For Mac OS users, press:
Command
+Shift
+/
.
The entire block that appears in grey will be commented out.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 | model loginForm1 func login(username, password) /* loginForm := await loginPage_view loginForm.enterUserName(username) loginForm.enterPassword(password) loginForm.clickLoginButton() end */ end |