6 new revisions:

Revision: a74102585a1e
Author:   Pekka Klärck
Date:     Thu Aug 30 07:15:56 2012
Log:      fixed build failing logging test
http://code.google.com/p/robotframework/source/detail?r=a74102585a1e

Revision: cc299d97f1e4
Author:   Pekka Klärck
Date:     Thu Aug 30 13:13:51 2012
Log:      UG: Enhanced documentationg of automatic variables a little.
http://code.google.com/p/robotframework/source/detail?r=cc299d97f1e4

Revision: 0abb30f5fa62
Author:   Pekka Klärck
Date:     Thu Aug 30 13:40:45 2012
Log:      Tests and code for new ${SUITE METADATA} built-in variable....
http://code.google.com/p/robotframework/source/detail?r=0abb30f5fa62

Revision: 3aeb8c22cce3
Author:   Pekka Klärck
Date:     Thu Aug 30 13:53:58 2012
Log:      Code and tests for `BuiltIn.Set Suite Metadata`....
http://code.google.com/p/robotframework/source/detail?r=3aeb8c22cce3

Revision: a847b8493ecc
Author:   Pekka Klärck
Date:     Thu Aug 30 13:55:11 2012
Log:      Documented ${SUITE METADATA}....
http://code.google.com/p/robotframework/source/detail?r=a847b8493ecc

Revision: cc68c49e9326
Author:   Pekka Klärck
Date:     Thu Aug 30 13:59:37 2012
Log:      Small BuiltIn doc tuning
http://code.google.com/p/robotframework/source/detail?r=cc68c49e9326

==============================================================================
Revision: a74102585a1e
Author:   Pekka Klärck
Date:     Thu Aug 30 07:15:56 2012
Log:      fixed build failing logging test
http://code.google.com/p/robotframework/source/detail?r=a74102585a1e

Modified:
 /atest/robot/test_libraries/logging_with_logging.txt

=======================================
--- /atest/robot/test_libraries/logging_with_logging.txt Thu Aug 30 04:20:25 2012 +++ /atest/robot/test_libraries/logging_with_logging.txt Thu Aug 30 07:15:56 2012
@@ -35,7 +35,7 @@

 Error in creating message is logged
     ${tc}=  Check test case  ${TEST NAME}
- Check log message ${tc.kws[0].msgs[0]} Failed to log following message: <Unrepresentable object 'InvalidMessage'. Error: Should not have been logged> + Check log message ${tc.kws[0].msgs[0]} Failed to log following message properly: <Unrepresentable object 'InvalidMessage'. Error: Should not have been logged> Check log message ${tc.kws[0].msgs[1]} Traceback (most recent call last):* DEBUG pattern=true

 Log using custom logger

==============================================================================
Revision: cc299d97f1e4
Author:   Pekka Klärck
Date:     Thu Aug 30 13:13:51 2012
Log:      UG: Enhanced documentationg of automatic variables a little.
http://code.google.com/p/robotframework/source/detail?r=cc299d97f1e4

Modified:
 /doc/userguide/src/CreatingTestData/Variables.txt

=======================================
--- /doc/userguide/src/CreatingTestData/Variables.txt Thu Aug 23 06:47:50 2012 +++ /doc/userguide/src/CreatingTestData/Variables.txt Thu Aug 30 13:13:51 2012
@@ -702,7 +702,9 @@

 Some automatic variables can also be used in the test data. These
 variables can have different values during the test execution and some
-of them are not even available all the time.
+of them are not even available all the time. Altering the value of
+these variables does not affect the original values, but some values
+can be changed dynamically using keywords from the `BuiltIn`_ library.

 .. table:: Available automatic variables
    :class: tabular
@@ -713,9 +715,12 @@
| ${TEST NAME} | The name of the current test case. | Test case | +------------------------+-------------------------------------------------------+------------+ | @{TEST TAGS} | Contains the tags of the current test case in | Test case | - | | alphabetical order. | | + | | alphabetical order. Can be modified dynamically using | | + | | :name:`Set Tags` and :name:`Remove Tags` keywords. | | +------------------------+-------------------------------------------------------+------------+ - | ${TEST DOCUMENTATION} | The documentation of the current test case. | Test case | + | ${TEST DOCUMENTATION} | The documentation of the current test case. Can be set| Test case | + | | dynamically using using :name:`Set Test Documentation`| | + | | keyword. New in Robot Framework 2.7. | | +------------------------+-------------------------------------------------------+------------+ | ${TEST STATUS} | The status of the current test case, either PASS or | `Test | | | FAIL. | teardown`_ |
@@ -737,7 +742,9 @@
| ${SUITE SOURCE} | An absolute path to the suite file or directory. New | Everywhere | | | in Robot Framework 2.5. | | +------------------------+-------------------------------------------------------+------------+ - | ${SUITE DOCUMENTATION} | The documentation of the current test suite. | Everywhere | + | ${SUITE DOCUMENTATION} | The documentation of the current test suite. Can be | Everywhere | + | | set dynamically using using :name:`Set Suite | | + | | Documentation` keyword. New in Robot Framework 2.7. | | +------------------------+-------------------------------------------------------+------------+ | ${SUITE STATUS} | The status of the current test suite, either PASS or | `Suite | | | FAIL. | teardown`_ |

