Revision: e7726b6cefcc
Branch:   default
Author:   Pekka Klärck
Date:     Fri Nov 15 12:33:53 2013 UTC
Log: BuiltIn.Set Test Message: Finalized changes to allow overriding failure messages.

Update issue 1538
Status: Done
Added tests for append and fixed docs. Done.
http://code.google.com/p/robotframework/source/detail?r=e7726b6cefcc

Modified:
 /atest/robot/standard_libraries/builtin/set_test_message.txt
 /atest/testdata/standard_libraries/builtin/set_test_message.txt
 /src/robot/libraries/BuiltIn.py

=======================================
--- /atest/robot/standard_libraries/builtin/set_test_message.txt Thu Nov 14 12:41:49 2013 UTC +++ /atest/robot/standard_libraries/builtin/set_test_message.txt Fri Nov 15 12:33:53 2013 UTC
@@ -32,6 +32,9 @@

 Set Message To Failed Test On Teardown
     Check Test Case  ${TEST NAME}
+
+Append To Failure Message
+    Check Test Case  ${TEST NAME}

 Setting Message In Test Body After Continuable Failure Has No Effect
     Check Test Case  ${TEST NAME}
=======================================
--- /atest/testdata/standard_libraries/builtin/set_test_message.txt Thu Nov 14 12:41:49 2013 UTC +++ /atest/testdata/standard_libraries/builtin/set_test_message.txt Fri Nov 15 12:33:53 2013 UTC
@@ -36,6 +36,11 @@
     Fail     Message That Will Be Ignored
     [Teardown]  Set Test Message    Teardown Message

+Append To Failure Message
+    [Documentation]  FAIL My failure is continued
+    Fail    My failure
+    [Teardown]  Set Test Message    is continued    append=jepa
+
 Setting Message In Test Body After Continuable Failure Has No Effect
     [Documentation]  FAIL  Failure Message
     Run Keyword And Continue On Failure  Fail  Failure Message
=======================================
--- /src/robot/libraries/BuiltIn.py     Thu Nov 14 13:35:59 2013 UTC
+++ /src/robot/libraries/BuiltIn.py     Fri Nov 15 12:33:53 2013 UTC
@@ -2263,25 +2263,26 @@
     def set_test_message(self, message, append=False):
         """Sets message for the current test case.

-        Possible failures override this message.
-
If the optional `append` argument is given any value considered `true` in Python, for example, any non-empty string, the given `message` is added after the possible earlier message by joining the messages with
         a space.

- In teardown the current test message is available as a built-in variable
-        `${TEST MESSAGE}`. This keyword can not be used in suite setup or
-        or suite teardown.
+ In test teardown this keyword can alter the possible failure message, + but otherwise failures override messages set by this keyword. Notice + that in teardown the initial message is available as a built-in variable
+        `${TEST MESSAGE}`.

It is possible to use HTML format in the message by starting the message
         with `*HTML*`.

         Examples:
-        | Set Test Message | My message          |            |
-        | Set Test Message | is continued.       | append=yes |
- | Should Be Equal | ${TEST MESSAGE} | My message is continued. |
-        | Set Test Message | *HTML*<b>Hello!</b> |            |
+ | Set Test Message | My message | | + | Set Test Message | is continued. | append=yes | + | Should Be Equal | ${TEST MESSAGE} | My message is continued. | + | Set Test Message | *HTML* <b>Hello!</b> | |
+
+        This keyword can not be used in suite setup or suite teardown.

         New in Robot Framework 2.5. Support for `append` was added in 2.7.7
         and HTML support in 2.8.

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to