Is there a way to have multi-line comments in .test test units?

Asked by Stephane Mikaty (eCircle AG)

Story:
As: Automation Engineer
I want to: Comment out whole blocks of a test unit from an outside script using a comment notation
So that: I can activate different parts of a test unit based on the version of the product being tested

Example:

# {BeginSection:6.50.123+}
call testunit1
# {EndSection:6.50.123+}

# {BeginSection:5.40.000-6.50.122}
call testunit2
# {EndSection:5.40.000-6.50.122}

Would be changed for version 6.50.124 to

# {BeginSection:6.50.123+}
call testunit1
# {EndSection:6.50.123+}

/*# {BeginSection:5.40.000-6.50.122}
call testunit2
# {EndSection:5.40.000-6.50.122} */

or (using a ruby notation)

# {BeginSection:6.50.123+}
call testunit1
# {EndSection:6.50.123+}

=begin # {BeginSection:5.40.000-6.50.122}
call testunit2
=end # {EndSection:5.40.000-6.50.122}

Problem: Testplan does not seem to support multi-line comments, but I may be wrong.

Question information

Language:
English Edit question
Status:
Answered
For:
TestPlan Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
edA-qa (eda-qa) said :
#1

You have a couple options for what you can do.

For the comments you don't have a multi-line comment, but you can just comment out multiple lines using the single-line syntax:

## {BeginSection:6.50.123+}
#call testunit1
## {EndSection:6.50.123+}

This should always work. And since you can identify the block already it shouldn't be too hard to comment it this way. If not, then you can add a guaranteed false condition "if is false" ... "end". (Sorry I can't get the exact syntax now).

Multi-line comments could be supported, but as the language is inherently single line it might be confusing.

But if you just want to call a different test unit why don't you assign a variable instead. "call" can take a variable as a unit name:

call %some_unit%

Then you can just include some generated file with all your constants and not have to worry about commenting out lines. In the same approach you could add if statements that check such variables. And all these variables can just be stuck into a properties file. I think this approach would be the easiest and cleanest.

Can you help with this problem?

Provide an answer of your own, or ask Stephane Mikaty (eCircle AG) for more information if necessary.

To post a message you must log in.