==============================================================================
Revision: 0abb30f5fa62
Author:   Pekka Klärck
Date:     Thu Aug 30 13:40:45 2012
Log:      Tests and code for new ${SUITE METADATA} built-in variable.

Update issue 1134
${SUITE METADATA} done.
http://code.google.com/p/robotframework/source/detail?r=0abb30f5fa62

Added:
 /atest/testdata/variables/automatic_variables/__init__.txt
Modified:
 /atest/robot/variables/automatic_variables.txt
 /atest/testdata/variables/automatic_variables/auto1.txt
 /atest/testdata/variables/automatic_variables/auto2.txt
 /atest/testdata/variables/automatic_variables/resource.txt
 /src/robot/running/namespace.py

=======================================
--- /dev/null
+++ /atest/testdata/variables/automatic_variables/__init__.txt Thu Aug 30 13:40:45 2012
@@ -0,0 +1,6 @@
+*** Settings ***
+Documentation     The doc.
+Metadata          Name    Value
+Suite Setup       Check Variables In Suite Setup    Automatic Variables
+...               The doc.    {'Name': 'Value'}
+Resource          resource.txt
=======================================
--- /atest/robot/variables/automatic_variables.txt      Thu Aug 30 06:46:36 2012
+++ /atest/robot/variables/automatic_variables.txt      Thu Aug 30 13:40:45 2012
@@ -21,6 +21,11 @@

 Suite Documentation
     Check Test Case    ${TEST NAME}
+
+Suite Metadata
+    Check Test Case    ${TEST NAME}
+    Should Be Equal    ${SUITE.suites[0].metadata['MeTa1']}    Value
+ Dictionary Should Not Contain Key ${SUITE.suites[0].metadata} NotSet

 Suite Status And Suite Message Are Not Visible In Tests
     Check Test Case    ${TEST NAME}
=======================================
--- /atest/testdata/variables/automatic_variables/auto1.txt Thu Aug 30 06:46:36 2012 +++ /atest/testdata/variables/automatic_variables/auto1.txt Thu Aug 30 13:40:45 2012
@@ -1,14 +1,21 @@
 *** Setting ***
 Documentation     This is suite documentation.
-Suite Setup       Check All Variables In Suite Setup    ${EXP_SUITE_NAME}
-Suite Teardown Check All Variables In Suite Teardown ${EXP_SUITE_NAME} -... FAIL ${EXP_SUITE_STATS} Previous Test Variables Should Have Correct Values When That Test Fails PASS
+Metadata          MeTa1    Value
+Metadata          meta2    value
+Suite Setup       Check Variables In Suite Setup    ${EXP_SUITE_NAME}
+...               ${EXP_SUITE_DOC}    ${EXP_SUITE_META}
+Suite Teardown    Check Variables In Suite Teardown    ${EXP_SUITE_NAME}
+...               FAIL    ${EXP_SUITE_STATS}    @{LAST_TEST}
 Force Tags        Force 1
 Resource          resource.txt
+Library           Collections

 *** Variable ***
 ${EXP_SUITE_NAME}    Automatic Variables.Auto1
-${EXP_SUITE_STATS} 12 critical tests, 10 passed, 2 failed\n 12 tests total, 10 passed, 2 failed
+${EXP_SUITE_DOC}     This is suite documentation.
+${EXP_SUITE_META}    {'MeTa1': 'Value', 'meta2': 'value'}
+${EXP_SUITE_STATS} 13 critical tests, 11 passed, 2 failed\n 13 tests total, 11 passed, 2 failed +@{LAST_TEST} Previous Test Variables Should Have Correct Values When That Test Fails PASS

 *** Test Case ***
 Previous Test Variables Should Have Default Values
