Skip to content

Commit c28525f

Browse files
committed
Enhance GROUP (#5257) docs
1 parent af1b306 commit c28525f

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

doc/userguide/src/CreatingTestData/ControlStructures.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,8 +1313,7 @@ __ `User keyword teardown`_
13131313
`GROUP` syntax
13141314
--------------
13151315

1316-
Robot Framework 7.2 introduced the `GROUP` syntax that allows grouping related
1317-
keywords and control structures together:
1316+
The `GROUP` syntax allows grouping related keywords and control structures together:
13181317

13191318
.. sourcecode:: robotframework
13201319

@@ -1333,19 +1332,22 @@ keywords and control structures together:
13331332
END
13341333

13351334
As the above example demonstrates, groups can have a name, but the name is
1336-
optional. Groups can be nested freely with each others and also with other control
1337-
structures.
1335+
optional. Groups can be nested freely with each others and also with other
1336+
control structures.
13381337

1339-
Notice that reusable `user keywords`_ are in general recommended over the `GROUP`
1340-
syntax, but if there are no reusing possibilities, named groups give similar benefits.
1341-
For example, in the log file the end result is exactly the same except that there is
1342-
a `GROUP` label instead of a `KEYWORD` label.
1338+
`User keywords`_ are in general recommended over the `GROUP` syntax, because
1339+
they are reusable and they simplify tests or keywords where they are used by
1340+
hiding and encapsulating lower level details. In the log file user keywords
1341+
and groups look the same, though, except that instead of a `KEYWORD` label
1342+
there is a `GROUP` label.
13431343

1344-
All groups within a test or a user keyword share the same variable namespace.
1344+
All groups within a test or a keyword share the same variable namespace.
13451345
This means that, unlike when using keywords, there is no need to use arguments
13461346
or return values for sharing values. This can be a benefit in simple cases,
1347-
but if there are lot of variables, the benefit can turn into a problem and cause
1348-
a huge mess.
1347+
but if there are lot of variables, the benefit can turn into a problem and
1348+
cause a huge mess.
1349+
1350+
.. note:: The `GROUP` syntax is new in Robot Framework 7.2.
13491351

13501352
`GROUP` with templates
13511353
~~~~~~~~~~~~~~~~~~~~~~
@@ -1389,7 +1391,6 @@ be added similarly also by `listeners`_ that use the `listener API version 3`__.
13891391

13901392
.. sourcecode:: python
13911393

1392-
13931394
from robot.api import SuiteVisitor
13941395

13951396

0 commit comments

Comments
 (0)