I need to comment multiple lines while debugging test cases. single line i can comment using # but I am looking for block comments.
example:
I need to comment multiple lines while debugging test cases. single line i can comment using # but I am looking for block comments.
example:
The Gherkin syntax does not support block-comments, but here is what most teams do.
Use the Cucumber IDE integration - supported in Eclipse, IntelliJ, Visual Studio Code etc.
For example, if you use Eclipse, CTRL
+ /
will comment all selected lines.
In Gherkin, """ """
can comment the block of the code.
But for Karate, it would be just a block.
The below portion is taken as a comment when it is immediate after a Scenario.
Scenario: Testing commenting multiple lines
""" some block comment
still block comment
""" end of block comment
Given url 'https://testurl.com'
When method GET
Then status 200
And print response
And print "This is the first line"
#----> You can only commnent this way
# And print "This is the second line"
# And print "This is the Third line"
# And print "This is the Forth line"
# And print "This is the fifth line"
And print "This is the sixth line"
There is a wide discussion on this and we can achieve a nearer solution by configuring the IDE. Check the solution here.