@@ -38,6 +45,11 @@
 Suite Documentation
Should Be Equal ${SUITE_DOCUMENTATION} This is suite documentation.

+Suite Metadata
+ Should Be True ${SUITE METADATA} == {'MeTa1': 'Value', 'meta2': 'value'}
+    Set To Dictionary    ${SUITE METADATA}    Meta1    not really set
+    Set To Dictionary    ${SUITE METADATA}    NotSet    not really set
+
 Suite Status And Suite Message Are Not Visible In Tests
     Variable Should Not Exist    $SUITE_STATUS
     Variable Should Not Exist    $SUITE_MESSAGE
=======================================
--- /atest/testdata/variables/automatic_variables/auto2.txt Thu Aug 30 06:46:36 2012 +++ /atest/testdata/variables/automatic_variables/auto2.txt Thu Aug 30 13:40:45 2012
@@ -1,10 +1,14 @@
 *** Setting ***
-Suite Setup Check All Variables In Suite Setup Automatic Variables.Auto2 @{PREV_TEST} -Suite Teardown Check All Variables In Suite Teardown Automatic Variables.Auto2 FAIL 1 critical test, 0 passed, 1 failed\n 1 test total, 0 passed, 1 failed Previous Test Variables Should Have Default Values From Previous Suite FAIL Expected failure +Suite Setup Check Variables In Suite Setup Automatic Variables.Auto2
+...               ${EMPTY}    {}    @{PREV_TEST}
+Suite Teardown Check Variables In Suite Teardown Automatic Variables.Auto2 FAIL +... 1 critical test, 0 passed, 1 failed\n 1 test total, 0 passed, 1 failed
+...               @{LAST_TEST}
 Resource          resource.txt

 *** Variable ***
@{PREV_TEST} Previous Test Variables Should Have Correct Values When That Test Fails PASS +@{LAST_TEST} Previous Test Variables Should Have Default Values From Previous Suite FAIL Expected failure

 *** Test Case ***
 Previous Test Variables Should Have Default Values From Previous Suite
=======================================
--- /atest/testdata/variables/automatic_variables/resource.txt Thu Aug 30 06:33:25 2012 +++ /atest/testdata/variables/automatic_variables/resource.txt Thu Aug 30 13:40:45 2012
@@ -1,13 +1,15 @@
 *** Keyword ***
-Check All Variables In Suite Setup
-    [Arguments]    ${name}    @{prev_test}
+Check Variables In Suite Setup
+    [Arguments]    ${name}    ${doc}    ${meta}    @{prev_test}
     Check Test Variables Do Not Exist
     Check Previous Test Variables    @{prev_test}
     Should Be Equal    ${SUITE_NAME}    ${name}
+    Should Be Equal    ${SUITE_DOCUMENTATION}    ${doc}
+    Should Be True    ${SUITE METADATA} == ${meta}
     Variable Should Not Exist    $SUITE_STATUS
     Variable Should Not Exist    $SUITE_MESSAGE

-Check All Variables In Suite Teardown
+Check Variables In Suite Teardown
     [Arguments]    ${name}    ${status}    ${message}    @{prev_test}
     Check Test Variables Do Not Exist
     Check Previous Test Variables    @{prev_test}
=======================================
--- /src/robot/running/namespace.py     Thu Jun 28 01:09:58 2012
+++ /src/robot/running/namespace.py     Thu Aug 30 13:40:45 2012
@@ -64,6 +64,7 @@
         variables['${SUITE_NAME}'] = suite.longname
         variables['${SUITE_SOURCE}'] = suite.source
         variables['${SUITE_DOCUMENTATION}'] = suite.doc
+        variables['${SUITE_METADATA}'] = suite.metadata.copy()
         return variables

     def _import_default_libraries(self):

==============================================================================
Revision: 3aeb8c22cce3
Author:   Pekka Klärck
Date:     Thu Aug 30 13:53:58 2012
Log:      Code and tests for `BuiltIn.Set Suite Metadata`.

Update issue 1134
`Set Suite Metadata` done.
http://code.google.com/p/robotframework/source/detail?r=3aeb8c22cce3

Added:
 /atest/robot/standard_libraries/builtin/set_suite_metadata.txt
 /atest/testdata/standard_libraries/builtin/set_suite_metadata.txt
Modified:
 /src/robot/libraries/BuiltIn.py
 /src/robot/output/xmllogger.py

