Revision: 3159
Author: pekka.klarck
Date: Tue May 4 09:20:16 2010
Log: added some more complex tests
http://code.google.com/p/robotframework/source/detail?r=3159
Modified:
/trunk/atest/robot/running/continue_on_failure.txt
/trunk/atest/testdata/running/continue_on_failure.txt
=======================================
--- /trunk/atest/robot/running/continue_on_failure.txt Tue May 4 08:10:49
2010
+++ /trunk/atest/robot/running/continue_on_failure.txt Tue May 4 09:20:16
2010
@@ -21,9 +21,8 @@
Continue in user keyword with several continuable failures
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[1].msgs[0]} This should be
executed in Test Case (with ∏ön ÄßÇïï €§)
- Check Log Message ${tc.kws[0].kws[3].msgs[0]} This should also be
executed in Test Case
- Check Log Message ${tc.kws[0].kws[5].msgs[0]} This too should also
be executed in Test Case
+ Verify all failures in user keyword ${tc.kws[0]} Test Case
+ Verify all failures in user keyword ${tc.kws[1]} Test Case, Again
Continuable and regular failure
${tc}= Check Test Case ${TESTNAME}
@@ -32,12 +31,14 @@
Continue in nested user keyword
${tc}= Check Test Case ${TESTNAME}
Check Log Message ${tc.kws[0].kws[1].msgs[0]} This should be
executed in Top Level UK (with ∏ön ÄßÇïï €§)
+ Verify all failures in user keyword ${tc.kws[0].kws[2]} Nested UK
Continuable and regular failure in UK
${tc}= Check Test Case ${TESTNAME}
-Continuable and regular failure in nested UK
+Several continuable failures and regular failure in nested UK
${tc}= Check Test Case ${TESTNAME}
+ Verify all failures in user keyword ${tc.kws[0].kws[1].kws[2]}
Nested UK
Continue when setting variables
${tc}= Check Test Case ${TESTNAME}
@@ -57,6 +58,12 @@
${tc}= Check Test Case ${TESTNAME}
Check Log Message ${tc.teardown.kws[1].msgs[0]} This should be
executed in Test Teardown
+Continue many times in test setup and teardown
+ ${tc}= Check Test Case ${TESTNAME}
+ Verify all failures in user keyword ${tc.setup} Test Setup
+ Should Be Equal As Numbers ${tc.kws.__len__()} 0
+ Verify all failures in user keyword ${tc.teardown} Test Teardown
+
Continue in suite teardown
${suite}= Get Test Suite Continue On Failure
Check Log Message ${suite.teardown.kws[1].msgs[0]} This should be
executed in Suite Teardown
@@ -64,3 +71,13 @@
Continue in suite setup
${suite}= Get Test Suite Continue On Failure In Suite Setup
Check Log Message ${suite.setup.kws[1].msgs[0]} This should be
executed in Suite Setup (with ∏ön ÄßÇïï €§)
+
+
+*** Keywords ***
+Verify all failures in user keyword [Arguments] ${kw} ${where}
+ Check Log Message ${kw.kws[0].msgs[0]}
ContinuableApocalypseException: 1 FAIL
+ Check Log Message ${kw.kws[1].msgs[0]} This should be executed in
${where} (with ∏ön ÄßÇïï €§)
+ Check Log Message ${kw.kws[2].msgs[0]}
ContinuableApocalypseException: 2 FAIL
+ Check Log Message ${kw.kws[3].msgs[0]} This should also be executed
in ${where}
+ Check Log Message ${kw.kws[4].msgs[0]}
ContinuableApocalypseException: 3 FAIL
+ Check Log Message ${kw.kws[5].msgs[0]} This too should also be
executed in ${where}
=======================================
--- /trunk/atest/testdata/running/continue_on_failure.txt Tue May 4
08:24:32 2010
+++ /trunk/atest/testdata/running/continue_on_failure.txt Tue May 4
09:20:16 2010
@@ -5,7 +5,8 @@
*** Variables ***
${HEADER} Several failures occurred:
-${ERROR} ContinuableApocalypseException: Can be continued
+${EXC} ContinuableApocalypseException
+${ERROR} ${EXC}: Can be continued
${TEARDOWN ERROR} Also teardown of the parent suite failed.
${ERROR WITH TEARDOWN} ${ERROR}\n\n${TEARDOWN ERROR}
@@ -22,22 +23,26 @@
Continue in test with several continuable failures
[Documentation] FAIL ${HEADER}\n\n
- ... 1) ${ERROR}\n\n
- ... 2) ${ERROR}\n\n
- ... 3) ${ERROR WITH TEARDOWN}
- Raise Continuable Failure
+ ... 1) ${EXC}: A\n\n
+ ... 2) ${EXC}: B\n\n
+ ... 3) ${EXC}: C\n\n${TEARDOWN ERROR}
+ Raise Continuable Failure A
Log This should be executed
- Raise Continuable Failure
+ Raise Continuable Failure B
Log This should also be executed
- Raise Continuable Failure
+ Raise Continuable Failure C
Log This too should also be executed
Continue in user keyword with several continuable failures
[Documentation] FAIL ${HEADER}\n\n
- ... 1) ${ERROR}\n\n
- ... 2) ${ERROR}\n\n
- ... 3) ${ERROR WITH TEARDOWN}
+ ... 1) ${EXC}: 1\n\n
+ ... 2) ${EXC}: 2\n\n
+ ... 3) ${EXC}: 3\n\n
+ ... 4) ${EXC}: 1\n\n
+ ... 5) ${EXC}: 2\n\n
+ ... 6) ${EXC}: 3\n\n${TEARDOWN ERROR}
Several Continuable Failures In User Keyword In Test Case
+ Several Continuable Failures In User Keyword In Test Case, Again
Continuable and regular failure
[Documentation] FAIL ${HEADER}\n\n
@@ -51,23 +56,32 @@
Continue in nested user keyword
[Documentation] FAIL ${HEADER}\n\n
... 1) ${ERROR} in top level (with ∏ön ÄßÇïï €§)\n\n
- ... 2) ${ERROR}\n\n
- ... 3) ${ERROR}\n\n
- ... 4) ${ERROR}\n\n
+ ... 2) ${EXC}: 1\n\n
+ ... 3) ${EXC}: 2\n\n
+ ... 4) ${EXC}: 3\n\n
... 5) ${ERROR} in top level after nesting (with ∏ön ÄßÇïï
€§)\n\n${TEARDOWN ERROR}
Continuable Failure In Nested UK
Continuable and regular failure in UK
[Documentation] FAIL ${HEADER}\n\n
- ... 1) ${ERROR}\n\n
- ... 2) Stop!!\n\n${TEARDOWN ERROR}
+ ... 1) ${EXC}: one\n\n
+ ... 2) ${EXC}: two\n\n
+ ... 3) Stop!!\n\n${TEARDOWN ERROR}
Continuable and regular failure
Fail This should not be executed
-Continuable and regular failure in nested UK
+Several continuable failures and regular failure in nested UK
[Documentation] FAIL ${HEADER}\n\n
- ... 1) ${ERROR}\n\n
- ... 2) Stop!!\n\n${TEARDOWN ERROR}
+ ... 1) ${EXC}: first level 1\n\n
+ ... 2) ${EXC}: Can be continued in top level (with ∏ön ÄßÇïï €§)\n\n
+ ... 3) ${EXC}: 1\n\n
+ ... 4) ${EXC}: 2\n\n
+ ... 5) ${EXC}: 3\n\n
+ ... 6) ${EXC}: Can be continued in top level after nesting (with ∏ön
ÄßÇïï €§)\n\n
+ ... 7) ${EXC}: first level 2\n\n
+ ... 8) ${EXC}: one\n\n
+ ... 9) ${EXC}: two\n\n
+ ... 10) Stop!!\n\n${TEARDOWN ERROR}
Continuable and regular failure in nested UK
Fail This should not be executed
@@ -87,7 +101,7 @@
Continue in test setup
[Documentation] FAIL Setup failed:\n${ERROR WITH TEARDOWN}
- [setup] Continuable Failure In User Keyword In Test Setup
+ [Setup] Continuable Failure In User Keyword In Test Setup
Fail This should not be executed (with ∏ön ÄßÇïï €§)
Continue in test teardown
@@ -95,18 +109,34 @@
No operation
[Teardown] Continuable Failure In User Keyword In Test Teardown
+Continue many times in test setup and teardown
+ [Documentation] FAIL Setup failed:\n
+ ... ${HEADER}\n\n
+ ... 1) ${EXC}: 1\n\n
+ ... 2) ${EXC}: 2\n\n
+ ... 3) ${EXC}: 3\n\n
+ ... Also teardown failed:\n
+ ... ${HEADER}\n\n
+ ... 1) ${EXC}: 1\n\n
+ ... 2) ${EXC}: 2\n\n
+ ... 3) ${EXC}: 3\n\n${TEARDOWN ERROR}
+ [Setup] Several Continuable Failures In User Keyword In Test Setup
+ Fail This should not be executed
+ [Teardown] Several Continuable Failures In User Keyword In Test
Teardown
+
*** User Keywords ***
+
Continuable Failure In User Keyword In ${where}
Raise Continuable Failure
Log This should be executed in ${where}
Several Continuable Failures In User Keyword In ${where}
- Raise Continuable Failure
+ Raise Continuable Failure 1
Log This should be executed in ${where} (with ∏ön ÄßÇïï €§)
- Raise Continuable Failure
+ Raise Continuable Failure 2
Log This should also be executed in ${where}
- Raise Continuable Failure
+ Raise Continuable Failure 3
Log This too should also be executed in ${where}
Continuable Failure In Nested UK
@@ -116,10 +146,14 @@
Raise Continuable Failure Can be continued in top level after nesting
(with ∏ön ÄßÇïï €§)
Continuable and regular failure in nested UK
+ Raise Continuable Failure first level 1
+ Continuable Failure In Nested UK
+ Raise Continuable Failure first level 2
Continuable and regular failure
- Log This should not be executed
+ Fail This should not be executed
Continuable and regular failure
- Raise Continuable Failure
+ Raise Continuable Failure one
+ Raise Continuable Failure two
Log This should be executed in Nested UK (with ∏ön ÄßÇïï €§)
Fail Stop!!