-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
414 additions
and
14 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Timeout] and [Setup] order for keywords in OrderSettings (#690) | ||
----------------------------------------------------------------- | ||
|
||
Default order of keyword settings in ``OrderSettings`` transformer was modified. Robot Framework 7.0 added ``[Setup]`` | ||
to keywords (which wasn't supported by Robotidy until now). ``[Timeout]`` order was also changed. | ||
|
||
Old default order was ``documentation,tags,timeout,arguments`` and new order is | ||
``documentation,tags,arguments,timeout,setup``. | ||
|
||
``[Timeout]`` order was changed to follow Robot Framework Style Guide recommendation. | ||
|
||
If you are using ``OrderSettings`` with custom order, this change requires to add ``setup`` to your order. | ||
|
||
Note that if you're using ``[Setup]`` with keywords in your code (supported in RF from 7.0) but run Robotidy with older | ||
version (pre 7.0) it will order ``[Setup]`` like a keyword call - essentially ignoring its order. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
tests/atest/transformers/OrderSettings/expected/custom_order_all_end_pre_rf7.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
*** Test Cases *** | ||
Test case 1 | ||
Keyword | ||
Keyword | ||
[Documentation] this is | ||
... doc | ||
[Tags] | ||
... tag | ||
[Setup] Setup # comment | ||
[Teardown] Teardown | ||
|
||
Test case 2 | ||
Keyword | ||
[Timeout] timeout2 # this is error because it is duplicate | ||
[Template] Template | ||
[Timeout] timeout | ||
|
||
Test case with comment at the end | ||
[Teardown] Keyword | ||
# comment | ||
|
||
# comment | ||
|
||
Test case 3 | ||
Golden Keyword | ||
|
||
Test case 4 | ||
Keyword1 | ||
# comment1 | ||
Keyword2 | ||
# comment2 | ||
Keyword3 | ||
[Teardown] teardown | ||
|
||
Test case 5 # comment1 | ||
Keyword1 | ||
# comment2 | ||
Keyword2 | ||
# comment3 | ||
Keyword3 | ||
[Documentation] this is | ||
[Teardown] teardown | ||
|
||
*** Keywords *** | ||
Keyword | ||
Keyword | ||
No Operation | ||
IF ${condition} | ||
Log ${stuff} | ||
END | ||
FOR ${var} IN 1 2 | ||
Log ${var} | ||
END | ||
Pass | ||
[Setup] Setup | ||
[Documentation] this is | ||
... doc | ||
[Tags] sanity | ||
[Arguments] ${arg} | ||
[Teardown] Keyword | ||
[Return] ${value} | ||
|
||
Another Keyword ${var} | ||
No Operation | ||
[Timeout] | ||
|
||
Keyword With Comment | ||
Keyword | ||
[Return] ${value} | ||
# I am comment | ||
|
||
Keyword With Empty Line And Comment | ||
Keyword | ||
[Return] ${value} | ||
|
||
# I am comment in new line | ||
|
||
Another Keyword | ||
No Operation | ||
# innocent comment | ||
|
||
Comment Before setting | ||
Keyword | ||
# I want to be here | ||
[Return] ${value} | ||
|
||
Return first and comment last | ||
Keyword | ||
[Return] stuff | ||
# I want to be here | ||
|
||
Comment on the same line # comment | ||
[Documentation] this is | ||
... doc | ||
# what will happen with me? |
96 changes: 96 additions & 0 deletions
96
tests/atest/transformers/OrderSettings/expected/custom_order_default_pre_rf7.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
*** Test Cases *** | ||
Test case 1 | ||
[Documentation] this is | ||
... doc | ||
[Tags] | ||
... tag | ||
[Setup] Setup # comment | ||
Keyword | ||
Keyword | ||
[Teardown] Teardown | ||
|
||
Test case 2 | ||
[Template] Template | ||
[Timeout] timeout | ||
Keyword | ||
[Timeout] timeout2 # this is error because it is duplicate | ||
|
||
Test case with comment at the end | ||
[Teardown] Keyword | ||
# comment | ||
|
||
# comment | ||
|
||
Test case 3 | ||
Golden Keyword | ||
|
||
Test case 4 | ||
Keyword1 | ||
# comment1 | ||
Keyword2 | ||
# comment2 | ||
Keyword3 | ||
[Teardown] teardown | ||
|
||
Test case 5 # comment1 | ||
[Documentation] this is | ||
Keyword1 | ||
# comment2 | ||
Keyword2 | ||
# comment3 | ||
Keyword3 | ||
[Teardown] teardown | ||
|
||
*** Keywords *** | ||
Keyword | ||
[Documentation] this is | ||
... doc | ||
[Tags] sanity | ||
[Arguments] ${arg} | ||
Keyword | ||
No Operation | ||
IF ${condition} | ||
Log ${stuff} | ||
END | ||
FOR ${var} IN 1 2 | ||
Log ${var} | ||
END | ||
Pass | ||
[Setup] Setup | ||
[Teardown] Keyword | ||
[Return] ${value} | ||
|
||
Another Keyword ${var} | ||
[Timeout] | ||
No Operation | ||
|
||
Keyword With Comment | ||
Keyword | ||
[Return] ${value} | ||
# I am comment | ||
|
||
Keyword With Empty Line And Comment | ||
Keyword | ||
[Return] ${value} | ||
|
||
# I am comment in new line | ||
|
||
Another Keyword | ||
No Operation | ||
# innocent comment | ||
|
||
Comment Before setting | ||
Keyword | ||
# I want to be here | ||
[Return] ${value} | ||
|
||
Return first and comment last | ||
Keyword | ||
[Return] stuff | ||
# I want to be here | ||
|
||
Comment on the same line # comment | ||
[Documentation] this is | ||
... doc | ||
# what will happen with me? |
96 changes: 96 additions & 0 deletions
96
...test/transformers/OrderSettings/expected/custom_order_without_test_teardown_pre_rf7.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
*** Test Cases *** | ||
Test case 1 | ||
[Documentation] this is | ||
... doc | ||
[Tags] | ||
... tag | ||
[Setup] Setup # comment | ||
[Teardown] Teardown | ||
Keyword | ||
Keyword | ||
|
||
Test case 2 | ||
[Template] Template | ||
[Timeout] timeout | ||
Keyword | ||
[Timeout] timeout2 # this is error because it is duplicate | ||
|
||
Test case with comment at the end | ||
[Teardown] Keyword | ||
# comment | ||
|
||
# comment | ||
|
||
Test case 3 | ||
Golden Keyword | ||
|
||
Test case 4 | ||
[Teardown] teardown | ||
Keyword1 | ||
# comment1 | ||
Keyword2 | ||
# comment2 | ||
Keyword3 | ||
|
||
Test case 5 # comment1 | ||
[Documentation] this is | ||
[Teardown] teardown | ||
Keyword1 | ||
# comment2 | ||
Keyword2 | ||
# comment3 | ||
Keyword3 | ||
|
||
*** Keywords *** | ||
Keyword | ||
[Documentation] this is | ||
... doc | ||
[Tags] sanity | ||
[Arguments] ${arg} | ||
Keyword | ||
No Operation | ||
IF ${condition} | ||
Log ${stuff} | ||
END | ||
FOR ${var} IN 1 2 | ||
Log ${var} | ||
END | ||
Pass | ||
[Setup] Setup | ||
[Teardown] Keyword | ||
[Return] ${value} | ||
|
||
Another Keyword ${var} | ||
[Timeout] | ||
No Operation | ||
|
||
Keyword With Comment | ||
Keyword | ||
[Return] ${value} | ||
# I am comment | ||
|
||
Keyword With Empty Line And Comment | ||
Keyword | ||
[Return] ${value} | ||
|
||
# I am comment in new line | ||
|
||
Another Keyword | ||
No Operation | ||
# innocent comment | ||
|
||
Comment Before setting | ||
Keyword | ||
# I want to be here | ||
[Return] ${value} | ||
|
||
Return first and comment last | ||
Keyword | ||
[Return] stuff | ||
# I want to be here | ||
|
||
Comment on the same line # comment | ||
[Documentation] this is | ||
... doc | ||
# what will happen with me? |
Oops, something went wrong.