=======================================
--- /dev/null
+++ /atest/robot/standard_libraries/builtin/set_suite_metadata.txt Thu Aug 30 13:53:58 2012
@@ -0,0 +1,38 @@
+*** Settings ***
+Suite Setup Run Tests ${EMPTY} standard_libraries/builtin/set_suite_metadata.txt
+Force Tags        regression    jybot    pybot
+Resource          atest_resource.txt
+
+*** Test Cases ***
+Set new value
+    Metadata should have value    New metadata    Set in test
+    ${tc} =    Check test case    ${TESTNAME}
+    Check log message    ${tc.kws[0].msgs[0]}
+    ...    Set suite metadata 'New metadata' to value 'Set in test'.
+
+Override existing value
+    Metadata should have value    Initial    New value
+    ${tc} =    Check test case    ${TESTNAME}
+    Check log message    ${tc.kws[0].msgs[0]}
+    ...    Set suite metadata 'Initial' to value 'New value'.
+
+Names are case and space insensitive
+    Metadata should have value    My Name    final value
+    ${tc} =    Check test case    ${TESTNAME}
+    Check log message    ${tc.kws[1].msgs[0]}
+    ...    Set suite metadata 'MYname' to value 'final value'.
+
+Modifying ${SUITE METADATA} has no effect also after setting metadata
+    Check test case    ${TESTNAME}
+    Metadata should have value    Cannot be   set otherwise
+
+Set in suite setup
+    Metadata should have value    Setup    Value
+
+Set in suite teardown
+    Metadata should have value    Teardown    Another value
+
+*** Keywords ***
+Metadata should have value
+    [Arguments]    ${name}    ${value}
+    Should Be Equal    ${SUITE.metadata['${name}']}    ${value}
=======================================
--- /dev/null
+++ /atest/testdata/standard_libraries/builtin/set_suite_metadata.txt Thu Aug 30 13:53:58 2012
@@ -0,0 +1,30 @@
+*** Settings ***
+Metadata          Initial    Value
+Suite Setup       Set Suite Metadata    Setup    Value
+Suite Teardown    Set Suite Metadata    Teardown    Another value
+Library           Collections
+
+*** Test Cases ***
+Set new value
+    Set Suite Metadata    New metadata    Set in test
+    Metadata variable should have value    New metadata    Set in test
+
+Override existing value
+    Set Suite Metadata    Initial    New value
+    Metadata variable should have value    Initial    New value
+
+Names are case and space insensitive
+    Set Suite Metadata    My Name    overwritten
+    Set Suite Metadata    MYname    final value
+    Metadata variable should have value    My Name    final value
+
+Modifying ${SUITE METADATA} has no effect also after setting metadata
+    [Documentation]    The variable changes but actual metadata does not
+    Set Suite Metadata    Cannot be   set otherwise
+ Set To Dictionary ${SUITE METADATA} Cannot be really set this way
+    Metadata variable should have value    Cannot be   really set this way
+
+*** Keywords ***
+Metadata variable should have value
+    [Arguments]    ${name}    ${value}
+    Should Be Equal    ${SUITE METADATA['${name}']}    ${value}
=======================================
--- /src/robot/libraries/BuiltIn.py     Thu Aug 30 05:31:04 2012
+++ /src/robot/libraries/BuiltIn.py     Thu Aug 30 13:53:58 2012
@@ -1841,9 +1841,9 @@
         self.log('Set test documentation to:\n%s' % doc)

     def set_suite_documentation(self, doc):
-        """Sets documentation for for the current suite.
+        """Sets documentation for the current suite.

-        The current documentation is available from built-in variable
+        The current documentation is available in built-in variable
         ${SUITE DOCUMENTATION}.

         New in Robot Framework 2.7.
@@ -1855,6 +1855,19 @@
         self._variables.set_suite('${SUITE_DOCUMENTATION}', suite.doc)
         self.log('Set suite documentation to:\n%s' % doc)

