mcdcorp / opentest

Open source test automation tool for web applications, mobile apps and APIs
https://getopentest.org
MIT License
447 stars 107 forks source link

Text used in $passCheckpoint and $failCheckpoint cannot be colorized #527

Closed TripleG closed 2 years ago

TripleG commented 2 years ago

Hi,

Colorizing done in scope of this ticket https://github.com/mcdcorp/opentest/issues/475 does not work on the new $passCheckpoint and $failCheckpoint steps.

Could you please enable it for these, too?

adrianth commented 2 years ago

Just checked it with v1.3.6 and it seems to be working fine. Here's some sample code:

- script: |
    $passCheckpoint(
        "This is the passCheckpoint {spot}description{/spot}",
        "This is the passCheckpoint {spot}message{/spot}"
    );

- script: |
    $failCheckpoint(
        "This is the failCheckpoint {spot}description{/spot}",
        "This is the failCheckpoint {spot}message{/spot}"
    );

Test results:

image

And here's how it shows in the logs:

image

TripleG commented 2 years ago

Hi Adrian,

Sorry, yes, they actually can be colorized. The only detail is that the bgcolor should be in double quotes, if it is in single quotes it doesn't work.

$failCheckpoint('{spot bgcolor="red"}Should be red{/spot}'); - works $failCheckpoint("{spot bgcolor='red'}Should be red{/spot}"); - doesn't work, it prints the text as is, without any parsing

Is it a problem to make it work either way just for convenience?

adrianth commented 2 years ago

It should be fairly easy to support both single and double quotes. I'll take a look at adding that, but will not publish it just yet since there's an easy workaround available. It'll be available in the next release.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.