Skip to content

Commit

Permalink
Small UG tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
pekkaklarck committed Jun 11, 2023
1 parent 2782221 commit 4c30d2c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions doc/userguide/src/CreatingTestData/TestDataSyntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ meant to be edited manually. Its most important use cases are:

- Transferring data between processes and machines. A suite can be converted
to JSON in one machine and recreated somewhere else.
- Saving a suite constructed from normal Robot Framework data into a single
JSON file that is faster to parse.
- Saving a suite, possibly a nested suite, constructed from normal Robot Framework
data into a single JSON file that is faster to parse.
- Alternative data format for external tools generating tests or tasks.

.. note:: The JSON data support is new in Robot Framework 6.1 and it can be
Expand All @@ -350,8 +350,10 @@ configuration options related to JSON formatting:

# Create suite based on data on the file system.
suite = TestSuite.from_file_system('/path/to/data')

# Get JSON data as a string.
data = suite.to_json()

# Save JSON data to a file with custom indentation.
suite.to_json('data.rbt', indent=2)

Expand All @@ -374,6 +376,7 @@ method. It works both with JSON strings and paths to JSON files:

# Create suite from JSON data in a file.
suite = TestSuite.from_json('data.rbt')

# Create suite from a JSON string.
suite = TestSuite.from_json('{"name": "Suite", "tests": [{"name": "Test"}]}')

Expand All @@ -386,11 +389,11 @@ __ https://robot-framework.readthedocs.io/en/master/autodoc/robot.running.html#r
Executing JSON files
''''''''''''''''''''

When using the `robot` command normally, JSON files with the :file:`.rbt`
extension are parsed automatically. This includes running individual JSON files
like `robot tests.rbt` and running directories containing :file:`.rbt` files.
If you would rather use the standard :file:`.json` extension, you need to
`configure which files are parsed`__.
When executing tests or tasks using the `robot` command, JSON files with
the custom :file:`.rbt` extension are parsed automatically. This includes
running individual JSON files like `robot tests.rbt` and running directories
containing :file:`.rbt` files. If you would rather use the standard
:file:`.json` extension, you need to `configure which files are parsed`__.

__ `Selecting files to parse`_

Expand Down

0 comments on commit 4c30d2c

Please sign in to comment.