+    def set_suite_metadata(self, name, value):
+        """Sets metadata for the current suite.
+
+ The current metadata is available as a Python dictionary in built-in
+        variable ${SUITE METADATA}. Notice that modifying that variable
+        directly has no effect on the actual metadata the suite has.
+
+        New in Robot Framework 2.7.4.
+        """
+        metadata = self._namespace.suite.metadata
+        metadata[name] = value
+        self._variables.set_suite('${SUITE_METADATA}', metadata.copy())
+        self.log("Set suite metadata '%s' to value '%s'." % (name, value))

     def set_tags(self, *tags):
         """Adds given `tags` for the current test or all tests in a suite.
=======================================
--- /src/robot/output/xmllogger.py      Fri Jun 15 03:58:24 2012
+++ /src/robot/output/xmllogger.py      Thu Aug 30 13:53:58 2012
@@ -90,13 +90,13 @@
         if suite.source:
             attrs['source'] = suite.source
         self._writer.start('suite', attrs)
+
+    def end_suite(self, suite):
+        self._writer.element('doc', suite.doc)
         self._writer.start('metadata')
         for name, value in suite.metadata.items():
             self._writer.element('item', value, {'name': name})
         self._writer.end('metadata')
-
-    def end_suite(self, suite):
-        self._writer.element('doc', suite.doc)
         self._write_status(suite, suite.message)
         self._writer.end('suite')


==============================================================================
Revision: a847b8493ecc
Author:   Pekka Klärck
Date:     Thu Aug 30 13:55:11 2012
Log:      Documented ${SUITE METADATA}.

Update issue 1134
Status: Done
${SUITE METADATA} now also documented in the User Guide.

This issue ought to be done.
http://code.google.com/p/robotframework/source/detail?r=a847b8493ecc

Modified:
 /doc/userguide/src/CreatingTestData/Variables.txt

=======================================
--- /doc/userguide/src/CreatingTestData/Variables.txt Thu Aug 30 13:13:51 2012 +++ /doc/userguide/src/CreatingTestData/Variables.txt Thu Aug 30 13:55:11 2012
@@ -745,6 +745,10 @@
| ${SUITE DOCUMENTATION} | The documentation of the current test suite. Can be | Everywhere | | | set dynamically using using :name:`Set Suite | | | | Documentation` keyword. New in Robot Framework 2.7. | | + +------------------------+-------------------------------------------------------+------------+ + | ${SUITE METADATA} | The free metadata of the current test suite. Can be | Everywhere | + | | set using :name:`Set Suite Metadata` keyword. | | + | | New in Robot Framework 2.7.4. | | +------------------------+-------------------------------------------------------+------------+ | ${SUITE STATUS} | The status of the current test suite, either PASS or | `Suite | | | FAIL. | teardown`_ |

==============================================================================
Revision: cc68c49e9326
Author:   Pekka Klärck
Date:     Thu Aug 30 13:59:37 2012
Log:      Small BuiltIn doc tuning
http://code.google.com/p/robotframework/source/detail?r=cc68c49e9326

Modified:
 /src/robot/libraries/BuiltIn.py

=======================================
--- /src/robot/libraries/BuiltIn.py     Thu Aug 30 13:53:58 2012
+++ /src/robot/libraries/BuiltIn.py     Thu Aug 30 13:59:37 2012
@@ -1257,7 +1257,7 @@
         first value is returned, and otherwise the second value is
         returned. The second value can also be omitted, in which case
         it has a default value None. This usage is illustrated in the
-        examples below, where ${rc} is assumed to be zero.
+        examples below, where `${rc}` is assumed to be zero.

         | ${var1} = | Set Variable If | ${rc} == 0 | zero     | nonzero |
         | ${var2} = | Set Variable If | ${rc} > 0  | value1   | value2  |
@@ -1741,7 +1741,7 @@
         list of Python modules to be imported and added to the
         namespace of the evaluated `expression`.

-        Examples (expecting ${result} is 3.14):
+        Examples (expecting `${result}` is 3.14):
         | ${status} = | Evaluate | 0 < ${result} < 10    |
         | ${down}   = | Evaluate | int(${result})        |
         | ${up}     = | Evaluate | math.ceil(${result})  | math |
@@ -1825,7 +1825,7 @@
         """Sets documentation for for the current test.

         The current documentation is available from built-in variable
-        ${TEST DOCUMENTATION}. This keyword can not be used in suite
+        `${TEST DOCUMENTATION}`. This keyword can not be used in suite
         setup or suite teardown.

         New in Robot Framework 2.7.
@@ -1844,7 +1844,7 @@
         """Sets documentation for the current suite.

         The current documentation is available in built-in variable
-        ${SUITE DOCUMENTATION}.
+        `${SUITE DOCUMENTATION}`.

         New in Robot Framework 2.7.
         """
@@ -1859,7 +1859,7 @@
         """Sets metadata for the current suite.

The current metadata is available as a Python dictionary in built-in
-        variable ${SUITE METADATA}. Notice that modifying that variable
+        variable `${SUITE METADATA}`. Notice that modifying that variable
         directly has no effect on the actual metadata the suite has.

         New in Robot Framework 2.7.4.

Reply via email to