' > atest/results/index.html
- zip -r -j site.zip atest/results > no_output 2>&1
- curl -s -H "Content-Type: application/zip" -H "Authorization: Bearer ${{ secrets.NETLIFY_TOKEN }}" --data-binary "@site.zip" https://api.netlify.com/api/v1/sites > response.json
- echo "REPORT_URL=$(cat response.json|python -c "import sys, json; print('https://' + json.load(sys.stdin)['subdomain'] + '.netlify.com')")" >> $GITHUB_ENV
- echo "JOB_STATUS=$(python -c "print('${{ job.status }}'.lower())")" >> $GITHUB_ENV
- if: always() && job.status == 'failure' && runner.os != 'Windows'
-
- - name: Upload results on Windows
- run: |
- echo '' > atest/results/index.html
- zip -r -j site.zip atest/results > no_output 2>&1
- curl -s -H "Content-Type: application/zip" -H "Authorization: Bearer ${{ secrets.NETLIFY_TOKEN }}" --data-binary "@site.zip" https://api.netlify.com/api/v1/sites > response.json
- echo "REPORT_URL=$(cat response.json|python -c "import sys, json; print('https://' + json.load(sys.stdin)['subdomain'] + '.netlify.com')")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- echo "JOB_STATUS=$(python -c "print('${{ job.status }}'.lower())")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- if: always() && job.status == 'failure' && runner.os == 'Windows'
-
- - uses: octokit/request-action@89697eb6635e52c6e1e5559f15b5c91ba5100cb0
- name: Update status with Github Status API
- id: update_status
- with:
- route: POST /repos/:repository/statuses/:sha
- repository: ${{ github.repository }}
- sha: ${{ github.sha }}
- state: "${{env.JOB_STATUS}}"
- target_url: "${{env.REPORT_URL}}"
- description: "Link to test report."
- context: at-results-${{ matrix.python-version }}-${{ matrix.os }}
+ - name: Install and run rflogs
+ if: failure()
env:
- GITHUB_TOKEN: ${{ secrets.STATUS_UPLOAD_TOKEN }}
- if: always() && job.status == 'failure'
+ RFLOGS_API_KEY: ${{ secrets.RFLOGS_API_KEY }}
+ working-directory: atest/results
+ shell: python
+ run: |
+ import os
+ import glob
+ import subprocess
+
+ # Install rflogs
+ subprocess.check_call(["pip", "install", "rflogs"])
+
+ # Find the first directory containing log.html
+ log_files = glob.glob("**/log.html", recursive=True)
+ if log_files:
+ result_dir = os.path.dirname(log_files[0])
+ print(f"Result directory: {result_dir}")
+
+ # Construct the rflogs command
+ cmd = [
+ "rflogs", "upload",
+ "--tag", f"workflow:${{ github.workflow }}",
+ "--tag", f"os:${{ runner.os }}",
+ "--tag", f"python-version:${{ matrix.python-version }}",
+ "--tag", f"branch:${{ github.head_ref || github.ref_name }}",
+ result_dir
+ ]
+
+ # Run rflogs upload
+ subprocess.check_call(cmd)
+ else:
+ print("No directory containing log.html found")
+ exit(1)
diff --git a/.github/workflows/acceptance_tests_cpython_pr.yml b/.github/workflows/acceptance_tests_cpython_pr.yml
index a47b2483c8f..1b49dc448fe 100644
--- a/.github/workflows/acceptance_tests_cpython_pr.yml
+++ b/.github/workflows/acceptance_tests_cpython_pr.yml
@@ -15,7 +15,7 @@ jobs:
fail-fast: true
matrix:
os: [ 'ubuntu-latest', 'windows-latest' ]
- python-version: [ '3.8', '3.12' ]
+ python-version: [ '3.8', '3.13' ]
include:
- os: ubuntu-latest
set_display: export DISPLAY=:99; Xvfb :99 -screen 0 1024x768x24 -ac -noreset & sleep 3
@@ -29,9 +29,9 @@ jobs:
- uses: actions/checkout@v4
- name: Setup python for starting the tests
- uses: actions/setup-python@v5.0.0
+ uses: actions/setup-python@v5.6.0
with:
- python-version: '3.11'
+ python-version: '3.13'
architecture: 'x64'
- name: Get test starter Python at Windows
@@ -43,7 +43,7 @@ jobs:
if: runner.os != 'Windows'
- name: Setup python ${{ matrix.python-version }} for running the tests
- uses: actions/setup-python@v5.0.0
+ uses: actions/setup-python@v5.6.0
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
@@ -56,16 +56,10 @@ jobs:
run: echo "BASE_PYTHON=$(which python)" >> $GITHUB_ENV
if: runner.os != 'Windows'
- - name: Install Report handling tools to Windows
- run: |
- choco install curl -y --no-progress
- choco install zip -y --no-progress
- if: runner.os == 'Windows'
-
- - name: Install screen and report handling tools, and other required libraries to Linux
+ - name: Install screen and other required libraries to Linux
run: |
sudo apt-get update
- sudo apt-get -y -q install xvfb scrot zip curl libxml2-dev libxslt1-dev
+ sudo apt-get -y -q install xvfb scrot libxml2-dev libxslt1-dev
if: contains(matrix.os, 'ubuntu')
- name: Run acceptance tests
@@ -76,16 +70,6 @@ jobs:
${{ matrix.set_display }}
${{ env.ATEST_PYTHON }} atest/run.py --interpreter ${{ env.BASE_PYTHON }} --exclude no-ci ${{ matrix.atest_args }} atest/robot
- - name: Delete output.xml (on Win)
- run: |
- Get-ChildItem atest/results -Include output.xml -Recurse | Remove-Item
- if: always() && runner.os == 'Windows'
-
- - name: Delete output.xml (on Unix-like)
- run: |
- find atest/results -type f -name 'output.xml' -exec rm {} +
- if: always() && runner.os != 'Windows'
-
- name: Archive acceptances test results
uses: actions/upload-artifact@v4
with:
@@ -93,35 +77,38 @@ jobs:
path: atest/results
if: always() && job.status == 'failure'
- - name: Upload results on *nix
- run: |
- echo '' > atest/results/index.html
- zip -r -j site.zip atest/results > no_output 2>&1
- curl -s -H "Content-Type: application/zip" -H "Authorization: Bearer ${{ secrets.NETLIFY_TOKEN }}" --data-binary "@site.zip" https://api.netlify.com/api/v1/sites > response.json
- echo "REPORT_URL=$(cat response.json|python -c "import sys, json; print('https://' + json.load(sys.stdin)['subdomain'] + '.netlify.com')")" >> $GITHUB_ENV
- echo "JOB_STATUS=$(python -c "print('${{ job.status }}'.lower())")" >> $GITHUB_ENV
- if: always() && job.status == 'failure' && runner.os != 'Windows'
-
- - name: Upload results on Windows
- run: |
- echo '' > atest/results/index.html
- zip -r -j site.zip atest/results > no_output 2>&1
- curl -s -H "Content-Type: application/zip" -H "Authorization: Bearer ${{ secrets.NETLIFY_TOKEN }}" --data-binary "@site.zip" https://api.netlify.com/api/v1/sites > response.json
- echo "REPORT_URL=$(cat response.json|python -c "import sys, json; print('https://' + json.load(sys.stdin)['subdomain'] + '.netlify.com')")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- echo "JOB_STATUS=$(python -c "print('${{ job.status }}'.lower())")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- if: always() && job.status == 'failure' && runner.os == 'Windows'
-
- - uses: octokit/request-action@89697eb6635e52c6e1e5559f15b5c91ba5100cb0
- name: Update status with Github Status API
- id: update_status
- with:
- route: POST /repos/:repository/statuses/:sha
- repository: ${{ github.repository }}
- sha: ${{ github.sha }}
- state: "${{env.JOB_STATUS}}"
- target_url: "${{env.REPORT_URL}}"
- description: "Link to test report."
- context: at-results-${{ matrix.python-version }}-${{ matrix.os }}
+ - name: Install and run rflogs
+ if: failure()
env:
- GITHUB_TOKEN: ${{ secrets.STATUS_UPLOAD_TOKEN }}
- if: always() && job.status == 'failure'
+ RFLOGS_API_KEY: ${{ secrets.RFLOGS_API_KEY }}
+ working-directory: atest/results
+ shell: python
+ run: |
+ import os
+ import glob
+ import subprocess
+
+ # Install rflogs
+ subprocess.check_call(["pip", "install", "rflogs"])
+
+ # Find the first directory containing log.html
+ log_files = glob.glob("**/log.html", recursive=True)
+ if log_files:
+ result_dir = os.path.dirname(log_files[0])
+ print(f"Result directory: {result_dir}")
+
+ # Construct the rflogs command
+ cmd = [
+ "rflogs", "upload",
+ "--tag", f"workflow:${{ github.workflow }}",
+ "--tag", f"os:${{ runner.os }}",
+ "--tag", f"python-version:${{ matrix.python-version }}",
+ "--tag", f"branch:${{ github.head_ref || github.ref_name }}",
+ result_dir
+ ]
+
+ # Run rflogs upload
+ subprocess.check_call(cmd)
+ else:
+ print("No directory containing log.html found")
+ exit(1)
diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml
index 53607b198ab..c52d155900d 100644
--- a/.github/workflows/unit_tests.yml
+++ b/.github/workflows/unit_tests.yml
@@ -5,6 +5,7 @@ on:
branches:
- main
- master
+ - v*-maintenance
paths:
- '.github/workflows/**'
- 'src/**'
@@ -19,7 +20,7 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'windows-latest' ]
- python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8' ]
+ python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.8' ]
exclude:
- os: windows-latest
python-version: 'pypy-3.8'
@@ -31,7 +32,7 @@ jobs:
- uses: actions/checkout@v4
- name: Setup python ${{ matrix.python-version }}
- uses: actions/setup-python@v5.0.0
+ uses: actions/setup-python@v5.6.0
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
diff --git a/.github/workflows/unit_tests_pr.yml b/.github/workflows/unit_tests_pr.yml
index c8bc777c286..91eb380d330 100644
--- a/.github/workflows/unit_tests_pr.yml
+++ b/.github/workflows/unit_tests_pr.yml
@@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v4
- name: Setup python ${{ matrix.python-version }}
- uses: actions/setup-python@v5.0.0
+ uses: actions/setup-python@v5.6.0
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
diff --git a/.github/workflows/upload_test_reports.yml b/.github/workflows/upload_test_reports.yml
deleted file mode 100644
index e05de8214c4..00000000000
--- a/.github/workflows/upload_test_reports.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-name: Upload test results
-
-on: [status]
-
-jobs:
- upload_test_results:
- runs-on: ubuntu-latest
- name: Upload results from ${{ github.event.name }}
- steps:
- - run: echo ${{ github.event }}
diff --git a/.github/workflows/web_tests.yml b/.github/workflows/web_tests.yml
new file mode 100644
index 00000000000..8e7cc6f03c9
--- /dev/null
+++ b/.github/workflows/web_tests.yml
@@ -0,0 +1,30 @@
+name: Web tests with jest
+
+on:
+ push:
+ branches:
+ - main
+ - master
+ - v*-maintenance
+
+ paths:
+ - '.github/workflows/**'
+ - 'src/web**'
+ - '!**/*.rst'
+
+jobs:
+ jest_tests:
+
+ runs-on: 'ubuntu-latest'
+
+ name: Jest tests for the web components
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: "16"
+ - name: Run tests
+ working-directory: ./src/web
+ run: npm install && npm run test
diff --git a/.gitignore b/.gitignore
index 4028dcaab8f..880555b6da1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,3 +30,6 @@ __pycache__
.settings
.jython_cache
.mypy_cache/
+node_modules
+.cache/
+.parcel-cache/
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
index dffec091319..bd5c3733053 100644
--- a/.readthedocs.yaml
+++ b/.readthedocs.yaml
@@ -20,6 +20,6 @@ sphinx:
# - pdf
# Optionally declare the Python requirements required to build your docs
-#python:
-# install:
-# - requirements: docs/requirements.txt
+python:
+ install:
+ - requirements: doc/api/requirements.txt
diff --git a/BUILD.rst b/BUILD.rst
index 1c0d907b4ba..e1b1e395df3 100644
--- a/BUILD.rst
+++ b/BUILD.rst
@@ -76,7 +76,7 @@ __ https://github.com/robotframework/robotframework/tree/master/atest#schema-val
Preparation
-----------
-1. Check that you are on the master branch and have nothing left to commit,
+1. Check that you are on the right branch and have nothing left to commit,
pull, or push::
git branch
@@ -93,13 +93,13 @@ Preparation
VERSION=
- For example, ``VERSION=3.0.1`` or ``VERSION=3.1a2``.
+ For example, ``VERSION=7.1.1`` or ``VERSION=7.2a2``. No ``v`` prefix!
Release notes
-------------
-1. Create personal `GitHub access token`__ to be able to access issue tracker
- programmatically. The token needs only the `repo/public_repo` scope.
+1. Create a personal `GitHub access token`__ to be able to access issue tracker
+ programmatically. The token needs only the ``repo/public_repo`` scope.
2. Set GitHub user information into shell variables to ease running the
``invoke release-notes`` command in the next step::
@@ -119,7 +119,7 @@ Release notes
`__. Omit the ``-w`` option if you just want to get release
notes printed to the console, not written to a file.
- When generating release notes for a preview release like ``3.0.2rc1``,
+ When generating release notes for a preview release like ``7.2rc1``,
the list of issues is only going to contain issues with that label
(e.g. ``rc1``) or with a label of an earlier preview release (e.g.
``alpha1``, ``beta2``).
@@ -151,6 +151,24 @@ Release notes
__ https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token
+
+Update libdoc generated files
+-----------------------------
+
+Run
+
+ invoke build-libdoc
+
+This step can be skipped if there are no changes to Libdoc. Prerequisites
+are listed in ``_.
+
+This will regenerate the libdoc html template and update libdoc command line
+with the latest supported lagnuages.
+
+Commit & push if there are changes any changes to either
+`src/robot/htmldata/libdoc/libdoc.html` or `src/robot/libdocpkg/languages.py`.
+
+
Set version
-----------
@@ -189,27 +207,26 @@ Creating distributions
invoke clean
-3. Create and validate source distribution in zip format and
- `wheel `_::
+4. Create and validate source distribution and `wheel `_::
- python setup.py sdist --formats zip bdist_wheel
+ python setup.py sdist bdist_wheel
ls -l dist
twine check dist/*
Distributions can be tested locally if needed.
-4. Upload distributions to PyPI::
+5. Upload distributions to PyPI::
twine upload dist/*
-5. Verify that project pages at `PyPI
+6. Verify that project pages at `PyPI
`_ look good.
-6. Test installation::
+7. Test installation::
pip install --pre --upgrade robotframework
-7. Documentation
+8. Documentation
- For a reproducible build, set the ``SOURCE_DATE_EPOCH``
environment variable to a constant value, corresponding to the
@@ -229,14 +246,14 @@ Creating distributions
git checkout gh-pages
invoke add-docs $VERSION --push
- git checkout master
+ git checkout master # replace master with v*-maintenance if needed!
Post actions
------------
1. Back to master if needed::
- git checkout master
+ git checkout master # replace master with v*-maintenance if needed!
2. Set dev version based on the previous version::
diff --git a/INSTALL.rst b/INSTALL.rst
index 26a49927700..84f997343e7 100644
--- a/INSTALL.rst
+++ b/INSTALL.rst
@@ -47,7 +47,7 @@ Python version than the one provided by your distribution by default.
To check what Python version you have installed, you can run `python --version`
command in a terminal:
-.. sourcecode:: bash
+.. code:: bash
$ python --version
Python 3.10.13
@@ -58,7 +58,7 @@ specific command like `python3.8`. You need to use these version specific varian
also if you have multiple Python 3 versions installed and need to pinpoint which
one to use:
-.. sourcecode:: bash
+.. code:: bash
$ python3.11 --version
Python 3.11.7
@@ -89,7 +89,7 @@ to select the `Add Python 3.x to PATH` checkbox on the first dialog.
To make sure Python installation has been successful and Python has been
added to `PATH`, you can open the command prompt and execute `python --version`:
-.. sourcecode:: batch
+.. code:: batch
C:\>python --version
Python 3.10.9
@@ -98,7 +98,7 @@ If you install multiple Python versions on Windows, the version that is used
when you execute `python` is the one first in `PATH`. If you need to use others,
the easiest way is using the `py launcher`__:
-.. sourcecode:: batch
+.. code:: batch
C:\>py --version
Python 3.10.9
@@ -200,7 +200,7 @@ To make sure you have pip available, you can run `pip --version` or equivalent.
Examples on Linux:
-.. sourcecode:: bash
+.. code:: bash
$ pip --version
pip 23.2.1 from ... (python 3.10)
@@ -209,7 +209,7 @@ Examples on Linux:
Examples on Windows:
-.. sourcecode:: batch
+.. code:: batch
C:\> pip --version
pip 23.2.1 from ... (python 3.10)
@@ -229,7 +229,7 @@ shown below and pip_ documentation has more information and examples.
__ PyPI_
-.. sourcecode:: bash
+.. code:: bash
# Install the latest version (does not upgrade)
pip install robotframework
@@ -259,13 +259,13 @@ Another installation alternative is getting Robot Framework source code
and installing it using the provided `setup.py` script. This approach is
recommended only if you do not have pip_ available for some reason.
-You can get the source code by downloading a source distribution as a zip
-package from PyPI_ and extracting it. An alternative is cloning the GitHub_
+You can get the source code by downloading a source distribution package
+from PyPI_ and extracting it. An alternative is cloning the GitHub_
repository and checking out the needed release tag.
Once you have the source code, you can install it with the following command:
-.. sourcecode:: bash
+.. code:: bash
python setup.py install
@@ -280,7 +280,7 @@ Verifying installation
To make sure that the correct Robot Framework version has been installed, run
the following command:
-.. sourcecode:: bash
+.. code:: bash
$ robot --version
Robot Framework 7.0 (Python 3.10.3 on linux)
@@ -294,7 +294,7 @@ running `robot` will execute the one first in PATH_. To select explicitly,
you can run `python -m robot` and substitute `python` with the right Python
version.
-.. sourcecode:: bash
+.. code:: bash
$ python3.12 -m robot --version
Robot Framework 7.0 (Python 3.12.1 on linux)
diff --git a/atest/README.rst b/atest/README.rst
index 5856d5661b2..410ef5cdce8 100644
--- a/atest/README.rst
+++ b/atest/README.rst
@@ -137,7 +137,7 @@ require-yaml, require-lxml, require-screenshot
Require specified Python module or some other external tool to be installed.
Exclude like `--exclude require-lxml` if dependencies_ are not met.
-require-windows, require-py3.8, ...
+require-windows, require-py3.13, ...
Tests that require certain operating system or Python interpreter.
Excluded automatically outside these platforms.
diff --git a/atest/genrunner.py b/atest/genrunner.py
index c3c94af355d..89d331dd1b7 100755
--- a/atest/genrunner.py
+++ b/atest/genrunner.py
@@ -5,20 +5,20 @@
Usage: {tool} testdata/path/data.robot [robot/path/runner.robot]
"""
-from os.path import abspath, basename, dirname, exists, join
import os
-import sys
import re
+import sys
+from os.path import abspath, basename, dirname, exists, join
-if len(sys.argv) not in [2, 3] or not all(a.endswith('.robot') for a in sys.argv[1:]):
+if len(sys.argv) not in [2, 3] or not all(a.endswith(".robot") for a in sys.argv[1:]):
sys.exit(__doc__.format(tool=basename(sys.argv[0])))
-SEPARATOR = re.compile(r'\s{2,}|\t')
+SEPARATOR = re.compile(r"\s{2,}|\t")
INPATH = abspath(sys.argv[1])
-if join('atest', 'testdata') not in INPATH:
+if join("atest", "testdata") not in INPATH:
sys.exit("Input not under 'atest/testdata'.")
if len(sys.argv) == 2:
- OUTPATH = INPATH.replace(join('atest', 'testdata'), join('atest', 'robot'))
+ OUTPATH = INPATH.replace(join("atest", "testdata"), join("atest", "robot"))
else:
OUTPATH = sys.argv[2]
@@ -42,39 +42,45 @@ def __init__(self, name, tags=None):
line = line.rstrip()
if not line:
continue
- elif line.startswith('*'):
- name = SEPARATOR.split(line)[0].replace('*', '').replace(' ', '').upper()
- parsing_tests = name in ('TESTCASE', 'TESTCASES', 'TASK', 'TASKS')
- parsing_settings = name in ('SETTING', 'SETTINGS')
- elif parsing_tests and not SEPARATOR.match(line) and line[0] != '#':
- TESTS.append(TestCase(line.split(' ')[0]))
- elif parsing_tests and line.strip().startswith('[Tags]'):
- TESTS[-1].tags = line.split('[Tags]', 1)[1].split()
- elif parsing_settings and line.startswith(('Force Tags', 'Default Tags', 'Test Tags')):
- name, value = line.split(' ', 1)
- SETTINGS.append((name, value.strip()))
-
-
-with open(OUTPATH, 'w') as output:
- path = INPATH.split(join('atest', 'testdata'))[1][1:].replace(os.sep, '/')
- output.write('''\
+ elif line.startswith("*"):
+ name = SEPARATOR.split(line)[0].replace("*", "").replace(" ", "").upper()
+ parsing_tests = name in ("TESTCASES", "TASKS")
+ parsing_settings = name == "SETTINGS"
+ elif parsing_tests and not SEPARATOR.match(line) and line[0] != "#":
+ TESTS.append(TestCase(SEPARATOR.split(line)[0]))
+ elif parsing_tests and line.strip().startswith("[Tags]"):
+ TESTS[-1].tags = line.split("[Tags]", 1)[1].split()
+ elif parsing_settings and line.startswith("Test Tags"):
+ name, *values = SEPARATOR.split(line)
+ SETTINGS.append((name, values))
+
+
+with open(OUTPATH, "w") as output:
+ path = INPATH.split(join("atest", "testdata"))[1][1:].replace(os.sep, "/")
+ output.write(
+ f"""\
*** Settings ***
-Suite Setup Run Tests ${EMPTY} %s
-''' % path)
- for name, value in SETTINGS:
- output.write('%s%s\n' % (name.ljust(18), value))
- output.write('''\
+Suite Setup Run Tests ${{EMPTY}} {path}
+"""
+ )
+ for name, values in SETTINGS:
+ values = " ".join(values)
+ output.write(f"{name:18}{values}\n")
+ output.write(
+ """\
Resource atest_resource.robot
*** Test Cases ***
-''')
+"""
+ )
for test in TESTS:
- output.write(test.name + '\n')
+ output.write(test.name + "\n")
if test.tags:
- output.write(' [Tags] %s\n' % ' '.join(test.tags))
- output.write(' Check Test Case ${TESTNAME}\n')
+ tags = " ".join(test.tags)
+ output.write(f" [Tags] {tags}\n")
+ output.write(" Check Test Case ${TESTNAME}\n")
if test is not TESTS[-1]:
- output.write('\n')
+ output.write("\n")
print(OUTPATH)
diff --git a/atest/interpreter.py b/atest/interpreter.py
index 7723d043f0d..7d0ea07dfd1 100644
--- a/atest/interpreter.py
+++ b/atest/interpreter.py
@@ -1,15 +1,14 @@
import os
-from pathlib import Path
import re
import subprocess
import sys
+from pathlib import Path
-
-ROBOT_DIR = Path(__file__).parent.parent / 'src/robot'
+ROBOT_DIR = Path(__file__).parent.parent / "src/robot"
def get_variables(path, name=None, version=None):
- return {'INTERPRETER': Interpreter(path, name, version)}
+ return {"INTERPRETER": Interpreter(path, name, version)}
class Interpreter:
@@ -21,92 +20,97 @@ def __init__(self, path, name=None, version=None):
name, version = self._get_name_and_version()
self.name = name
self.version = version
- self.version_info = tuple(int(item) for item in version.split('.'))
+ self.version_info = tuple(int(item) for item in version.split("."))
def _get_interpreter(self, path):
- path = path.replace('/', os.sep)
+ path = path.replace("/", os.sep)
return [path] if os.path.exists(path) else path.split()
def _get_name_and_version(self):
try:
- output = subprocess.check_output(self.interpreter + ['-V'],
- stderr=subprocess.STDOUT,
- encoding='UTF-8')
+ output = subprocess.check_output(
+ self.interpreter + ["-V"],
+ stderr=subprocess.STDOUT,
+ encoding="UTF-8",
+ )
except (subprocess.CalledProcessError, FileNotFoundError) as err:
- raise ValueError('Failed to get interpreter version: %s' % err)
+ raise ValueError(f"Failed to get interpreter version: {err}")
name, version = output.split()[:2]
- name = name if 'PyPy' not in output else 'PyPy'
- version = re.match(r'\d+\.\d+\.\d+', version).group()
+ name = name if "PyPy" not in output else "PyPy"
+ version = re.match(r"\d+\.\d+\.\d+", version).group()
return name, version
@property
def os(self):
- for condition, name in [(self.is_linux, 'Linux'),
- (self.is_osx, 'OS X'),
- (self.is_windows, 'Windows')]:
+ for condition, name in [
+ (self.is_linux, "Linux"),
+ (self.is_osx, "OS X"),
+ (self.is_windows, "Windows"),
+ ]:
if condition:
return name
return sys.platform
@property
def output_name(self):
- return '{i.name}-{i.version}-{i.os}'.format(i=self).replace(' ', '')
+ return f"{self.name}-{self.version}-{self.os}".replace(" ", "")
@property
def excludes(self):
if self.is_pypy:
- yield 'require-lxml'
- for require in [(3, 7), (3, 8), (3, 9), (3, 10)]:
+ yield "no-pypy"
+ yield "require-lxml"
+ for require in [(3, 9), (3, 10), (3, 14)]:
if self.version_info < require:
- yield 'require-py%d.%d' % require
+ yield "require-py%d.%d" % require
if self.is_windows:
- yield 'no-windows'
+ yield "no-windows"
if not self.is_windows:
- yield 'require-windows'
+ yield "require-windows"
if self.is_osx:
- yield 'no-osx'
+ yield "no-osx"
if not self.is_linux:
- yield 'require-linux'
+ yield "require-linux"
@property
def is_python(self):
- return self.name == 'Python'
+ return self.name == "Python"
@property
def is_pypy(self):
- return self.name == 'PyPy'
+ return self.name == "PyPy"
@property
def is_linux(self):
- return 'linux' in sys.platform
+ return "linux" in sys.platform
@property
def is_osx(self):
- return sys.platform == 'darwin'
+ return sys.platform == "darwin"
@property
def is_windows(self):
- return os.name == 'nt'
+ return os.name == "nt"
@property
def runner(self):
- return self.interpreter + [str(ROBOT_DIR / 'run.py')]
+ return self.interpreter + [str(ROBOT_DIR / "run.py")]
@property
def rebot(self):
- return self.interpreter + [str(ROBOT_DIR / 'rebot.py')]
+ return self.interpreter + [str(ROBOT_DIR / "rebot.py")]
@property
def libdoc(self):
- return self.interpreter + [str(ROBOT_DIR / 'libdoc.py')]
+ return self.interpreter + [str(ROBOT_DIR / "libdoc.py")]
@property
def testdoc(self):
- return self.interpreter + [str(ROBOT_DIR / 'testdoc.py')]
+ return self.interpreter + [str(ROBOT_DIR / "testdoc.py")]
@property
def underline(self):
- return '-' * len(str(self))
+ return "-" * len(str(self))
def __str__(self):
- return f'{self.name} {self.version} on {self.os}'
+ return f"{self.name} {self.version} on {self.os}"
diff --git a/atest/requirements-run.txt b/atest/requirements-run.txt
index ee5b5278817..4dfae292ecc 100644
--- a/atest/requirements-run.txt
+++ b/atest/requirements-run.txt
@@ -1,2 +1,4 @@
+# Dependencies for the acceptance test runner.
+
jsonschema >= 4.0
xmlschema
diff --git a/atest/requirements.txt b/atest/requirements.txt
index 5f0a324dfcf..5b3ad92adb9 100644
--- a/atest/requirements.txt
+++ b/atest/requirements.txt
@@ -1,16 +1,10 @@
-# External Python modules required by acceptance tests.
+# Dependencies required by acceptance tests.
# See atest/README.rst for more information.
-docutils >= 0.10
pygments
-
pyyaml
-
-# On Linux installing lxml with pip may require compilation and development
-# headers. Alternatively it can be installed using a package manager like
-# `sudo apt-get install python-lxml`.
-lxml; platform_python_implementation == 'CPython'
-
+lxml
pillow >= 7.1.0; platform_system == 'Windows'
+telnetlib-313-and-up; python_version >= '3.13'
-r ../utest/requirements.txt
diff --git a/atest/resources/TestCheckerLibrary.py b/atest/resources/TestCheckerLibrary.py
index 61213d5c8d4..2b7a5171004 100644
--- a/atest/resources/TestCheckerLibrary.py
+++ b/atest/resources/TestCheckerLibrary.py
@@ -1,195 +1,280 @@
+import json
import os
import re
+from datetime import datetime
+from pathlib import Path
+try:
+ from jsonschema import Draft202012Validator as JSONValidator
+except ImportError:
+ JSONValidator = None
from xmlschema import XMLSchema
-from robot import utils
from robot.api import logger
from robot.libraries.BuiltIn import BuiltIn
-from robot.result import (Break, Continue, Error, ExecutionResultBuilder, For,
- ForIteration, If, IfBranch, Keyword, Result, ResultVisitor,
- Return, TestCase, TestSuite, Try, TryBranch, Var, While,
- WhileIteration)
+from robot.libraries.Collections import Collections
+from robot.result import (
+ Break, Continue, Error, ExecutionResult, ExecutionResultBuilder, For, ForIteration,
+ Group, If, IfBranch, Keyword, Result, ResultVisitor, Return, TestCase, TestSuite,
+ Try, TryBranch, Var, While, WhileIteration
+)
+from robot.result.executionerrors import ExecutionErrors
from robot.result.model import Body, Iterations
+from robot.utils import eq, get_error_details, is_truthy, Matcher
from robot.utils.asserts import assert_equal
-class NoSlotsKeyword(Keyword):
+class WithBodyTraversing:
+ body: Body
+
+ def __getitem__(self, index):
+ if isinstance(index, str):
+ index = tuple(int(i) for i in index.split(","))
+ if isinstance(index, (int, slice)):
+ return self.body[index]
+ if isinstance(index, tuple):
+ item = self
+ for i in index:
+ item = item.body[int(i)]
+ return item
+ raise TypeError(f"Invalid index {repr(index)}.")
+
+ @property
+ def keywords(self):
+ return self.body.filter(keywords=True)
+
+ @property
+ def messages(self):
+ return self.body.filter(messages=True)
+
+ @property
+ def non_messages(self):
+ return self.body.filter(messages=False)
+
+
+class ATestKeyword(Keyword, WithBodyTraversing):
+ pass
+
+
+class ATestFor(For, WithBodyTraversing):
pass
-class NoSlotsFor(For):
+class ATestWhile(While, WithBodyTraversing):
pass
-class NoSlotsWhile(While):
+class ATestGroup(Group, WithBodyTraversing):
pass
-class NoSlotsIf(If):
+class ATestIf(If, WithBodyTraversing):
pass
-class NoSlotsTry(Try):
+class ATestTry(Try, WithBodyTraversing):
pass
-class NoSlotsVar(Var):
+class ATestVar(Var, WithBodyTraversing):
pass
-class NoSlotsReturn(Return):
+class ATestReturn(Return, WithBodyTraversing):
pass
-class NoSlotsBreak(Break):
+class ATestBreak(Break, WithBodyTraversing):
pass
-class NoSlotsContinue(Continue):
+class ATestContinue(Continue, WithBodyTraversing):
pass
-class NoSlotsError(Error):
+class ATestError(Error, WithBodyTraversing):
pass
-class NoSlotsBody(Body):
- keyword_class = NoSlotsKeyword
- for_class = NoSlotsFor
- if_class = NoSlotsIf
- try_class = NoSlotsTry
- while_class = NoSlotsWhile
- var_class = NoSlotsVar
- return_class = NoSlotsReturn
- break_class = NoSlotsBreak
- continue_class = NoSlotsContinue
- error_class = NoSlotsError
+class ATestBody(Body):
+ keyword_class = ATestKeyword
+ for_class = ATestFor
+ if_class = ATestIf
+ try_class = ATestTry
+ while_class = ATestWhile
+ group_class = ATestGroup
+ var_class = ATestVar
+ return_class = ATestReturn
+ break_class = ATestBreak
+ continue_class = ATestContinue
+ error_class = ATestError
-class NoSlotsIfBranch(IfBranch):
- body_class = NoSlotsBody
+class ATestIfBranch(IfBranch, WithBodyTraversing):
+ body_class = ATestBody
-class NoSlotsTryBranch(TryBranch):
- body_class = NoSlotsBody
+class ATestTryBranch(TryBranch, WithBodyTraversing):
+ body_class = ATestBody
-class NoSlotsForIteration(ForIteration):
- body_class = NoSlotsBody
+class ATestForIteration(ForIteration, WithBodyTraversing):
+ body_class = ATestBody
-class NoSlotsWhileIteration(WhileIteration):
- body_class = NoSlotsBody
+class ATestWhileIteration(WhileIteration, WithBodyTraversing):
+ body_class = ATestBody
-class NoSlotsIterations(Iterations):
- keyword_class = NoSlotsKeyword
+class ATestIterations(Iterations, WithBodyTraversing):
+ keyword_class = ATestKeyword
-NoSlotsKeyword.body_class = NoSlotsVar.body_class = NoSlotsReturn.body_class \
- = NoSlotsBreak.body_class = NoSlotsContinue.body_class \
- = NoSlotsError.body_class = NoSlotsBody
-NoSlotsFor.iterations_class = NoSlotsWhile.iterations_class = NoSlotsIterations
-NoSlotsFor.iteration_class = NoSlotsForIteration
-NoSlotsWhile.iteration_class = NoSlotsWhileIteration
-NoSlotsIf.branch_class = NoSlotsIfBranch
-NoSlotsTry.branch_class = NoSlotsTryBranch
+ATestKeyword.body_class = ATestVar.body_class = ATestReturn.body_class \
+ = ATestBreak.body_class = ATestContinue.body_class \
+ = ATestError.body_class = ATestGroup.body_class \
+ = ATestBody # fmt: skip
+ATestFor.iterations_class = ATestWhile.iterations_class = ATestIterations
+ATestFor.iteration_class = ATestForIteration
+ATestWhile.iteration_class = ATestWhileIteration
+ATestIf.branch_class = ATestIfBranch
+ATestTry.branch_class = ATestTryBranch
-class NoSlotsTestCase(TestCase):
- fixture_class = NoSlotsKeyword
- body_class = NoSlotsBody
+class ATestTestCase(TestCase, WithBodyTraversing):
+ fixture_class = ATestKeyword
+ body_class = ATestBody
-class NoSlotsTestSuite(TestSuite):
- fixture_class = NoSlotsKeyword
- test_class = NoSlotsTestCase
+class ATestTestSuite(TestSuite):
+ fixture_class = ATestKeyword
+ test_class = ATestTestCase
class TestCheckerLibrary:
- ROBOT_LIBRARY_SCOPE = 'GLOBAL'
+ ROBOT_LIBRARY_SCOPE = "GLOBAL"
def __init__(self):
- self.schema = XMLSchema('doc/schema/robot.xsd')
+ self.xml_schema = XMLSchema("doc/schema/result.xsd")
+ self.json_schema = self._load_json_schema()
+
+ def _load_json_schema(self):
+ if not JSONValidator:
+ return None
+ with open("doc/schema/result.json", encoding="UTF-8") as f:
+ return JSONValidator(json.load(f))
- def process_output(self, path, validate=None):
+ def process_output(self, path: "None|Path", validate: "bool|None" = None):
set_suite_variable = BuiltIn().set_suite_variable
- if not path or path.upper() == 'NONE':
- set_suite_variable('$SUITE', None)
+ if path is None:
+ set_suite_variable("$SUITE", None)
logger.info("Not processing output.")
return
- path = path.replace('/', os.sep)
if validate is None:
- validate = os.getenv('ATEST_VALIDATE_OUTPUT', False)
- if utils.is_truthy(validate):
- self._validate_output(path)
+ validate = is_truthy(os.getenv("ATEST_VALIDATE_OUTPUT", False))
+ if validate:
+ if path.suffix.lower() == ".json":
+ self.validate_json_output(path)
+ else:
+ self._validate_output(path)
try:
- logger.info("Processing output '%s'." % path)
- result = Result(root_suite=NoSlotsTestSuite())
- ExecutionResultBuilder(path).build(result)
- except:
- set_suite_variable('$SUITE', None)
- msg, details = utils.get_error_details()
+ logger.info(f"Processing output '{path}'.")
+ if path.suffix.lower() == ".json":
+ result = self._build_result_from_json(path)
+ else:
+ result = self._build_result_from_xml(path)
+ except Exception:
+ set_suite_variable("$SUITE", None)
+ msg, details = get_error_details()
logger.info(details)
- raise RuntimeError('Processing output failed: %s' % msg)
+ raise RuntimeError(f"Processing output failed: {msg}")
result.visit(ProcessResults())
- set_suite_variable('$SUITE', result.suite)
- set_suite_variable('$STATISTICS', result.statistics)
- set_suite_variable('$ERRORS', result.errors)
+ set_suite_variable("$SUITE", result.suite)
+ set_suite_variable("$STATISTICS", result.statistics)
+ set_suite_variable("$ERRORS", result.errors)
+
+ def _build_result_from_xml(self, path):
+ result = Result(source=path, suite=ATestTestSuite())
+ ExecutionResultBuilder(path).build(result)
+ return result
+
+ def _build_result_from_json(self, path):
+ with open(path, encoding="UTF-8") as file:
+ data = json.load(file)
+ return Result(
+ source=path,
+ suite=ATestTestSuite.from_dict(data["suite"]),
+ errors=ExecutionErrors(data.get("errors")),
+ rpa=data.get("rpa"),
+ generator=data.get("generator"),
+ generation_time=datetime.fromisoformat(data["generated"]),
+ )
def _validate_output(self, path):
- schema_version = self._get_schema_version(path)
- if schema_version != self.schema.version:
- raise AssertionError(
- 'Incompatible schema versions. Schema has `version="%s"` '
- 'but output file has `schemaversion="%s"`.'
- % (self.schema.version, schema_version)
- )
- self.schema.validate(path)
+ version = self._get_schema_version(path)
+ if not version:
+ raise ValueError("Schema version not found from XML output.")
+ if version != self.xml_schema.version:
+ raise ValueError(
+ f"Incompatible schema versions. "
+ f'Schema has `version="{self.xml_schema.version}"` but '
+ f'output file has `schemaversion="{version}"`.'
+ )
+ self.xml_schema.validate(path)
def _get_schema_version(self, path):
- with open(path, encoding='UTF-8') as f:
- for line in f:
- if line.startswith(' TestSuite:
- from_source = {'xml': TestSuite.from_xml,
- 'json': TestSuite.from_json}[output.rsplit('.')[-1].lower()]
- return from_source(output)
+ def outputs_should_contain_same_data(
+ self,
+ output1,
+ output2,
+ ignore_timestamps=False,
+ ):
+ dictionaries_should_be_equal = Collections().dictionaries_should_be_equal
+ if ignore_timestamps:
+ ignore_keys = ["start_time", "end_time", "elapsed_time", "timestamp"]
+ else:
+ ignore_keys = None
+ result1 = ExecutionResult(output1)
+ result2 = ExecutionResult(output2)
+ dictionaries_should_be_equal(
+ result1.suite.to_dict(),
+ result2.suite.to_dict(),
+ ignore_keys=ignore_keys,
+ )
+ dictionaries_should_be_equal(
+ result1.statistics.to_dict(),
+ result2.statistics.to_dict(),
+ ignore_keys=ignore_keys,
+ )
+ # Use `zip(..., strict=True)` when Python 3.10 is minimum version.
+ assert len(result1.errors) == len(result2.errors)
+ for msg1, msg2 in zip(result1.errors, result2.errors):
+ dictionaries_should_be_equal(
+ msg1.to_dict(),
+ msg2.to_dict(),
+ ignore_keys=ignore_keys,
+ )
class ProcessResults(ResultVisitor):
- def start_test(self, test):
- for status in 'FAIL', 'SKIP', 'PASS':
+ def visit_test(self, test):
+ for status in "FAIL", "SKIP", "PASS":
if status in test.doc:
test.exp_status = status
test.exp_message = test.doc.split(status, 1)[1].lstrip()
break
else:
- test.exp_status = 'PASS'
- test.exp_message = ''
- test.kws = list(test.body)
-
- def start_body_item(self, item):
- # TODO: Consider not setting these attributes to avoid "NoSlots" variants.
- # - Using normal `body` and `messages` would in general be cleaner.
- # - If `kws` is preserved, it should only contain keywords, not controls.
- # - `msgs` isn't that much shorter than `messages`.
- item.kws = item.body.filter(messages=False)
- item.msgs = item.body.filter(messages=True)
-
- def visit_message(self, message):
- pass
-
- def visit_errors(self, errors):
- errors.msgs = errors.messages
+ test.exp_status = "PASS"
+ test.exp_message = ""
diff --git a/atest/resources/TestHelper.py b/atest/resources/TestHelper.py
index 053c0965642..14b28af9bb9 100644
--- a/atest/resources/TestHelper.py
+++ b/atest/resources/TestHelper.py
@@ -1,5 +1,5 @@
import os
-from stat import S_IREAD, S_IWRITE, S_IEXEC
+from stat import S_IEXEC, S_IREAD, S_IWRITE
from robot.api import logger
@@ -20,18 +20,19 @@ def remove_permissions(self, path):
def file_should_have_correct_line_separators(self, output, sep=os.linesep):
if os.path.isfile(output):
- with open(output, 'rb') as infile:
- output = infile.read().decode('UTF-8')
+ with open(output, "rb") as infile:
+ output = infile.read().decode("UTF-8")
if sep not in output:
- self._wrong_separators('Output has no %r separators' % sep, output)
- extra_r = output.replace(sep, '').count('\r')
- extra_n = output.replace(sep, '').count('\n')
+ self._wrong_separators(f"Output has no {sep!r} separators", output)
+ extra_r = output.replace(sep, "").count("\r")
+ extra_n = output.replace(sep, "").count("\n")
if extra_r or extra_n:
- self._wrong_separators("Output has %d extra \\r and %d extra \\n"
- % (extra_r, extra_n), output)
+ self._wrong_separators(
+ rf"Output has {extra_r} extra \r and {extra_n} extra \n", output
+ )
def _wrong_separators(self, message, output):
- logger.info(repr(output).replace('\\n', '\\n\n'))
+ logger.info(repr(output).replace("\\n", "\\n\n"))
failure = AssertionError(message)
failure.ROBOT_CONTINUE_ON_FAILURE = True
raise failure
diff --git a/atest/resources/atest_resource.robot b/atest/resources/atest_resource.robot
index ed84a5873b2..358e31384fd 100644
--- a/atest/resources/atest_resource.robot
+++ b/atest/resources/atest_resource.robot
@@ -113,15 +113,32 @@ Check Test Tags
Should Contain Tags ${tc} @{expected}
RETURN ${tc}
+Check Body Item Data
+ [Arguments] ${item} ${type}=KEYWORD ${status}=PASS ${message}= ${children}=-1 &{others}
+ FOR ${key} ${expected} IN type=${type} status=${status} type=${type} message=${message} &{others}
+ IF $key == 'status' and $type == 'MESSAGE' CONTINUE
+ VAR ${actual} ${item.${key}}
+ IF isinstance($actual, collections.abc.Iterable) and not isinstance($actual, str)
+ Should Be Equal ${{', '.join($actual)}} ${expected}
+ ELSE
+ Should Be Equal ${actual} ${expected}
+ END
+ END
+ IF ${children} >= 0
+ ... Length Should Be ${item.body} ${children}
+
Check Keyword Data
- [Arguments] ${kw} ${name} ${assign}= ${args}= ${status}=PASS ${tags}= ${doc}=* ${type}=KEYWORD
+ [Arguments] ${kw} ${name} ${assign}= ${args}= ${status}=PASS ${tags}= ${doc}=* ${message}=* ${type}=KEYWORD ${children}=-1
Should Be Equal ${kw.full_name} ${name}
Should Be Equal ${{', '.join($kw.assign)}} ${assign}
Should Be Equal ${{', '.join($kw.args)}} ${args}
Should Be Equal ${kw.status} ${status}
Should Be Equal ${{', '.join($kw.tags)}} ${tags}
Should Match ${kw.doc} ${doc}
+ Should Match ${kw.message} ${message}
Should Be Equal ${kw.type} ${type}
+ IF ${children} >= 0
+ ... Length Should Be ${kw.body} ${children}
Check TRY Data
[Arguments] ${try} ${patterns}= ${pattern_type}=${None} ${assign}=${None} ${status}=PASS
@@ -410,4 +427,6 @@ Traceback Should Be
${path} = Normalize Path ${DATADIR}/${path}
${exp} = Set Variable ${exp}\n${SPACE*2}File "${path}", line *, in ${func}\n${SPACE*4}${text}
END
+ # Remove '~~~^^^' lines.
+ ${msg.message} = Evaluate '\\n'.join(line for line in $msg.message.splitlines() if line.strip('~^ ') or not line)
Check Log Message ${msg} ${exp}\n${error} DEBUG pattern=True traceback=True
diff --git a/atest/resources/atest_variables.py b/atest/resources/atest_variables.py
index 113ef9bde1e..cf4b4136f2e 100644
--- a/atest/resources/atest_variables.py
+++ b/atest/resources/atest_variables.py
@@ -1,25 +1,39 @@
import locale
import os
import subprocess
+import sys
from datetime import datetime, timedelta
from os.path import abspath, dirname, join, normpath
import robot
-
-__all__ = ['ROBOTPATH', 'ROBOT_VERSION', 'DATADIR', 'SYSTEM_ENCODING',
- 'CONSOLE_ENCODING', 'datetime', 'timedelta']
+__all__ = [
+ "ROBOTPATH",
+ "ROBOT_VERSION",
+ "DATADIR",
+ "SYSTEM_ENCODING",
+ "CONSOLE_ENCODING",
+ "datetime",
+ "timedelta",
+]
ROBOTPATH = dirname(abspath(robot.__file__))
ROBOT_VERSION = robot.version.get_version()
-DATADIR = normpath(join(dirname(abspath(__file__)), '..', 'testdata'))
+DATADIR = normpath(join(dirname(abspath(__file__)), "..", "testdata"))
-SYSTEM_ENCODING = locale.getpreferredencoding(False)
+if sys.version_info >= (3, 11):
+ SYSTEM_ENCODING = locale.getencoding()
+else:
+ SYSTEM_ENCODING = locale.getpreferredencoding(False)
# Python 3.6+ uses UTF-8 internally on Windows. We want real console encoding.
-if os.name == 'nt':
- output = subprocess.check_output('chcp', shell=True, encoding='ASCII',
- errors='ignore')
- CONSOLE_ENCODING = 'cp' + output.split()[-1]
+if os.name == "nt":
+ output = subprocess.check_output(
+ "chcp",
+ shell=True,
+ encoding="ASCII",
+ errors="ignore",
+ )
+ CONSOLE_ENCODING = "cp" + output.split()[-1]
else:
CONSOLE_ENCODING = locale.getlocale()[-1]
diff --git a/atest/resources/unicode_vars.py b/atest/resources/unicode_vars.py
index ac438bee7fd..00b35f9e162 100644
--- a/atest/resources/unicode_vars.py
+++ b/atest/resources/unicode_vars.py
@@ -1,12 +1,14 @@
-message_list = ['Circle is 360\u00B0',
- 'Hyv\u00E4\u00E4 \u00FC\u00F6t\u00E4',
- '\u0989\u09C4 \u09F0 \u09FA \u099F \u09EB \u09EA \u09B9']
+message_list = [
+ "Circle is 360\xb0",
+ "Hyv\xe4\xe4 \xfc\xf6t\xe4",
+ "\u0989\u09c4 \u09f0 \u09fa \u099f \u09eb \u09ea \u09b9",
+]
message1 = message_list[0]
message2 = message_list[1]
message3 = message_list[2]
-messages = ', '.join(message_list)
+messages = ", ".join(message_list)
sect = chr(167)
auml = chr(228)
diff --git a/atest/robot/cli/console/colors_and_width.robot b/atest/robot/cli/console/colors_and_width.robot
index 9a6680afe80..e9fbbeb2772 100644
--- a/atest/robot/cli/console/colors_and_width.robot
+++ b/atest/robot/cli/console/colors_and_width.robot
@@ -5,20 +5,20 @@ Resource console_resource.robot
*** Test Cases ***
Console Colors Auto
- Run Tests With Colors --consolecolors auto
- Outputs should not have ANSI colors
+ Run Tests With Warnings --consolecolors auto
+ Outputs should not have ANSI codes
Console Colors Off
- Run Tests With Colors --consolecolors OFF
- Outputs should not have ANSI colors
+ Run Tests With Warnings --consolecolors OFF
+ Outputs should not have ANSI codes
Console Colors On
- Run Tests With Colors --ConsoleCol on
+ Run Tests With Warnings --ConsoleCol on
Outputs should have ANSI colors when not on Windows
Console Colors ANSI
- Run Tests With Colors --Console-Colors AnSi
- Outputs should have ANSI colors
+ Run Tests With Warnings --Console-Colors AnSi
+ Outputs should have ANSI codes
Invalid Console Colors
Run Tests Without Processing Output -C InVaLid misc/pass_and_fail.robot
@@ -43,27 +43,43 @@ Invalid Width
Run Tests Without Processing Output -W InVaLid misc/pass_and_fail.robot
Stderr Should Be Equal To [ ERROR ] Invalid value for option '--consolewidth': Expected integer, got 'InVaLid'.${USAGE TIP}\n
+Console links off
+ [Documentation] Console links being enabled is tested as part of testing console colors.
+ Run Tests With Warnings --console-links oFF --console-colors on
+ Outputs should have ANSI colors when not on Windows links=False
+
+Invalid link config
+ Run Tests Without Processing Output --ConsoleLinks InVaLid misc/pass_and_fail.robot
+ Stderr Should Be Equal To [ ERROR ] Invalid console link value 'InVaLid. Available 'AUTO' and 'OFF'.${USAGE TIP}\n
+
*** Keywords ***
-Run Tests With Colors
- [Arguments] ${colors}
- Run Tests ${colors} --variable LEVEL1:WARN misc/pass_and_fail.robot
+Run Tests With Warnings
+ [Arguments] ${options}
+ Run Tests ${options} --variable LEVEL1:WARN misc/pass_and_fail.robot
-Outputs should not have ANSI colors
+Outputs should not have ANSI codes
Stdout Should Contain | PASS |
Stdout Should Contain | FAIL |
Stderr Should Contain [ WARN ]
Outputs should have ANSI colors when not on Windows
+ [Arguments] ${links}=True
IF os.sep == '/'
- Outputs should have ANSI colors
+ Outputs should have ANSI codes ${links}
ELSE
- Outputs should not have ANSI colors
+ Outputs should not have ANSI codes
END
-Outputs should have ANSI colors
+Outputs should have ANSI codes
+ [Arguments] ${links}=True
Stdout Should Not Contain | PASS |
Stdout Should Not Contain | FAIL |
Stderr Should Not Contain [ WARN ]
- Stdout Should Contain PASS
- Stdout Should Contain FAIL
- Stderr Should Contain WARN
+ Stdout Should Contain | \x1b[32mPASS\x1b[0m |
+ Stdout Should Contain | \x1b[31mFAIL\x1b[0m |
+ Stderr Should Contain [ \x1b[33mWARN\x1b[0m ]
+ IF ${links}
+ Stdout Should Contain \x1b]8;;file://
+ ELSE
+ Stdout Should Not Contain \x1b]8;;file://
+ END
diff --git a/atest/robot/cli/console/disable_standard_streams.py b/atest/robot/cli/console/disable_standard_streams.py
new file mode 100644
index 00000000000..f22de07454a
--- /dev/null
+++ b/atest/robot/cli/console/disable_standard_streams.py
@@ -0,0 +1,4 @@
+import sys
+
+sys.stdin = sys.stdout = sys.stderr = None
+sys.__stdin__ = sys.__stdout__ = sys.__stderr__ = None
diff --git a/atest/robot/cli/console/encoding.robot b/atest/robot/cli/console/encoding.robot
index 3dc94dd6a93..00194b8e242 100644
--- a/atest/robot/cli/console/encoding.robot
+++ b/atest/robot/cli/console/encoding.robot
@@ -26,7 +26,7 @@ PYTHONIOENCODING is honored in console output
Should Contain ${result.stdout} ???-????? T??t ??d K?yw?rd N?m?s, Спасибо${SPACE*29}| PASS |
Invalid encoding configuration
- [Tags] no-windows no-osx
+ [Tags] no-windows no-osx no-pypy
${cmd} = Join command line
... LANG=invalid
... LC_TYPE=invalid
diff --git a/atest/robot/cli/console/expected_output/ExpectedOutputLibrary.py b/atest/robot/cli/console/expected_output/ExpectedOutputLibrary.py
index f7851a42b6c..d30e9a91ab9 100644
--- a/atest/robot/cli/console/expected_output/ExpectedOutputLibrary.py
+++ b/atest/robot/cli/console/expected_output/ExpectedOutputLibrary.py
@@ -1,34 +1,33 @@
-from os.path import abspath, dirname, join
from fnmatch import fnmatchcase
from operator import eq
+from os.path import abspath, dirname, join
from robot.api import logger
from robot.api.deco import keyword
-
ROBOT_AUTO_KEYWORDS = False
CURDIR = dirname(abspath(__file__))
@keyword
def output_should_be(actual, expected, **replaced):
- actual = _read_file(actual, 'Actual')
- expected = _read_file(join(CURDIR, expected), 'Expected', replaced)
+ actual = _read_file(actual, "Actual")
+ expected = _read_file(join(CURDIR, expected), "Expected", replaced)
if len(expected) != len(actual):
- raise AssertionError('Lengths differ. Expected %d lines but got %d'
- % (len(expected), len(actual)))
+ raise AssertionError(
+ f"Lengths differ. Expected {len(expected)} lines, got {len(actual)}."
+ )
for exp, act in zip(expected, actual):
- tester = fnmatchcase if '*' in exp else eq
+ tester = fnmatchcase if "*" in exp else eq
if not tester(act.rstrip(), exp.rstrip()):
- raise AssertionError('Lines differ.\nExpected: %s\nActual: %s'
- % (exp, act))
+ raise AssertionError(f"Lines differ.\nExpected: {exp}\nActual: {act}")
def _read_file(path, title, replaced=None):
- with open(path) as file:
+ with open(path, encoding="UTF-8") as file:
content = file.read()
if replaced:
for item in replaced:
content = content.replace(item, replaced[item])
- logger.debug('%s:\n%s' % (title, content))
+ logger.debug(f"{title}:\n{content}")
return content.splitlines()
diff --git a/atest/robot/cli/console/max_assign_length.robot b/atest/robot/cli/console/max_assign_length.robot
index 8d9e866805b..587c9f1b86f 100644
--- a/atest/robot/cli/console/max_assign_length.robot
+++ b/atest/robot/cli/console/max_assign_length.robot
@@ -4,7 +4,7 @@ Test Template Assignment messages should be
Resource atest_resource.robot
*** Variables ***
-@{TESTS} 10 chars 200 chars 201 chars 1000 chars 1001 chars
+@{TESTS} 10 chars 200 chars 201 chars 1000 chars 1001 chars VAR
*** Test Cases ***
Default limit
@@ -14,6 +14,7 @@ Default limit
... '0123456789' * 20 + '...'
... '0123456789' * 20 + '...'
... '0123456789' * 20 + '...'
+ ... '0123456789' * 20 + '...'
Custom limit
10
@@ -22,18 +23,21 @@ Custom limit
... '0123456789' + '...'
... '0123456789' + '...'
... '0123456789' + '...'
+ ... '0123456789' + '...'
1000
... '0123456789'
... '0123456789' * 20
... '0123456789' * 20 + '0'
... '0123456789' * 100
... '0123456789' * 100 + '...'
+ ... '0123456789' * 100
10000
... '0123456789'
... '0123456789' * 20
... '0123456789' * 20 + '0'
... '0123456789' * 100
... '0123456789' * 100 + '0'
+ ... '0123456789' * 100
Hide value
0
@@ -42,12 +46,14 @@ Hide value
... '...'
... '...'
... '...'
+ ... '...'
-666
... '...'
... '...'
... '...'
... '...'
... '...'
+ ... '...'
Invalid
[Template] NONE
@@ -65,9 +71,8 @@ Assignment messages should be
ELSE
Run Tests ${EMPTY} cli/console/max_assign_length.robot
END
- Length Should Be ${messages} 5
- FOR ${name} ${msg} IN ZIP ${TESTS} ${MESSAGES}
+ FOR ${name} ${msg} IN ZIP ${TESTS} ${messages} mode=STRICT
${tc} = Check Test Case ${name}
${msg} = Evaluate ${msg}
- Check Log Message ${tc.body[0].messages[0]} \${value} = ${msg}
+ Check Log Message ${tc[0, 0]} \${value} = ${msg}
END
diff --git a/atest/robot/cli/console/max_error_lines.robot b/atest/robot/cli/console/max_error_lines.robot
index cc5140066f7..a2790f577cb 100644
--- a/atest/robot/cli/console/max_error_lines.robot
+++ b/atest/robot/cli/console/max_error_lines.robot
@@ -38,15 +38,16 @@ Has Been Cut
Should Contain ${test.message} ${EXPLANATION}
Should Match Non Empty Regexp ${test.message} ${eol_dots}
Should Match Non Empty Regexp ${test.message} ${bol_dots}
- Error Message In Log Should Not Have Been Cut ${test.kws}
+ Error Message In Log Should Not Have Been Cut ${test.body}
RETURN ${test}
Error Message In Log Should Not Have Been Cut
- [Arguments] ${kws}
- @{keywords} = Set Variable ${kws}
- FOR ${kw} IN @{keywords}
- Run Keyword If ${kw.msgs} Should Not Contain ${kw.msgs[-1].message} ${EXPLANATION}
- Error Message In Log Should Not Have Been Cut ${kw.kws}
+ [Arguments] ${items}
+ FOR ${item} IN @{items}
+ FOR ${msg} IN @{item.messages}
+ Should Not Contain ${msg.message} ${EXPLANATION}
+ END
+ Error Message In Log Should Not Have Been Cut ${item.non_messages}
END
Should Match Non Empty Regexp
diff --git a/atest/robot/cli/console/piping.py b/atest/robot/cli/console/piping.py
index 1ed0ebb6e25..9386a0d2d33 100644
--- a/atest/robot/cli/console/piping.py
+++ b/atest/robot/cli/console/piping.py
@@ -4,14 +4,14 @@
def read_all():
fails = 0
for line in sys.stdin:
- if 'FAIL' in line:
+ if "FAIL" in line:
fails += 1
- print("%d lines with 'FAIL' found!" % fails)
+ print(f"{fails} lines with 'FAIL' found!")
def read_some():
for line in sys.stdin:
- if 'FAIL' in line:
+ if "FAIL" in line:
print("Line with 'FAIL' found!")
sys.stdin.close()
break
diff --git a/atest/robot/cli/console/piping.robot b/atest/robot/cli/console/piping.robot
index ca5963844c8..15a50291753 100644
--- a/atest/robot/cli/console/piping.robot
+++ b/atest/robot/cli/console/piping.robot
@@ -14,7 +14,7 @@ ${TARGET} ${CURDIR}${/}piping.py
*** Test Cases ***
Pipe to command consuming all data
Run with pipe and validate results read_all
- Should Be Equal ${STDOUT} 17 lines with 'FAIL' found!
+ Should Be Equal ${STDOUT} 20 lines with 'FAIL' found!
Pipe to command consuming some data
Run with pipe and validate results read_some
@@ -28,8 +28,7 @@ Pipe to command consuming no data
Run with pipe and validate results
[Arguments] ${pipe style}
${command} = Join Command Line @{COMMAND}
- ${result} = Run Process ${command} | python ${TARGET} ${pipe style}
- ... shell=true
+ ${result} = Run Process ${command} | python ${TARGET} ${pipe style} shell=True
Log Many RC: ${result.rc} STDOUT:\n${result.stdout} STDERR:\n${result.stderr}
Should Be Equal ${result.rc} ${0}
Process Output ${OUTPUT}
diff --git a/atest/robot/cli/console/standard_streams_disabled.robot b/atest/robot/cli/console/standard_streams_disabled.robot
new file mode 100644
index 00000000000..44af45e78b2
--- /dev/null
+++ b/atest/robot/cli/console/standard_streams_disabled.robot
@@ -0,0 +1,23 @@
+*** Settings ***
+Suite Setup Run tests with standard streams disabled
+Resource console_resource.robot
+
+*** Test Cases ***
+Execution succeeds
+ Should Be Equal ${SUITE.name} Log
+
+Console outputs are disabled
+ Stdout Should Be empty.txt
+ Stderr Should Be empty.txt
+
+Log To Console keyword succeeds
+ Check Test Case Log to console
+
+*** Keywords ***
+Run tests with standard streams disabled
+ [Documentation] Streams are disabled by using the sitecustomize module:
+ ... https://docs.python.org/3/library/site.html#module-sitecustomize
+ Copy File ${CURDIR}/disable_standard_streams.py %{TEMPDIR}/sitecustomize.py
+ Set Environment Variable PYTHONPATH %{TEMPDIR}
+ Run Tests ${EMPTY} standard_libraries/builtin/log.robot
+ [Teardown] Remove File %{TEMPDIR}/sitecustomize.py
diff --git a/atest/robot/cli/dryrun/dryrun.robot b/atest/robot/cli/dryrun/dryrun.robot
index ba99d924477..f6e0c24269c 100644
--- a/atest/robot/cli/dryrun/dryrun.robot
+++ b/atest/robot/cli/dryrun/dryrun.robot
@@ -6,43 +6,51 @@ Resource dryrun_resource.robot
*** Test Cases ***
Passing keywords
${tc}= Check Test Case ${TESTNAME}
- Length Should Be ${tc.kws} 4
- Check Keyword Data ${tc.kws[0]} BuiltIn.Log status=NOT RUN args=Hello from test
- Check Keyword Data ${tc.kws[1]} OperatingSystem.List Directory status=NOT RUN assign=\${contents} args=.
- Check Keyword Data ${tc.kws[2]} resource.Simple UK
- Check Keyword Data ${tc.kws[2].kws[0]} BuiltIn.Log status=NOT RUN args=Hello from UK
+ Length Should Be ${tc.body} 4
+ Check Keyword Data ${tc[0]} BuiltIn.Log status=NOT RUN args=Hello from test
+ Check Keyword Data ${tc[1]} OperatingSystem.List Directory status=NOT RUN assign=\${contents} args=.
+ Check Keyword Data ${tc[2]} resource.Simple UK
+ Check Keyword Data ${tc[2, 0]} BuiltIn.Log status=NOT RUN args=Hello from UK
Keywords with embedded arguments
${tc}= Check Test Case ${TESTNAME}
- Length Should Be ${tc.kws} 5
- Check Keyword Data ${tc.kws[0]} Embedded arguments here
- Check Keyword Data ${tc.kws[0].kws[0]} BuiltIn.No Operation status=NOT RUN
- Check Keyword Data ${tc.kws[1]} Embedded args rock here
- Check Keyword Data ${tc.kws[1].kws[0]} BuiltIn.No Operation status=NOT RUN
- Check Keyword Data ${tc.kws[2]} Some embedded and normal args args=42
- Check Keyword Data ${tc.kws[2].kws[0]} BuiltIn.No Operation status=NOT RUN
- Check Keyword Data ${tc.kws[3]} Some embedded and normal args args=\${does not exist}
- Check Keyword Data ${tc.kws[3].kws[0]} BuiltIn.No Operation status=NOT RUN
+ Length Should Be ${tc.body} 5
+ Check Keyword Data ${tc[0]} Embedded arguments here
+ Check Keyword Data ${tc[0, 0]} BuiltIn.No Operation status=NOT RUN
+ Check Keyword Data ${tc[1]} Embedded args rock here
+ Check Keyword Data ${tc[1, 0]} BuiltIn.No Operation status=NOT RUN
+ Check Keyword Data ${tc[2]} Some embedded and normal args args=42
+ Check Keyword Data ${tc[2, 0]} BuiltIn.No Operation status=NOT RUN
+ Check Keyword Data ${tc[3]} Some embedded and normal args args=\${does not exist}
+ Check Keyword Data ${tc[3, 0]} BuiltIn.No Operation status=NOT RUN
+
+Keywords with types
+ Check Test Case ${TESTNAME}
+
+Keywords with types that would fail
+ Check Test Case ${TESTNAME}
+ Error In File 1 cli/dryrun/dryrun.robot 214
+ ... Creating keyword 'Invalid type' failed: Invalid argument specification: Invalid argument '\${arg: bad}': Unrecognized type 'bad'.
Library keyword with embedded arguments
${tc}= Check Test Case ${TESTNAME}
- Length Should Be ${tc.kws} 2
- Check Keyword Data ${tc.kws[0]} EmbeddedArgs.Log 42 times status=NOT RUN
+ Length Should Be ${tc.body} 2
+ Check Keyword Data ${tc[0]} EmbeddedArgs.Log 42 times status=NOT RUN
Keywords that would fail
${tc}= Check Test Case ${TESTNAME}
- Length Should Be ${tc.kws} 3
- Check Keyword Data ${tc.kws[0]} BuiltIn.Fail status=NOT RUN args=Not actually executed so won't fail.
- Check Keyword Data ${tc.kws[1]} resource.Fail In UK
- Length Should Be ${tc.kws[1].kws} 2
- Check Keyword Data ${tc.kws[1].kws[0]} BuiltIn.Fail status=NOT RUN args=
- Check Keyword Data ${tc.kws[1].kws[1]} BuiltIn.Fail status=NOT RUN args=And again
+ Length Should Be ${tc.body} 3
+ Check Keyword Data ${tc[0]} BuiltIn.Fail status=NOT RUN args=Not actually executed so won't fail.
+ Check Keyword Data ${tc[1]} resource.Fail In UK
+ Length Should Be ${tc[1].body} 2
+ Check Keyword Data ${tc[1, 0]} BuiltIn.Fail status=NOT RUN args=
+ Check Keyword Data ${tc[1, 1]} BuiltIn.Fail status=NOT RUN args=And again
Scalar variables are not checked in keyword arguments
[Documentation] Variables are too often set somehow dynamically that we cannot expect them to always exist.
${tc}= Check Test Case ${TESTNAME}
- Check Keyword Data ${tc.kws[0]} BuiltIn.Log status=NOT RUN args=\${TESTNAME}
- Check Keyword Data ${tc.kws[1]} BuiltIn.Log status=NOT RUN args=\${this does not exist}
+ Check Keyword Data ${tc[0]} BuiltIn.Log status=NOT RUN args=\${TESTNAME}
+ Check Keyword Data ${tc[1]} BuiltIn.Log status=NOT RUN args=\${this does not exist}
List variables are not checked in keyword arguments
[Documentation] See the doc of the previous test
@@ -55,22 +63,22 @@ Dict variables are not checked in keyword arguments
Variables are not checked in when arguments are embedded
[Documentation] See the doc of the previous test
${tc}= Check Test Case ${TESTNAME}
- Check Keyword Data ${tc.kws[0]} Embedded \${TESTNAME} here
- Check Keyword Data ${tc.kws[0].kws[0]} BuiltIn.No Operation status=NOT RUN
- Check Keyword Data ${tc.kws[1]} Embedded \${nonex} here
- Check Keyword Data ${tc.kws[1].kws[0]} BuiltIn.No Operation status=NOT RUN
+ Check Keyword Data ${tc[0]} Embedded \${TESTNAME} here
+ Check Keyword Data ${tc[0, 0]} BuiltIn.No Operation status=NOT RUN
+ Check Keyword Data ${tc[1]} Embedded \${nonex} here
+ Check Keyword Data ${tc[1, 0]} BuiltIn.No Operation status=NOT RUN
Setup/teardown with non-existing variable is ignored
${tc} = Check Test Case ${TESTNAME}
- Setup Should Not Be Defined ${SUITE}
- Setup Should Not Be Defined ${tc}
+ Setup Should Not Be Defined ${SUITE}
+ Setup Should Not Be Defined ${tc}
Teardown Should Not Be Defined ${tc}
Setup/teardown with existing variable is resolved and executed
${tc} = Check Test Case ${TESTNAME}
- Check Keyword Data ${tc.setup} BuiltIn.No Operation status=NOT RUN type=SETUP
- Check Keyword Data ${tc.teardown} Teardown args=\${nonex arg} type=TEARDOWN
- Check Keyword Data ${tc.teardown.body[0]} BuiltIn.Log args=\${arg} status=NOT RUN
+ Check Keyword Data ${tc.setup} BuiltIn.No Operation status=NOT RUN type=SETUP
+ Check Keyword Data ${tc.teardown} Teardown args=\${nonex arg} type=TEARDOWN
+ Check Keyword Data ${tc.teardown[0]} BuiltIn.Log args=\${arg} status=NOT RUN
User keyword return value
Check Test Case ${TESTNAME}
@@ -80,29 +88,29 @@ Non-existing variable in user keyword return value
Test Setup and Teardown
${tc}= Check Test Case ${TESTNAME}
- Length Should Be ${tc.kws} 2
- Check Keyword Data ${tc.setup} BuiltIn.Log args=Hello Setup status=NOT RUN type=SETUP
- Check Keyword Data ${tc.teardown} Does not exist status=FAIL type=TEARDOWN
+ Length Should Be ${tc.body} 2
+ Check Keyword Data ${tc.setup} BuiltIn.Log args=Hello Setup status=NOT RUN type=SETUP
+ Check Keyword Data ${tc.teardown} Does not exist status=FAIL type=TEARDOWN
Keyword Teardown
${tc}= Check Test Case ${TESTNAME}
- Length Should Be ${tc.kws} 2
- Check Keyword Data ${tc.kws[0].teardown} Does not exist status=FAIL type=TEARDOWN
+ Length Should Be ${tc.body} 2
+ Check Keyword Data ${tc[0].teardown} Does not exist status=FAIL type=TEARDOWN
Keyword teardown with non-existing variable is ignored
Check Test Case ${TESTNAME}
Keyword teardown with existing variable is resolved and executed
${tc}= Check Test Case ${TESTNAME}
- Check Keyword Data ${tc.kws[0].teardown} Teardown args=\${I DO NOT EXIST} type=TEARDOWN
- Check Keyword Data ${tc.kws[0].teardown.kws[0]} BuiltIn.Log args=\${arg} status=NOT RUN
+ Check Keyword Data ${tc[0].teardown} Teardown args=\${I DO NOT EXIST} type=TEARDOWN
+ Check Keyword Data ${tc[0].teardown[0]} BuiltIn.Log args=\${arg} status=NOT RUN
Non-existing keyword name
Check Test Case ${TESTNAME}
Invalid syntax in UK
Check Test Case ${TESTNAME}
- Error In File 0 cli/dryrun/dryrun.robot 167
+ Error In File 0 cli/dryrun/dryrun.robot 210
... SEPARATOR=\n
... Creating keyword 'Invalid Syntax UK' failed: Invalid argument specification: Multiple errors:
... - Invalid argument syntax '\${oops'.
@@ -113,19 +121,19 @@ Multiple Failures
Avoid keyword in dry-run
${tc} = Check Test Case ${TESTNAME}
- Keyword should have been skipped with tag ${tc.kws[0]} Keyword not run in dry-run robot:no-dry-run
- Keyword should have been skipped with tag ${tc.kws[1]} Another keyword not run in dry-run ROBOT: no-dry-run
- Keyword should have been skipped with tag ${tc.kws[2].kws[0]} Keyword not run in dry-run robot:no-dry-run
- Keyword should have been skipped with tag ${tc.kws[2].kws[1]} Another keyword not run in dry-run ROBOT: no-dry-run
- Keyword should have been validated ${tc.kws[2].kws[2]}
- Keyword should have been validated ${tc.kws[3]}
+ Keyword should have been skipped with tag ${tc[0]} Keyword not run in dry-run robot:no-dry-run
+ Keyword should have been skipped with tag ${tc[1]} Another keyword not run in dry-run ROBOT: no-dry-run
+ Keyword should have been skipped with tag ${tc[2, 0]} Keyword not run in dry-run robot:no-dry-run
+ Keyword should have been skipped with tag ${tc[2, 1]} Another keyword not run in dry-run ROBOT: no-dry-run
+ Keyword should have been validated ${tc[2, 2]}
+ Keyword should have been validated ${tc[3]}
Invalid imports
- Error in file 1 cli/dryrun/dryrun.robot 7
+ Error in file 2 cli/dryrun/dryrun.robot 7
... Importing library 'DoesNotExist' failed: *Error: *
- Error in file 2 cli/dryrun/dryrun.robot 8
+ Error in file 3 cli/dryrun/dryrun.robot 8
... Variable file 'wrong_path.py' does not exist.
- Error in file 3 cli/dryrun/dryrun.robot 9
+ Error in file 4 cli/dryrun/dryrun.robot 9
... Resource file 'NonExisting.robot' does not exist.
[Teardown] NONE
diff --git a/atest/robot/cli/dryrun/dryrun_resource.robot b/atest/robot/cli/dryrun/dryrun_resource.robot
index 0c87de0da49..3591a4168fd 100644
--- a/atest/robot/cli/dryrun/dryrun_resource.robot
+++ b/atest/robot/cli/dryrun/dryrun_resource.robot
@@ -4,14 +4,13 @@ Resource atest_resource.robot
*** Keywords ***
Keyword should have been skipped with tag
[Arguments] ${kw} ${name} ${tags}
- Check Keyword Data ${kw} ${name} status=PASS tags=${tags}
- Should Be Empty ${kw.kws}
+ Check Keyword Data ${kw} ${name} status=PASS tags=${tags} children=0
Keyword should have been validated
[Arguments] ${kw}
- Check Keyword Data ${kw} resource.This is validated
- Check Keyword Data ${kw.kws[0]} BuiltIn.Log status=NOT RUN args=This is validated
+ Check Keyword Data ${kw} resource.This is validated
+ Check Keyword Data ${kw[0]} BuiltIn.Log status=NOT RUN args=This is validated
Last keyword should have been validated
- ${tc} = Get test case ${TEST NAME}
- Keyword should have been validated ${tc.kws[-1]}
+ ${tc} = Get Test Case ${TEST NAME}
+ Keyword should have been validated ${tc[-1]}
diff --git a/atest/robot/cli/dryrun/executed_builtin_keywords.robot b/atest/robot/cli/dryrun/executed_builtin_keywords.robot
index a8e1df246f1..7aa269847e3 100644
--- a/atest/robot/cli/dryrun/executed_builtin_keywords.robot
+++ b/atest/robot/cli/dryrun/executed_builtin_keywords.robot
@@ -4,18 +4,28 @@ Resource atest_resource.robot
*** Test Cases ***
Import Library
- Check Test Case ${TESTNAME}
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Import Library args=String
Syslog Should Contain Imported library 'String' with arguments [ ]
Syslog Should Contain Imported library 'ParameterLibrary' with arguments [ value | 42 ]
+Import Resource
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Import Resource args=\${RESOURCE}
+ ${resource} = Normalize Path ${DATADIR}/cli/dryrun/resource.robot
+ Syslog Should Contain Imported resource file '${resource}' (6 keywords).
+
Set Library Search Order
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[1].full_name} Second.Parameters
- Should Be Equal ${tc.kws[2].full_name} First.Parameters
- Should Be Equal ${tc.kws[4].full_name} Dynamic.Parameters
+ Check Keyword Data ${tc[0]} BuiltIn.Set Library Search Order args=Second
+ Should Be Equal ${tc[1].full_name} Second.Parameters
+ Should Be Equal ${tc[2].full_name} First.Parameters
+ Should Be Equal ${tc[4].full_name} Dynamic.Parameters
Set Tags
- Check Test Tags ${TESTNAME} \${2} \${var} Tag0 Tag1 Tag2
+ ${tc} = Check Test Tags ${TESTNAME} \${2} \${var} Tag0 Tag1 Tag2
+ Check Keyword Data ${tc[0]} BuiltIn.Set Tags args=Tag1, Tag2, \${var}, \${2}
Remove Tags
- Check Test Tags ${TESTNAME} Tag1 Tag3
+ ${tc} = Check Test Tags ${TESTNAME} Tag1 Tag3
+ Check Keyword Data ${tc[0]} BuiltIn.Remove Tags args=Tag2, \${var}
diff --git a/atest/robot/cli/dryrun/for.robot b/atest/robot/cli/dryrun/for.robot
index 0b34d8d1c91..879609609d5 100644
--- a/atest/robot/cli/dryrun/for.robot
+++ b/atest/robot/cli/dryrun/for.robot
@@ -6,11 +6,11 @@ Resource dryrun_resource.robot
*** Test Cases ***
FOR
${tc} = Check Test Case ${TESTNAME}
- Validate loops ${tc} 4
- Length should be ${tc.kws[2].kws} 3
- Length should be ${tc.kws[2].kws[0].kws} 0
- Length should be ${tc.kws[2].kws[1].kws} 1
- Length should be ${tc.kws[2].kws[2].kws} 0
+ Validate loops ${tc} 4
+ Length should be ${tc[2].body} 3
+ Length should be ${tc[2, 0].body} 0
+ Length should be ${tc[2, 1].body} 1
+ Length should be ${tc[2, 2].body} 0
FOR IN RANGE
${tc} = Check Test Case ${TESTNAME}
@@ -27,8 +27,8 @@ FOR IN ZIP
*** Keywords ***
Validate loops
[Arguments] ${tc} ${kws}=3
- Length should be ${tc.kws} ${kws}
- Length should be ${tc.kws[0].kws} 1
- Length should be ${tc.kws[0].kws[0].kws} 2
- Length should be ${tc.kws[1].kws} 1
- Length should be ${tc.kws[1].kws[0].kws} 1
+ Length should be ${tc.body} ${kws}
+ Length should be ${tc[0].body} 1
+ Length should be ${tc[0, 0].body} 2
+ Length should be ${tc[1].body} 1
+ Length should be ${tc[1, 0].body} 1
diff --git a/atest/robot/cli/dryrun/if.robot b/atest/robot/cli/dryrun/if.robot
index 24db7db4b32..31bf7359c26 100644
--- a/atest/robot/cli/dryrun/if.robot
+++ b/atest/robot/cli/dryrun/if.robot
@@ -6,18 +6,18 @@ Resource dryrun_resource.robot
*** Test Cases ***
IF will not recurse in dry run
${tc}= Check Test Case ${TESTNAME}
- Check Branch Statuses ${tc.body[0]} Recursive if PASS
- Check Branch Statuses ${tc.body[0].body[0].body[0].body[0]} Recursive if NOT RUN
+ Check Branch Statuses ${tc[0]} Recursive if PASS
+ Check Branch Statuses ${tc[0, 0, 0, 0]} Recursive if NOT RUN
ELSE IF will not recurse in dry run
${tc}= Check Test Case ${TESTNAME}
- Check Branch Statuses ${tc.body[0]} Recursive else if PASS
- Check Branch Statuses ${tc.body[0].body[0].body[1].body[0]} Recursive else if NOT RUN
+ Check Branch Statuses ${tc[0]} Recursive else if PASS
+ Check Branch Statuses ${tc[0, 0, 1, 0]} Recursive else if NOT RUN
ELSE will not recurse in dry run
${tc}= Check Test Case ${TESTNAME}
- Check Branch Statuses ${tc.body[0]} Recursive else PASS
- Check Branch Statuses ${tc.body[0].body[0].body[2].body[0]} Recursive else NOT RUN
+ Check Branch Statuses ${tc[0]} Recursive else PASS
+ Check Branch Statuses ${tc[0, 0, 2, 0]} Recursive else NOT RUN
Dryrun fail inside of IF
Check Test Case ${TESTNAME}
@@ -44,9 +44,9 @@ Dryrun fail empty IF in non executed branch
Check Branch Statuses
[Arguments] ${kw} ${name} ${status}
Should Be Equal ${kw.name} ${name}
- Should Be Equal ${kw.body[0].body[0].type} IF
- Should Be Equal ${kw.body[0].body[0].status} ${status}
- Should Be Equal ${kw.body[0].body[1].type} ELSE IF
- Should Be Equal ${kw.body[0].body[1].status} ${status}
- Should Be Equal ${kw.body[0].body[2].type} ELSE
- Should Be Equal ${kw.body[0].body[2].status} ${status}
+ Should Be Equal ${kw[0, 0].type} IF
+ Should Be Equal ${kw[0, 0].status} ${status}
+ Should Be Equal ${kw[0, 1].type} ELSE IF
+ Should Be Equal ${kw[0, 1].status} ${status}
+ Should Be Equal ${kw[0, 2].type} ELSE
+ Should Be Equal ${kw[0, 2].status} ${status}
diff --git a/atest/robot/cli/dryrun/run_keyword_variants.robot b/atest/robot/cli/dryrun/run_keyword_variants.robot
index fcbbfe40791..8d53a67d722 100644
--- a/atest/robot/cli/dryrun/run_keyword_variants.robot
+++ b/atest/robot/cli/dryrun/run_keyword_variants.robot
@@ -1,108 +1,130 @@
*** Settings ***
-Suite Setup Run Tests --dryrun cli/dryrun/run_keyword_variants.robot
-Resource atest_resource.robot
+Suite Setup Run Tests --dryrun --listener ${LISTENER} cli/dryrun/run_keyword_variants.robot
+Resource atest_resource.robot
+
+*** Variables ***
+${LISTENER} ${DATADIR}/cli/dryrun/LinenoListener.py
*** Test Cases ***
Run Keyword With Keyword with Invalid Number of Arguments
- Check Test Case ${TESTNAME}
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Run Keyword args=Log status=FAIL
+ Check Keyword Data ${tc[0, 0]} BuiltIn.Log args= status=FAIL
Run Keyword With Missing Keyword
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Keywords with variable in name are ignored
- Test Should Have Correct Keywords kw_index=0
- Test Should Have Correct Keywords BuiltIn.No Operation kw_index=1
- Test Should Have Correct Keywords kw_index=2
- Test Should Have Correct Keywords BuiltIn.No Operation kw_index=3
+ Test Should Have Correct Keywords kw_index=0
+ Test Should Have Correct Keywords BuiltIn.No Operation kw_index=1
+ Test Should Have Correct Keywords kw_index=2
+ Test Should Have Correct Keywords BuiltIn.No Operation kw_index=3
Keywords with variable in name are ignored also when variable is argument
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keyword With UK
- Check Test Case ${TESTNAME}
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Run Keyword If args=True, UK status=PASS
+ Check Keyword Data ${tc[0, 0]} UK status=PASS
+ Check Keyword Data ${tc[0, 0, 0]} BuiltIn.No Operation status=NOT RUN
Run Keyword With Failing UK
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Comment
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Set Test/Suite/Global Variable
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Variable Should (Not) Exist
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Get Variable Value
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Set Variable If
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keywords When All Keywords Pass
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keywords When One Keyword Fails
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keywords When Multiple Keyword Fails
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keywords With Arguments When All Keywords Pass
- Test Should Have Correct Keywords BuiltIn.Log Many BuiltIn.No Operation
+ Test Should Have Correct Keywords BuiltIn.Log Many BuiltIn.No Operation
Run Keywords With Arguments When One Keyword Fails
- Test Should Have Correct Keywords BuiltIn.Log BuiltIn.Log
+ Test Should Have Correct Keywords BuiltIn.Log BuiltIn.Log
Run Keywords With Arguments When Multiple Keyword Fails
- Test Should Have Correct Keywords BuiltIn.Log Unknown Keyword
+ Test Should Have Correct Keywords BuiltIn.Log Unknown Keyword
Run Keywords With Arguments With Variables
- Test Should Have Correct Keywords BuiltIn.Log
+ Test Should Have Correct Keywords BuiltIn.Log
Run Keyword in For Loop Pass
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keyword in For Loop Fail
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Wait Until Keyword Succeeds Pass
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Wait Until Keyword Succeeds Fail
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keyword If Pass
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keyword If Fail
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keyword If with ELSE
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keyword If with ELSE IF
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keyword If with ELSE IF and ELSE
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keyword If with ELSE IF and ELSE without keywords
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keyword If with escaped or non-caps ELSE IF and ELSE
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Run Keyword If with list variable in ELSE IF and ELSE
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Test Teardown Related Run Keyword Variants
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Given/When/Then
- ${tc} = Check Test Case ${TESTNAME}
- Length Should Be ${tc.kws[0].kws} 1
- Length Should Be ${tc.kws[1].kws} 3
- Length Should Be ${tc.kws[2].kws} 2
- Length Should Be ${tc.kws[3].kws} 3
- Length Should Be ${tc.kws[4].kws} 3
+ ${tc} = Check Test Case ${TESTNAME}
+ Length Should Be ${tc[0].body} 1
+ Length Should Be ${tc[1].body} 3
+ Length Should Be ${tc[2].body} 2
+ Length Should Be ${tc[3].body} 3
+ Length Should Be ${tc[4].body} 3
+
+Line number
+ Should Be Empty ${ERRORS}
+ ${tc} = Check Test Case Run Keyword With Missing Keyword
+ Should Be Equal ${tc[0].doc} Keyword 'Run Keyword' on line 14.
+ Should Be Equal ${tc[0, 0].doc} Keyword 'Missing' on line 14.
+ ${tc} = Check Test Case Run Keywords When One Keyword Fails
+ Should Be Equal ${tc[0].doc} Keyword 'Run Keywords' on line 68.
+ Should Be Equal ${tc[0, 0].doc} Keyword 'Fail' on line 68.
+ Should Be Equal ${tc[0, 2].doc} Keyword 'Log' on line 68.
+ Should Be Equal ${tc[0, 3].doc} Keyword 'UK' on line 68.
+ ${tc} = Check Test Case Run Keyword If Pass
+ Should Be Equal ${tc[0].doc} Keyword 'Run Keyword If' on line 114.
+ Should Be Equal ${tc[0, 0].doc} Keyword 'No Operation' on line 114.
diff --git a/atest/robot/cli/dryrun/try_except.robot b/atest/robot/cli/dryrun/try_except.robot
index d2c1d31db95..be64c9590eb 100644
--- a/atest/robot/cli/dryrun/try_except.robot
+++ b/atest/robot/cli/dryrun/try_except.robot
@@ -6,11 +6,11 @@ Resource dryrun_resource.robot
*** Test Cases ***
TRY
${tc} = Check Test Case ${TESTNAME}
- Check TRY Data ${tc.body[0].body[0]}
- Check Keyword Data ${tc.body[0].body[0].body[0]} resource.Simple UK
- Check Keyword Data ${tc.body[0].body[0].body[0].body[0]} BuiltIn.Log args=Hello from UK status=NOT RUN
- Check Keyword Data ${tc.body[0].body[1].body[0]} BuiltIn.Log args=handling it status=NOT RUN
- Check Keyword Data ${tc.body[0].body[2].body[0]} BuiltIn.Log args=in the else status=NOT RUN
- Check Keyword Data ${tc.body[0].body[3].body[0]} BuiltIn.Log args=in the finally status=NOT RUN
- Check TRY Data ${tc.body[1].body[0]} status=FAIL
- Check Keyword Data ${tc.body[1].body[0].body[0]} resource.Anarchy in the UK status=FAIL args=1, 2
+ Check TRY Data ${tc[0, 0]}
+ Check Keyword Data ${tc[0, 0, 0]} resource.Simple UK
+ Check Keyword Data ${tc[0, 0, 0, 0]} BuiltIn.Log args=Hello from UK status=NOT RUN
+ Check Keyword Data ${tc[0, 1, 0]} BuiltIn.Log args=handling it status=NOT RUN
+ Check Keyword Data ${tc[0, 2, 0]} BuiltIn.Log args=in the else status=NOT RUN
+ Check Keyword Data ${tc[0, 3, 0]} BuiltIn.Log args=in the finally status=NOT RUN
+ Check TRY Data ${tc[1, 0]} status=FAIL
+ Check Keyword Data ${tc[1, 0, 0]} resource.Anarchy in the UK status=FAIL args=1, 2
diff --git a/atest/robot/cli/dryrun/type_conversion.robot b/atest/robot/cli/dryrun/type_conversion.robot
index 3d5b9b0f2b5..3ed4f230cf4 100644
--- a/atest/robot/cli/dryrun/type_conversion.robot
+++ b/atest/robot/cli/dryrun/type_conversion.robot
@@ -3,7 +3,9 @@ Resource atest_resource.robot
*** Test Cases ***
Annotations
- Run Tests --dryrun keywords/type_conversion/annotations.robot
+ # Exclude test requiring Python 3.14 unconditionally to avoid a failure with
+ # older versions. It can be included once Python 3.14 is our minimum versoin.
+ Run Tests --dryrun --exclude require-py3.14 keywords/type_conversion/annotations.robot
Should be equal ${SUITE.status} PASS
Keyword Decorator
diff --git a/atest/robot/cli/dryrun/while.robot b/atest/robot/cli/dryrun/while.robot
index 3ed2f40d78c..65a1bda2f29 100644
--- a/atest/robot/cli/dryrun/while.robot
+++ b/atest/robot/cli/dryrun/while.robot
@@ -6,16 +6,16 @@ Resource dryrun_resource.robot
*** Test Cases ***
WHILE
${tc} = Check Test Case ${TESTNAME}
- Length should be ${tc.body[1].body} 1
- Length should be ${tc.body[1].body[0].body} 3
- Length should be ${tc.body[2].body} 1
- Length should be ${tc.body[1].body[0].body} 3
- Length should be ${tc.body[3].body} 3
- Length should be ${tc.body[3].body[0].body} 0
- Length should be ${tc.body[3].body[1].body} 1
- Length should be ${tc.body[3].body[2].body} 0
+ Length should be ${tc[1].body} 1
+ Length should be ${tc[1, 0].body} 3
+ Length should be ${tc[2].body} 1
+ Length should be ${tc[1, 0].body} 3
+ Length should be ${tc[3].body} 3
+ Length should be ${tc[3, 0].body} 0
+ Length should be ${tc[3, 1].body} 1
+ Length should be ${tc[3, 2].body} 0
WHILE with BREAK and CONTINUE
${tc} = Check Test Case ${TESTNAME}
- Length should be ${tc.body[1].body} 1
- Length should be ${tc.body[2].body} 1
+ Length should be ${tc[1].body} 1
+ Length should be ${tc[2].body} 1
diff --git a/atest/robot/cli/model_modifiers/ModelModifier.py b/atest/robot/cli/model_modifiers/ModelModifier.py
index 17feec7b982..f285434fa05 100644
--- a/atest/robot/cli/model_modifiers/ModelModifier.py
+++ b/atest/robot/cli/model_modifiers/ModelModifier.py
@@ -1,62 +1,81 @@
from robot.model import SuiteVisitor
+from robot.running import TestCase as RunningTestCase
+from robot.running.model import Argument
class ModelModifier(SuiteVisitor):
def __init__(self, *tags, **extra):
if extra:
- tags += tuple('%s-%s' % item for item in extra.items())
- self.config = tags or ('visited',)
+ tags += tuple("-".join(item) for item in extra.items())
+ self.config = tags or ("visited",)
def start_suite(self, suite):
config = self.config
- if config[0] == 'FAIL':
- raise RuntimeError(' '.join(self.config[1:]))
- elif config[0] == 'CREATE':
- tc = suite.tests.create(**dict(conf.split('-', 1) for conf in config[1:]))
- tc.body.create_keyword('Log', args=['Args as strings', 'level=INFO'])
- tc.body.create_keyword('Log', args=[('Args as tuples',), ('level', 'INFO')])
- tc.body.create_keyword('Log', args=[('Args as pos and named',), {'level': 'INFO'}])
+ if config[0] == "FAIL":
+ raise RuntimeError(" ".join(self.config[1:]))
+ elif config[0] == "CREATE":
+ tc = suite.tests.create(**dict(conf.split("-", 1) for conf in config[1:]))
+ tc.body.create_keyword("Log", args=["Hello", "level=INFO"])
+ if isinstance(tc, RunningTestCase):
+ # robot.running.model.Argument is a private/temporary API for creating
+ # named arguments with non-string values programmatically. It was added
+ # in RF 7.0.1 (#5031) after a failed attempt to add an API for this
+ # purpose in RF 7.0 (#5000).
+ tc.body.create_keyword(
+ "Log",
+ args=[Argument(None, "Argument object"), Argument("level", "INFO")],
+ )
+ tc.body.create_keyword(
+ "Should Contain",
+ args=[(1, 2, 3), Argument("item", 2)],
+ )
+ # Passing named args separately is supported since RF 7.1 (#5143).
+ tc.body.create_keyword(
+ "Log",
+ args=["Named args separately"],
+ named_args={"html": True, "level": '${{"INFO"}}'},
+ )
self.config = []
- elif config == ('REMOVE', 'ALL', 'TESTS'):
+ elif config == ("REMOVE", "ALL", "TESTS"):
suite.tests = []
else:
- suite.tests = [t for t in suite.tests if not t.tags.match('fail')]
+ suite.tests = [t for t in suite.tests if not t.tags.match("fail")]
def start_test(self, test):
- self.make_non_empty(test, 'Test')
- if hasattr(test.parent, 'resource'):
+ self.make_non_empty(test, "Test")
+ if hasattr(test.parent, "resource"):
for kw in test.parent.resource.keywords:
- self.make_non_empty(kw, 'Keyword')
+ self.make_non_empty(kw, "Keyword")
test.tags.add(self.config)
def make_non_empty(self, item, kind):
if not item.name:
- item.name = f'{kind} name made non-empty by modifier'
+ item.name = f"{kind} name made non-empty by modifier"
item.body.clear()
if not item.body:
- item.body.create_keyword('Log', [f'{kind} body made non-empty by modifier'])
+ item.body.create_keyword("Log", [f"{kind} body made non-empty by modifier"])
def start_for(self, for_):
- if for_.parent.name == 'FOR IN RANGE':
- for_.flavor = 'IN'
- for_.values = ['FOR', 'is', 'modified!']
+ if for_.parent.name == "FOR IN RANGE":
+ for_.flavor = "IN"
+ for_.values = ["FOR", "is", "modified!"]
def start_for_iteration(self, iteration):
for name, value in iteration.assign.items():
- iteration.assign[name] = value + ' (modified)'
- iteration.assign['${x}'] = 'new'
+ iteration.assign[name] = value + " (modified)"
+ iteration.assign["${x}"] = "new"
def start_if_branch(self, branch):
if branch.condition == "'${x}' == 'wrong'":
- branch.condition = 'True'
+ branch.condition = "True"
# With Robot
- if not hasattr(branch, 'status'):
- branch.body[0].config(name='Log', args=['going here!'])
+ if not hasattr(branch, "status"):
+ branch.body[0].config(name="Log", args=["going here!"])
# With Rebot
- elif branch.status == 'NOT RUN':
- branch.status = 'PASS'
- branch.condition = 'modified'
- branch.body[0].args = ['got here!']
- if branch.condition == '${i} == 9':
- branch.condition = 'False'
+ elif branch.status == "NOT RUN":
+ branch.status = "PASS"
+ branch.condition = "modified"
+ branch.body[0].args = ["got here!"]
+ if branch.condition == "${i} == 9":
+ branch.condition = "False"
diff --git a/atest/robot/cli/model_modifiers/pre_rebot.robot b/atest/robot/cli/model_modifiers/pre_rebot.robot
index 3490733e13f..a648d50c498 100644
--- a/atest/robot/cli/model_modifiers/pre_rebot.robot
+++ b/atest/robot/cli/model_modifiers/pre_rebot.robot
@@ -60,25 +60,25 @@ Modifiers are used before normal configuration
Modify FOR
[Setup] Modify FOR and IF
${tc} = Check Test Case FOR IN RANGE
- Should Be Equal ${tc.body[0].flavor} IN
- Should Be Equal ${tc.body[0].values} ${{('FOR', 'is', 'modified!')}}
- Should Be Equal ${tc.body[0].body[0].assign['\${i}']} 0 (modified)
- Should Be Equal ${tc.body[0].body[0].assign['\${x}']} new
- Check Log Message ${tc.body[0].body[0].body[0].msgs[0]} 0
- Should Be Equal ${tc.body[0].body[1].assign['\${i}']} 1 (modified)
- Should Be Equal ${tc.body[0].body[1].assign['\${x}']} new
- Check Log Message ${tc.body[0].body[1].body[0].msgs[0]} 1
- Should Be Equal ${tc.body[0].body[2].assign['\${i}']} 2 (modified)
- Should Be Equal ${tc.body[0].body[2].assign['\${x}']} new
- Check Log Message ${tc.body[0].body[2].body[0].msgs[0]} 2
+ Should Be Equal ${tc[0].flavor} IN
+ Should Be Equal ${tc[0].values} ${{('FOR', 'is', 'modified!')}}
+ Should Be Equal ${tc[0, 0].assign['\${i}']} 0 (modified)
+ Should Be Equal ${tc[0, 0].assign['\${x}']} new
+ Check Log Message ${tc[0, 0, 0, 0]} 0
+ Should Be Equal ${tc[0, 1].assign['\${i}']} 1 (modified)
+ Should Be Equal ${tc[0, 1].assign['\${x}']} new
+ Check Log Message ${tc[0, 1, 0, 0]} 1
+ Should Be Equal ${tc[0, 2].assign['\${i}']} 2 (modified)
+ Should Be Equal ${tc[0, 2].assign['\${x}']} new
+ Check Log Message ${tc[0, 2, 0, 0]} 2
Modify IF
[Setup] Should Be Equal ${PREV TEST NAME} Modify FOR
${tc} = Check Test Case If structure
- Should Be Equal ${tc.body[1].body[0].condition} modified
- Should Be Equal ${tc.body[1].body[0].status} PASS
- Should Be Equal ${tc.body[1].body[0].body[0].args[0]} got here!
- Should Be Equal ${tc.body[1].body[1].status} PASS
+ Should Be Equal ${tc[1, 0].condition} modified
+ Should Be Equal ${tc[1, 0].status} PASS
+ Should Be Equal ${tc[1, 0, 0].args[0]} got here!
+ Should Be Equal ${tc[1, 1].status} PASS
*** Keywords ***
Modify FOR and IF
diff --git a/atest/robot/cli/model_modifiers/pre_run.robot b/atest/robot/cli/model_modifiers/pre_run.robot
index e502fd9bd04..f52626345f7 100644
--- a/atest/robot/cli/model_modifiers/pre_run.robot
+++ b/atest/robot/cli/model_modifiers/pre_run.robot
@@ -47,9 +47,9 @@ Error if all tests removed
Modifier can fix empty test and keyword
Run Tests --RunEmptySuite --PreRun ${CURDIR}/ModelModifier.py core/empty_testcase_and_uk.robot
${tc} = Check Test Case Empty Test Case PASS ${EMPTY}
- Check Log Message ${tc.body[0].msgs[0]} Test body made non-empty by modifier
+ Check Log Message ${tc[0, 0]} Test body made non-empty by modifier
${tc} = Check Test Case Empty User Keyword PASS ${EMPTY}
- Check Log Message ${tc.body[0].body[0].msgs[0]} Keyword body made non-empty by modifier
+ Check Log Message ${tc[0, 0, 0]} Keyword body made non-empty by modifier
Check Test Case Test name made non-empty by modifier PASS ${EMPTY}
Modifiers are used before normal configuration
@@ -57,16 +57,26 @@ Modifiers are used before normal configuration
Stderr Should Be Empty
Length Should Be ${SUITE.tests} 1
${tc} = Check Test Case Created
- Check Log Message ${tc.body[0].msgs[0]} Args as strings
- Check Log Message ${tc.body[1].msgs[0]} Args as tuples
- Check Log Message ${tc.body[2].msgs[0]} Args as pos and named
+ Check Log Message ${tc[0, 0]} Hello
+ Check Keyword Data ${tc[0]} BuiltIn.Log args=Hello, level=INFO
Lists should be equal ${tc.tags} ${{['added']}}
+Modifiers can use special Argument objects in arguments
+ ${tc} = Check Test Case Created
+ Check Log Message ${tc[1, 0]} Argument object
+ Check Keyword Data ${tc[1]} BuiltIn.Log args=Argument object, level=INFO
+ Check Keyword Data ${tc[2]} BuiltIn.Should Contain args=(1, 2, 3), item=2
+
+Modifiers can pass positional and named arguments separately
+ ${tc} = Check Test Case Created
+ Check Log Message ${tc[3, 0]} Named args separately html=True
+ Check Keyword Data ${tc[3]} BuiltIn.Log args=Named args separately, html=True, level=\${{"INFO"}}
+
Modify FOR and IF
Run Tests --prerun ${CURDIR}/ModelModifier.py misc/for_loops.robot misc/if_else.robot
${tc} = Check Test Case FOR IN RANGE
- Check Log Message ${tc.body[0].body[0].body[0].msgs[0]} FOR
- Check Log Message ${tc.body[0].body[1].body[0].msgs[0]} is
- Check Log Message ${tc.body[0].body[2].body[0].msgs[0]} modified!
+ Check Log Message ${tc[0, 0, 0, 0]} FOR
+ Check Log Message ${tc[0, 1, 0, 0]} is
+ Check Log Message ${tc[0, 2, 0, 0]} modified!
${tc} = Check Test Case If structure
- Check Log Message ${tc.body[1].body[0].body[0].msgs[0]} going here!
+ Check Log Message ${tc[1, 0, 0, 0]} going here!
diff --git a/atest/robot/cli/rebot/invalid_usage.robot b/atest/robot/cli/rebot/invalid_usage.robot
index c149bef3fc4..57b5a0acfb1 100644
--- a/atest/robot/cli/rebot/invalid_usage.robot
+++ b/atest/robot/cli/rebot/invalid_usage.robot
@@ -20,6 +20,10 @@ Non-Existing Input
Existing And Non-Existing Input
Reading XML source '.*nönéx.xml' failed: .* source=${INPUTFILE} nönéx.xml nonex2.xml
+No tests in output
+ [Setup] Create File %{TEMPDIR}/no_tests.xml
+ Suite 'No Tests!' contains no tests. source=%{TEMPDIR}/no_tests.xml
+
Non-XML Input
[Setup] Create File %{TEMPDIR}/invalid.robot Hello, world
(\\[Fatal Error\\] .*: Content is not allowed in prolog.\\n)?Reading XML source '.*invalid.robot' failed: .*
@@ -62,7 +66,7 @@ Invalid --RemoveKeywords
*** Keywords ***
Rebot Should Fail
[Arguments] ${error} ${options}= ${source}=${INPUT}
- ${result} = Run Rebot ${options} ${source} default options= output=
- Should Be Equal As Integers ${result.rc} 252
+ ${result} = Run Rebot ${options} ${source} default options= output=None
+ Should Be Equal ${result.rc} 252 type=int
Should Be Empty ${result.stdout}
Should Match Regexp ${result.stderr} ^\\[ .*ERROR.* \\] ${error}${USAGETIP}$
diff --git a/atest/robot/cli/rebot/log_level.robot b/atest/robot/cli/rebot/log_level.robot
index 89f7de709c5..4282351e68d 100644
--- a/atest/robot/cli/rebot/log_level.robot
+++ b/atest/robot/cli/rebot/log_level.robot
@@ -7,29 +7,29 @@ ${LOG NAME} logfile.html
*** Test Cases ***
By default all messages are included
${tc} = Rebot
- Check Log Message ${tc.kws[0].msgs[0]} Arguments: [ 'Test 1' ] TRACE
- Check Log Message ${tc.kws[0].msgs[1]} Test 1 INFO
- Check Log Message ${tc.kws[0].msgs[2]} Return: None TRACE
- Check Log Message ${tc.kws[1].msgs[0]} Arguments: [ 'Logging with debug level' | 'DEBUG' ] TRACE
- Check Log Message ${tc.kws[1].msgs[1]} Logging with debug level DEBUG
- Check Log Message ${tc.kws[1].msgs[2]} Return: None TRACE
+ Check Log Message ${tc[0, 0]} Arguments: [ 'Test 1' ] TRACE
+ Check Log Message ${tc[0, 1]} Test 1 INFO
+ Check Log Message ${tc[0, 2]} Return: None TRACE
+ Check Log Message ${tc[1, 0]} Arguments: [ 'Logging with debug level' | 'DEBUG' ] TRACE
+ Check Log Message ${tc[1, 1]} Logging with debug level DEBUG
+ Check Log Message ${tc[1, 2]} Return: None TRACE
Min level should be 'TRACE' and default 'TRACE'
Levels below given level are ignored
${tc} = Rebot --loglevel debug
- Check Log Message ${tc.kws[0].msgs[0]} Test 1 INFO
- Check Log Message ${tc.kws[1].msgs[0]} Logging with debug level DEBUG
+ Check Log Message ${tc[0, 0]} Test 1 INFO
+ Check Log Message ${tc[1, 0]} Logging with debug level DEBUG
Min level should be 'DEBUG' and default 'DEBUG'
${tc} = Rebot -L INFO
- Check Log Message ${tc.kws[0].msgs[0]} Test 1 INFO
- Should Be Empty ${tc.kws[1].msgs}
- Should Be Empty ${tc.kws[2].kws[0].msgs}
+ Check Log Message ${tc[0, 0]} Test 1 INFO
+ Should Be Empty ${tc[1].body}
+ Should Be Empty ${tc[2, 0].body}
Min level should be 'INFO' and default 'INFO'
All messages are ignored when NONE level is used
${tc} = Rebot --loglevel NONE
- Should Be Empty ${tc.kws[0].msgs}
- Should Be Empty ${tc.kws[1].msgs}
+ Should Be Empty ${tc[0].body}
+ Should Be Empty ${tc[1].body}
Min level should be 'NONE' and default 'NONE'
Configure visible log level
diff --git a/atest/robot/cli/rebot/rebot_cli_resource.robot b/atest/robot/cli/rebot/rebot_cli_resource.robot
index 5dd39858680..fb96e02d13f 100644
--- a/atest/robot/cli/rebot/rebot_cli_resource.robot
+++ b/atest/robot/cli/rebot/rebot_cli_resource.robot
@@ -18,7 +18,7 @@ Run tests to create input file for Rebot
Run rebot and return outputs
[Arguments] ${options}
Create Output Directory
- ${result} = Run Rebot --outputdir ${CLI OUTDIR} ${options} ${INPUT FILE} default options= output=
+ ${result} = Run Rebot --outputdir ${CLI OUTDIR} ${options} ${INPUT FILE} default options= output=None
Should Be Equal ${result.rc} ${0}
@{outputs} = List Directory ${CLI OUTDIR}
RETURN @{outputs}
diff --git a/atest/robot/cli/rebot/remove_keywords/all_passed_tag_and_name.robot b/atest/robot/cli/rebot/remove_keywords/all_passed_tag_and_name.robot
index b456598f5ab..9c8de17fbaa 100644
--- a/atest/robot/cli/rebot/remove_keywords/all_passed_tag_and_name.robot
+++ b/atest/robot/cli/rebot/remove_keywords/all_passed_tag_and_name.robot
@@ -6,185 +6,193 @@ Resource remove_keywords_resource.robot
*** Test Cases ***
All Mode
[Setup] Run Rebot and set My Suite --RemoveKeywords ALL 0
- Keyword Should Be Empty ${MY SUITE.setup} My Keyword Suite Setup
- Keyword Should Contain Removal Message ${MY SUITE.setup}
${tc1} = Check Test Case Pass
${tc2} = Check Test Case Fail
- Length Should Be ${tc1.body} 1
- Keyword Should Be Empty ${tc1.body[0]} My Keyword Pass
- Length Should Be ${tc2.body} 2
- Keyword Should Be Empty ${tc2.body[0]} My Keyword Fail
- Keyword Should Be Empty ${tc2.body[1]} BuiltIn.Fail Expected failure
- Keyword Should Contain Removal Message ${tc2.body[1]} Expected failure
${tc3} = Check Test Case Test with setup and teardown
- Keyword Should Be Empty ${tc3.setup} Test Setup
+ Keyword Should Be Empty ${MY SUITE.setup} My Keyword Suite Setup
+ Keyword Should Contain Removal Message ${MY SUITE.setup}
+ Length Should Be ${tc1.body} 3
+ Keyword Should Be Empty ${tc1[0]} My Keyword Pass
+ Length Should Be ${tc2.body} 2
+ Keyword Should Be Empty ${tc2[0]} My Keyword Fail
+ Keyword Should Be Empty ${tc2[1]} BuiltIn.Fail Expected failure
+ Keyword Should Contain Removal Message ${tc2[1]} Expected failure
+ Keyword Should Be Empty ${tc3.setup} Test Setup
Keyword Should Contain Removal Message ${tc3.setup}
- Keyword Should Be Empty ${tc3.teardown} Test Teardown
+ Keyword Should Be Empty ${tc3.teardown} Test Teardown
Keyword Should Contain Removal Message ${tc3.teardown}
Warnings Are Removed In All Mode
[Setup] Verify previous test and set My Suite All Mode 1
- Keyword Should Be Empty ${MY SUITE.setup} Warning in suite setup
- Keyword Should Be Empty ${MY SUITE.teardown} Warning in suite teardown
${tc1} ${tc2}= Set Variable ${MY SUITE.tests[:2]}
- Length Should Be ${tc1.body} 1
- Length Should Be ${tc2.body} 1
- Keyword Should Be Empty ${tc1.body[0]} Warning in test case
- Keyword Should Be Empty ${tc2.body[0]} No warning
+ Keyword Should Be Empty ${MY SUITE.setup} Warning in suite setup
+ Keyword Should Be Empty ${MY SUITE.teardown} Warning in suite teardown
+ Length Should Be ${tc1.body} 1
+ Keyword Should Be Empty ${tc1[0]} Warning in test case
+ Length Should Be ${tc2.body} 1
+ Keyword Should Be Empty ${tc2[0]} No warning
Logged Warnings Are Preserved In Execution Errors
Errors Are Removed In All Mode
${tc} = Check Test Case Error in test case
- Keyword Should Be Empty ${tc.body[0]} Error in test case
+ Keyword Should Be Empty ${tc[0]} Error in test case
Logged Errors Are Preserved In Execution Errors
IF/ELSE in All mode
${tc} = Check Test Case IF structure
- Length Should Be ${tc.body} 2
- Length Should Be ${tc.body[1].body} 3
- IF Branch Should Be Empty ${tc.body[1].body[0]} IF '\${x}' == 'wrong'
- IF Branch Should Be Empty ${tc.body[1].body[1]} ELSE IF '\${x}' == 'value'
- IF Branch Should Be Empty ${tc.body[1].body[2]} ELSE
+ Length Should Be ${tc.body} 2
+ Length Should Be ${tc[1].body} 3
+ IF Branch Should Be Empty ${tc[1, 0]} IF '\${x}' == 'wrong'
+ IF Branch Should Be Empty ${tc[1, 1]} ELSE IF '\${x}' == 'value'
+ IF Branch Should Be Empty ${tc[1, 2]} ELSE
FOR in All mode
- ${tc} = Check Test Case FOR
- Length Should Be ${tc.body} 1
- FOR Loop Should Be Empty ${tc.body[0]} IN
- ${tc} = Check Test Case FOR IN RANGE
- Length Should Be ${tc.body} 1
- FOR Loop Should Be Empty ${tc.body[0]} IN RANGE
+ ${tc1} = Check Test Case FOR
+ ${tc2} = Check Test Case FOR IN RANGE
+ Length Should Be ${tc1.body} 1
+ FOR Loop Should Be Empty ${tc1[0]} IN
+ Length Should Be ${tc2.body} 1
+ FOR Loop Should Be Empty ${tc2[0]} IN RANGE
TRY/EXCEPT in All mode
${tc} = Check Test Case Everything
- Length Should Be ${tc.body} 1
- Length Should Be ${tc.body[0].body} 5
- TRY Branch Should Be Empty ${tc.body[0].body[0]} TRY Ooops!
- TRY Branch Should Be Empty ${tc.body[0].body[1]} EXCEPT
- TRY Branch Should Be Empty ${tc.body[0].body[2]} EXCEPT
- TRY Branch Should Be Empty ${tc.body[0].body[3]} ELSE
- TRY Branch Should Be Empty ${tc.body[0].body[4]} FINALLY
+ Length Should Be ${tc.body} 1
+ Length Should Be ${tc[0].body} 5
+ TRY Branch Should Be Empty ${tc[0, 0]} TRY Ooops!
+ TRY Branch Should Be Empty ${tc[0, 1]} EXCEPT
+ TRY Branch Should Be Empty ${tc[0, 2]} EXCEPT
+ TRY Branch Should Be Empty ${tc[0, 3]} ELSE
+ TRY Branch Should Be Empty ${tc[0, 4]} FINALLY
WHILE and VAR in All mode
${tc} = Check Test Case WHILE loop executed multiple times
- Length Should Be ${tc.body} 2
- Should Be Equal ${tc.body[1].type} WHILE
- Should Be Empty ${tc.body[1].body}
- Should Be Equal ${tc.body[1].message} *HTML* ${DATA REMOVED}
+ Length Should Be ${tc.body} 2
+ Should Be Equal ${tc[1].type} WHILE
+ Should Be Empty ${tc[1].body}
+ Should Be Equal ${tc[1].message} *HTML* ${DATA REMOVED}
VAR in All mode
- ${tc} = Check Test Case IF structure
- Should Be Equal ${tc.body[0].type} VAR
- Should Be Empty ${tc.body[0].body}
- Should Be Equal ${tc.body[0].message} ${EMPTY}
- ${tc} = Check Test Case WHILE loop executed multiple times
- Should Be Equal ${tc.body[0].type} VAR
- Should Be Empty ${tc.body[0].body}
- Should Be Equal ${tc.body[0].message} ${EMPTY}
+ ${tc1} = Check Test Case IF structure
+ ${tc2} = Check Test Case WHILE loop executed multiple times
+ Should Be Equal ${tc1[0].type} VAR
+ Should Be Empty ${tc1[0].body}
+ Should Be Equal ${tc1[0].message} *HTML* ${DATA REMOVED}
+ Should Be Equal ${tc2[0].type} VAR
+ Should Be Empty ${tc2[0].body}
+ Should Be Equal ${tc2[0].message} *HTML* ${DATA REMOVED}
Passed Mode
[Setup] Run Rebot and set My Suite --removekeywords passed 0
- Keyword Should Not Be Empty ${MY SUITE.setup} My Keyword Suite Setup
${tc1} = Check Test Case Pass
${tc2} = Check Test Case Fail
- Length Should Be ${tc1.body} 1
- Keyword Should Be Empty ${tc1.body[0]} My Keyword Pass
- Keyword Should Contain Removal Message ${tc1.body[0]}
- Length Should Be ${tc2.body} 2
- Keyword Should Not Be Empty ${tc2.body[0]} My Keyword Fail
- Keyword Should Not Be Empty ${tc2.body[1]} BuiltIn.Fail Expected failure
${tc3} = Check Test Case Test with setup and teardown
- Keyword Should Be Empty ${tc3.setup} Test Setup
- Keyword Should Contain Removal Message ${tc3.setup}
- Keyword Should Be Empty ${tc3.teardown} Test Teardown
- Keyword Should Contain Removal Message ${tc3.teardown}
+ Keyword Should Not Be Empty ${MY SUITE.setup} My Keyword Suite Setup
+ Length Should Be ${tc1.body} 3
+ Keyword Should Be Empty ${tc1[0]} My Keyword Pass
+ Keyword Should Contain Removal Message ${tc1[0]}
+ Length Should Be ${tc2.body} 4
+ Check Log message ${tc2[0]} Hello 'Fail', says listener!
+ Keyword Should Not Be Empty ${tc2[1]} My Keyword Fail
+ Keyword Should Not Be Empty ${tc2[2]} BuiltIn.Fail Expected failure
+ Check Log message ${tc2[3]} Bye 'Fail', says listener!
+ Keyword Should Be Empty ${tc3.setup} Test Setup
+ Keyword Should Contain Removal Message ${tc3.setup}
+ Keyword Should Be Empty ${tc3.teardown} Test Teardown
+ Keyword Should Contain Removal Message ${tc3.teardown}
Warnings Are Not Removed In Passed Mode
[Setup] Verify previous test and set My Suite Passed Mode 1
- Keyword Should Not Be Empty ${MY SUITE.setup} Warning in suite setup
- Keyword Should Not Be Empty ${MY SUITE.teardown} Warning in suite teardown
${tc1} ${tc2}= Set Variable ${MY SUITE.tests[:2]}
- Length Should Be ${tc1.body} 1
- Keyword Should Not Be Empty ${tc1.body[0]} Warning in test case
- Keyword Should Not Be Empty ${tc1.body[0].body[0].body[0].body[0]} BuiltIn.Log Warning in \${where} WARN
- Length Should Be ${tc2.body} 1
- Keyword Should Be Empty ${tc2.body[0]} No warning
+ Keyword Should Not Be Empty ${MY SUITE.setup} Warning in suite setup
+ Keyword Should Not Be Empty ${MY SUITE.teardown} Warning in suite teardown
+ Length Should Be ${tc1.body} 3
+ Check Log message ${tc1[0]} Hello 'Warning in test case', says listener!
+ Keyword Should Not Be Empty ${tc1[1]} Warning in test case
+ Check Log message ${tc1[2]} Bye 'Warning in test case', says listener!
+ Keyword Should Not Be Empty ${tc1[1, 0, 0, 0]} BuiltIn.Log Warning in \${where} WARN
+ Length Should Be ${tc2.body} 1
+ Keyword Should Be Empty ${tc2[0]} No warning
Logged Warnings Are Preserved In Execution Errors
Errors Are Not Removed In Passed Mode
[Setup] Previous test should have passed Warnings Are Not Removed In Passed Mode
${tc} = Check Test Case Error in test case
- Check Log Message ${tc.body[0].body[0].msgs[0]} Logged errors supported since 2.9 ERROR
+ Length Should Be ${tc.body} 3
+ Check Log message ${tc[0]} Hello 'Error in test case', says listener!
+ Check Log Message ${tc[1, 0, 0]} Logged errors supported since 2.9 ERROR
+ Check Log message ${tc[2]} Bye 'Error in test case', says listener!
Logged Errors Are Preserved In Execution Errors
Name Mode
[Setup] Run Rebot and set My Suite
... --removekeywords name:BuiltIn.Fail --RemoveK NAME:??_KEYWORD --RemoveK NaMe:*WARN*IN* --removek name:errorin* 0
- Keyword Should Be Empty ${MY SUITE.setup} My Keyword Suite Setup
- Keyword Should Contain Removal Message ${MY SUITE.setup}
${tc1} = Check Test Case Pass
${tc2} = Check Test Case Fail
- Length Should Be ${tc1.body} 1
- Keyword Should Be Empty ${tc1.body[0]} My Keyword Pass
- Keyword Should Contain Removal Message ${tc1.body[0]}
- Length Should Be ${tc2.body} 2
- Keyword Should Be Empty ${tc2.body[0]} My Keyword Fail
- Keyword Should Contain Removal Message ${tc2.body[0]}
- Keyword Should Be Empty ${tc2.body[1]} BuiltIn.Fail Expected failure
- Keyword Should Contain Removal Message ${tc2.body[0]}
+ Keyword Should Be Empty ${MY SUITE.setup} My Keyword Suite Setup
+ Keyword Should Contain Removal Message ${MY SUITE.setup}
+ Length Should Be ${tc1.body} 5
+ Keyword Should Be Empty ${tc1[1]} My Keyword Pass
+ Keyword Should Contain Removal Message ${tc1[1]}
+ Length Should Be ${tc2.body} 4
+ Keyword Should Be Empty ${tc2[1]} My Keyword Fail
+ Keyword Should Contain Removal Message ${tc2[1]}
+ Keyword Should Be Empty ${tc2[2]} BuiltIn.Fail Expected failure
Warnings Are Not Removed In Name Mode
[Setup] Verify previous test and set My Suite Name Mode 1
- Keyword Should Not Be Empty ${MY SUITE.setup} Warning in suite setup
- Keyword Should Not Be Empty ${MY SUITE.teardown} Warning in suite teardown
${tc1} ${tc2}= Set Variable ${MY SUITE.tests[:2]}
- Length Should Be ${tc1.body} 1
- Length Should Be ${tc2.body} 1
- Keyword Should Not Be Empty ${tc1.body[0]} Warning in test case
- Keyword Should Not Be Empty ${tc1.body[0].body[0].body[0].body[0]} BuiltIn.Log Warning in \${where} WARN
- Keyword Should Be Empty ${tc2.body[0]} No warning
+ Keyword Should Not Be Empty ${MY SUITE.setup} Warning in suite setup
+ Keyword Should Not Be Empty ${MY SUITE.teardown} Warning in suite teardown
+ Length Should Be ${tc1.body} 3
+ Length Should Be ${tc2.body} 3
+ Keyword Should Not Be Empty ${tc1[1]} Warning in test case
+ Keyword Should Not Be Empty ${tc1[1, 0, 0, 0]} BuiltIn.Log Warning in \${where} WARN
+ Keyword Should Be Empty ${tc2[1]} No warning
Logged Warnings Are Preserved In Execution Errors
Errors Are Not Removed In Name Mode
[Setup] Previous test should have passed Warnings Are Not Removed In Name Mode
${tc} = Check Test Case Error in test case
- Check Log Message ${tc.body[0].body[0].msgs[0]} Logged errors supported since 2.9 ERROR
+ Check Log Message ${tc[1, 0, 0]} Logged errors supported since 2.9 ERROR
Logged Errors Are Preserved In Execution Errors
Tag Mode
[Setup] Run Rebot and set My Suite --removekeywords tag:force --RemoveK TAG:warn 0
- Keyword Should Be Empty ${MY SUITE.setup} My Keyword Suite Setup
- Keyword Should Contain Removal Message ${MY SUITE.setup}
${tc1} = Check Test Case Pass
${tc2} = Check Test Case Fail
- Length Should Be ${tc1.body} 1
- Keyword Should Be Empty ${tc1.body[0]} My Keyword Pass
- Keyword Should Contain Removal Message ${tc1.body[0]}
- Length Should Be ${tc2.body} 2
- Keyword Should Be Empty ${tc2.body[0]} My Keyword Fail
- Keyword Should Contain Removal Message ${tc2.body[0]}
- Keyword Should Not Be Empty ${tc2.body[1]} BuiltIn.Fail Expected failure
+ Keyword Should Be Empty ${MY SUITE.setup} My Keyword Suite Setup
+ Keyword Should Contain Removal Message ${MY SUITE.setup}
+ Length Should Be ${tc1.body} 5
+ Keyword Should Be Empty ${tc1[1]} My Keyword Pass
+ Keyword Should Contain Removal Message ${tc1[1]}
+ Length Should Be ${tc2.body} 4
+ Keyword Should Be Empty ${tc2[1]} My Keyword Fail
+ Keyword Should Contain Removal Message ${tc2[1]}
+ Keyword Should Not Be Empty ${tc2[2]} BuiltIn.Fail Expected failure
Warnings Are Not Removed In Tag Mode
[Setup] Verify previous test and set My Suite Tag Mode 1
- Keyword Should Not Be Empty ${MY SUITE.setup} Warning in suite setup
- Keyword Should Not Be Empty ${MY SUITE.teardown} Warning in suite teardown
${tc1} ${tc2}= Set Variable ${MY SUITE.tests[:2]}
- Length Should Be ${tc1.body} 1
- Length Should Be ${tc2.body} 1
- Keyword Should Not Be Empty ${tc1.body[0]} Warning in test case
- Keyword Should Not Be Empty ${tc1.body[0].body[0].body[0].body[0]} BuiltIn.Log Warning in \${where} WARN
- Keyword Should Be Empty ${tc2.body[0]} No warning
+ Keyword Should Not Be Empty ${MY SUITE.setup} Warning in suite setup
+ Keyword Should Not Be Empty ${MY SUITE.teardown} Warning in suite teardown
+ Length Should Be ${tc1.body} 3
+ Keyword Should Not Be Empty ${tc1[1]} Warning in test case
+ Keyword Should Not Be Empty ${tc1[1, 0, 0, 0]} BuiltIn.Log Warning in \${where} WARN
+ Length Should Be ${tc2.body} 3
+ Keyword Should Be Empty ${tc2[1]} No warning
Logged Warnings Are Preserved In Execution Errors
Errors Are Not Removed In Tag Mode
[Setup] Previous test should have passed Warnings Are Not Removed In Tag Mode
${tc} = Check Test Case Error in test case
- Check Log Message ${tc.body[0].body[0].msgs[0]} Logged errors supported since 2.9 ERROR
+ Check Log Message ${tc[1, 0, 0]} Logged errors supported since 2.9 ERROR
Logged Errors Are Preserved In Execution Errors
*** Keywords ***
Run Some Tests
- ${suites} = Catenate
+ VAR ${options}
+ ... --listener AddMessagesToTestBody
+ VAR ${suites}
... misc/pass_and_fail.robot
... misc/warnings_and_errors.robot
... misc/if_else.robot
@@ -192,7 +200,7 @@ Run Some Tests
... misc/try_except.robot
... misc/while.robot
... misc/setups_and_teardowns.robot
- Create Output With Robot ${INPUTFILE} ${EMPTY} ${suites}
+ Create Output With Robot ${INPUTFILE} ${options} ${suites}
Run Rebot And Set My Suite
[Arguments] ${rebot params} ${suite index}
diff --git a/atest/robot/cli/rebot/remove_keywords/for_loop_keywords.robot b/atest/robot/cli/rebot/remove_keywords/for_loop_keywords.robot
index 0655004a9b1..05bc9148bd2 100644
--- a/atest/robot/cli/rebot/remove_keywords/for_loop_keywords.robot
+++ b/atest/robot/cli/rebot/remove_keywords/for_loop_keywords.robot
@@ -12,50 +12,50 @@ ${4 REMOVED} 4 passing items removed using the --r
*** Test Cases ***
Passed Steps Are Removed Except The Last One
${tc}= Check Test Case Simple loop
- Length Should Be ${tc.kws[1].kws} 1
- Should Be Equal ${tc.kws[1].message} *HTML* ${1 REMOVED}
- Should Be Equal ${tc.kws[1].kws[0].status} PASS
+ Length Should Be ${tc[1].body} 1
+ Should Be Equal ${tc[1].message} *HTML* ${1 REMOVED}
+ Should Be Equal ${tc[1, 0].status} PASS
Failed Steps Are Not Removed
${tc}= Check Test Case Failure inside FOR 2
- Length Should Be ${tc.body[0].body} 1
- Should Be Equal ${tc.body[0].message} *HTML* Failure with <4>${3 REMOVED}
- Should Be Equal ${tc.body[0].body[0].type} ITERATION
- Should Be Equal ${tc.body[0].body[0].assign['\${num}']} 4
- Should Be Equal ${tc.body[0].body[0].status} FAIL
- Length Should Be ${tc.body[0].body[0].body} 3
- Should Be Equal ${tc.body[0].body[0].body[-1].status} NOT RUN
+ Length Should Be ${tc[0].body} 1
+ Should Be Equal ${tc[0].message} *HTML* Failure with <4>${3 REMOVED}
+ Should Be Equal ${tc[0, 0].type} ITERATION
+ Should Be Equal ${tc[0, 0].assign['\${num}']} 4
+ Should Be Equal ${tc[0, 0].status} FAIL
+ Length Should Be ${tc[0, 0].body} 3
+ Should Be Equal ${tc[0, 0, -1].status} NOT RUN
Steps With Warning Are Not Removed
${tc}= Check Test Case Variables in values
- Length Should Be ${tc.kws[0].kws} 2
- Should Be Equal ${tc.kws[0].message} *HTML* ${4 REMOVED}
- Check Log Message ${tc.kws[0].kws[0].kws[-1].kws[0].msgs[0]} Presidential Candidate! WARN
- Check Log Message ${tc.kws[0].kws[1].kws[-1].kws[0].msgs[0]} Presidential Candidate! WARN
+ Length Should Be ${tc[0].body} 2
+ Should Be Equal ${tc[0].message} *HTML* ${4 REMOVED}
+ Check Log Message ${tc[0, 0, -1, 0, 0]} Presidential Candidate! WARN
+ Check Log Message ${tc[0, 1, -1, 0, 0]} Presidential Candidate! WARN
Steps From Nested Loops Are Removed
${tc}= Check Test Case Nested Loop Syntax
- Length Should Be ${tc.kws[0].kws} 1
- Should Be Equal ${tc.kws[0].message} *HTML* ${2 REMOVED}
- Length Should Be ${tc.kws[0].kws[0].kws[1].kws} 1
- Should Be Equal ${tc.kws[0].kws[0].kws[1].message} *HTML* ${2 REMOVED}
+ Length Should Be ${tc[0].body} 1
+ Should Be Equal ${tc[0].message} *HTML* ${2 REMOVED}
+ Length Should Be ${tc[0, 0, 1].body} 1
+ Should Be Equal ${tc[0, 0, 1].message} *HTML* ${2 REMOVED}
Steps From Loops In Keywords From Loops Are Removed
${tc}= Check Test Case Keyword with loop calling other keywords with loops
- Length Should Be ${tc.kws[0].kws[0].kws} 1
- Should Be Equal ${tc.kws[0].kws[0].message} This ought to be enough
- Length Should Be ${tc.kws[0].kws[0].kws[0].kws[0].kws[1].kws} 1
- Should Be Equal ${tc.kws[0].kws[0].kws[0].kws[0].kws[1].message} *HTML* ${1 REMOVED}
- Length Should Be ${tc.kws[0].kws[0].kws[0].kws[1].kws[0].kws} 1
- Should Be Equal ${tc.kws[0].kws[0].kws[0].kws[1].kws[0].message} *HTML* ${1 REMOVED}
+ Length Should Be ${tc[0, 0].body} 1
+ Should Be Equal ${tc[0, 0].message} This ought to be enough
+ Length Should Be ${tc[0, 0, 0, 0, 1].body} 1
+ Should Be Equal ${tc[0, 0, 0, 0, 1].message} *HTML* ${1 REMOVED}
+ Length Should Be ${tc[0, 0, 0, 1, 0].body} 1
+ Should Be Equal ${tc[0, 0, 0, 1, 0].message} *HTML* ${1 REMOVED}
Empty Loops Are Handled Correctly
${tc}= Check Test Case Empty body
- Should Be Equal ${tc.body[0].status} FAIL
- Should Be Equal ${tc.body[0].message} FOR loop cannot be empty.
- Should Be Equal ${tc.body[0].body[0].type} ITERATION
- Should Be Equal ${tc.body[0].body[0].status} NOT RUN
- Should Be Empty ${tc.body[0].body[0].body}
+ Should Be Equal ${tc[0].status} FAIL
+ Should Be Equal ${tc[0].message} FOR loop cannot be empty.
+ Should Be Equal ${tc[0, 0].type} ITERATION
+ Should Be Equal ${tc[0, 0].status} NOT RUN
+ Should Be Empty ${tc[0, 0].body}
*** Keywords ***
Remove For Loop Keywords With Rebot
diff --git a/atest/robot/cli/rebot/remove_keywords/remove_keywords_resource.robot b/atest/robot/cli/rebot/remove_keywords/remove_keywords_resource.robot
index 079041f328a..f11bebb58fe 100644
--- a/atest/robot/cli/rebot/remove_keywords/remove_keywords_resource.robot
+++ b/atest/robot/cli/rebot/remove_keywords/remove_keywords_resource.robot
@@ -35,9 +35,7 @@ TRY Branch Should Be Empty
Keyword Should Not Be Empty
[Arguments] ${kw} ${name} @{args}
Check Keyword Name And Args ${kw} ${name} @{args}
- ${num_keywords}= Get Length ${kw.kws}
- ${num_messages}= Get Length ${kw.messages}
- Should Be True ${num_keywords} + ${num_messages} > 0
+ Should Not Be Empty ${kw.body}
Check Keyword Name And Args
[Arguments] ${kw} ${name} @{args}
diff --git a/atest/robot/cli/rebot/remove_keywords/wait_until_keyword_succeeds.robot b/atest/robot/cli/rebot/remove_keywords/wait_until_keyword_succeeds.robot
index b9dbc4cddcb..8bdec7783e2 100644
--- a/atest/robot/cli/rebot/remove_keywords/wait_until_keyword_succeeds.robot
+++ b/atest/robot/cli/rebot/remove_keywords/wait_until_keyword_succeeds.robot
@@ -8,21 +8,22 @@ Last failing Step is not removed
${expected} = Catenate
... [*]HTML[*] Keyword 'Fail' failed after retrying for 50 milliseconds.
... The last error was: Not gonna happen? failing item* removed using the --remove-keywords option.
- Should Match ${tc.body[0].message} ${expected}
+ Should Match ${tc[0].message} ${expected}
Last passing Step is not removed
${tc}= Check Number Of Keywords Passes before timeout 2
- Should Be Equal ${tc.body[0].message} *HTML* 1 failing item removed using the --remove-keywords option.
+ Should Be Equal ${tc[0].message} *HTML* 1 failing item removed using the --remove-keywords option.
Steps containing warnings are not removed
${tc}= Check Number Of Keywords Warnings 3
- Should be Equal ${tc.body[0].message} ${EMPTY}
+ Should be Equal ${tc[0].message} ${EMPTY}
Check Number Of Keywords One Warning 2
Nested Wait Until keywords are removed
${tc}= Check Test Case Nested
- Length Should Be ${tc.body[0].body.filter(messages=False)} 1
- Length Should Be ${tc.body[0].body[0].body} 1
+ Length Should Be ${tc[0].messages} 1
+ Length Should Be ${tc[0].non_messages} 1
+ Length Should Be ${tc[0, 0].body} 1
*** Keywords ***
Remove Wait Until Keyword Succeeds with Rebot
@@ -32,6 +33,5 @@ Remove Wait Until Keyword Succeeds with Rebot
Check Number Of Keywords
[Arguments] ${name} ${expected}
${tc}= Check Test Case ${name}
- Length Should Be ${tc.body[0].body.filter(messages=False)} ${expected}
+ Length Should Be ${tc[0].non_messages} ${expected}
RETURN ${tc}
-
diff --git a/atest/robot/cli/rebot/remove_keywords/while_loop_keywords.robot b/atest/robot/cli/rebot/remove_keywords/while_loop_keywords.robot
index ba03bd55e92..ea36561aef8 100644
--- a/atest/robot/cli/rebot/remove_keywords/while_loop_keywords.robot
+++ b/atest/robot/cli/rebot/remove_keywords/while_loop_keywords.robot
@@ -10,24 +10,24 @@ ${4 REMOVED} 4 passing items removed using the --r
*** Test Cases ***
Passed Steps Are Removed Except The Last One
${tc}= Check Test Case Loop executed multiple times
- Length Should Be ${tc.kws[0].kws} 1
- Should Be Equal ${tc.kws[0].message} *HTML* ${4 REMOVED}
- Should Be Equal ${tc.kws[0].kws[0].status} PASS
+ Length Should Be ${tc[0].body} 1
+ Should Be Equal ${tc[0].message} *HTML* ${4 REMOVED}
+ Should Be Equal ${tc[0, 0].status} PASS
Failed Steps Are Not Removed
${tc}= Check Test Case Execution fails after some loops
- Length Should Be ${tc.kws[0].kws} 1
- Should Be Equal ${tc.kws[0].message} *HTML* Oh no, got 4${2 REMOVED}
- Should Be Equal ${tc.kws[0].kws[0].status} FAIL
- Length Should Be ${tc.kws[0].kws[0].kws} 3
- Should Be Equal ${tc.kws[0].kws[0].kws[-1].status} NOT RUN
+ Length Should Be ${tc[0].body} 1
+ Should Be Equal ${tc[0].message} *HTML* Oh no, got 4${2 REMOVED}
+ Should Be Equal ${tc[0, 0].status} FAIL
+ Length Should Be ${tc[0, 0].body} 3
+ Should Be Equal ${tc[0, 0, -1].status} NOT RUN
Steps From Nested Loops Are Removed
${tc}= Check Test Case Loop in loop
- Length Should Be ${tc.kws[0].kws} 1
- Should Be Equal ${tc.kws[0].message} *HTML* ${4 REMOVED}
- Length Should Be ${tc.kws[0].kws[0].kws[2].kws} 1
- Should Be Equal ${tc.kws[0].kws[0].kws[2].message} *HTML* ${2 REMOVED}
+ Length Should Be ${tc[0].body} 1
+ Should Be Equal ${tc[0].message} *HTML* ${4 REMOVED}
+ Length Should Be ${tc[0, 0, 2].body} 1
+ Should Be Equal ${tc[0, 0, 2].message} *HTML* ${2 REMOVED}
*** Keywords ***
Remove WHILE Keywords With Rebot
diff --git a/atest/robot/cli/runner/ROBOT_OPTIONS.robot b/atest/robot/cli/runner/ROBOT_OPTIONS.robot
index 731d3c5a052..60a569aec2b 100644
--- a/atest/robot/cli/runner/ROBOT_OPTIONS.robot
+++ b/atest/robot/cli/runner/ROBOT_OPTIONS.robot
@@ -8,10 +8,10 @@ Use defaults
Run Tests ${EMPTY} misc/pass_and_fail.robot
Should Be Equal ${SUITE.name} Default
${tc} = Check Test Tags Pass force pass default with spaces
- Should Be Equal ${tc.kws[0].kws[0].status} NOT RUN
+ Should Be Equal ${tc[0, 0].status} NOT RUN
Override defaults
Run Tests -N Given -G given --nodryrun misc/pass_and_fail.robot
Should Be Equal ${SUITE.name} Given
${tc} = Check Test Tags Pass force pass default with spaces given
- Should Be Equal ${tc.kws[0].kws[0].status} PASS
+ Should Be Equal ${tc[0, 0].status} PASS
diff --git a/atest/robot/cli/runner/cli_resource.robot b/atest/robot/cli/runner/cli_resource.robot
index fa485a3ce69..9d060098af3 100644
--- a/atest/robot/cli/runner/cli_resource.robot
+++ b/atest/robot/cli/runner/cli_resource.robot
@@ -24,7 +24,7 @@ Output Directory Should Be Empty
Run Some Tests
[Arguments] ${options}=-l none -r none
- ${result} = Run Tests -d ${CLI OUTDIR} ${options} ${TEST FILE} default options= output=
+ ${result} = Run Tests -d ${CLI OUTDIR} ${options} ${TEST FILE} default options= output=None
Should Be Equal ${result.rc} ${0}
RETURN ${result}
@@ -37,7 +37,7 @@ Tests Should Pass Without Errors
Run Should Fail
[Arguments] ${options} ${error} ${regexp}=False
- ${result} = Run Tests ${options} default options= output=
+ ${result} = Run Tests ${options} default options= output=None
Should Be Equal As Integers ${result.rc} 252
Should Be Empty ${result.stdout}
IF ${regexp}
diff --git a/atest/robot/cli/runner/debugfile.robot b/atest/robot/cli/runner/debugfile.robot
index 838f573858b..7f5018948df 100644
--- a/atest/robot/cli/runner/debugfile.robot
+++ b/atest/robot/cli/runner/debugfile.robot
@@ -26,6 +26,10 @@ Debugfile
Stdout Should Match Regexp .*Debug: {3}${path}.*
Syslog Should Match Regexp .*Debug: ${path}.*
+Debug file messages are not delayed when timeouts are active
+ Run Tests -b debug.txt cli/runner/debugfile.robot
+ Check Test Case ${TEST NAME}
+
Debugfile Log Level Should Always Be Debug
[Documentation] --loglevel option should not affect what's written to debugfile
Run Tests Without Processing Output --outputdir ${CLI OUTDIR} -b debug.txt -o o.xml --loglevel WARN ${TESTFILE}
@@ -45,8 +49,8 @@ Debugfile timestamps are accurate
${tc} = Check Test Case LibraryAddsTimestampAsInteger
${content} = Get file ${CLI OUTDIR}/debug.txt
Debug file should contain ${content}
- ... ${tc.kws[0].msgs[0].timestamp} - INFO - Known timestamp
- ... ${tc.kws[0].msgs[1].timestamp} - INFO - Current
+ ... ${tc[0, 0].timestamp} - INFO - Known timestamp
+ ... ${tc[0, 1].timestamp} - INFO - Current
Writing Non-ASCII To Debugfile
[Documentation] Tests also that '.txt' is appended if no extension given
diff --git a/atest/robot/cli/runner/exit_on_failure.robot b/atest/robot/cli/runner/exit_on_failure.robot
index 885747676a9..c11932cfe3b 100644
--- a/atest/robot/cli/runner/exit_on_failure.robot
+++ b/atest/robot/cli/runner/exit_on_failure.robot
@@ -73,12 +73,12 @@ Suite setup fails
[Setup] Run Tests
... --ExitOnFail --variable SUITE_SETUP:Fail
... misc/setups_and_teardowns.robot misc/pass_and_fail.robot
- Test Should Not Have Been Run Test with setup and teardown
- Test Should Not Have Been Run Test with failing setup
- Test Should Not Have Been Run Test with failing teardown
- Test Should Not Have Been Run Failing test with failing teardown
- Test Should Not Have Been Run Pass
- Test Should Not Have Been Run Fail
+ Parent Setup Should Have Failed Test with setup and teardown
+ Test Should Not Have Been Run Test with failing setup
+ Test Should Not Have Been Run Test with failing teardown
+ Test Should Not Have Been Run Failing test with failing teardown
+ Test Should Not Have Been Run Pass
+ Test Should Not Have Been Run Fail
Suite teardown fails
[Setup] Run Tests
@@ -96,6 +96,11 @@ Failure set by listener can initiate exit-on-failure
Test Should Not Have Been Run Fail
*** Keywords ***
+Parent Setup Should Have Failed
+ [Arguments] ${name}
+ ${tc} = Check Test Case ${name} FAIL Parent suite setup failed:\nAssertionError
+ Should Not Contain ${tc.tags} robot:exit
+
Test Should Not Have Been Run
[Arguments] ${name}
${tc} = Check Test Case ${name} FAIL ${EXIT ON FAILURE}
diff --git a/atest/robot/cli/runner/exit_on_failure_with_skip_on_failure.robot b/atest/robot/cli/runner/exit_on_failure_with_skip_on_failure.robot
new file mode 100644
index 00000000000..44ccf986f97
--- /dev/null
+++ b/atest/robot/cli/runner/exit_on_failure_with_skip_on_failure.robot
@@ -0,0 +1,49 @@
+*** Settings ***
+Resource atest_resource.robot
+
+*** Test Cases ***
+Exit-on-failure is not initiated if test fails and skip-on-failure is active
+ Run Tests --exit-on-failure --skip-on-failure skip-on-failure --include skip-on-failure running/skip/skip.robot
+ Should Contain Tests ${SUITE}
+ ... Skipped with --SkipOnFailure
+ ... Skipped with --SkipOnFailure when failure in setup
+ ... Skipped with --SkipOnFailure when failure in teardown
+
+Exit-on-failure is not initiated if suite setup fails and skip-on-failure is active with all tests
+ Run Tests --exit-on-failure --skip-on-failure tag1 --variable SUITE_SETUP:Fail
+ ... misc/setups_and_teardowns.robot misc/pass_and_fail.robot misc/pass_and_fail.robot
+ VAR ${message}
+ ... Failed test skipped using 'tag1' tag.
+ ...
+ ... Original failure:
+ ... Parent suite setup failed:
+ ... AssertionError
+ ... separator=\n
+ Should Contain Tests ${SUITE.suites[0]}
+ ... Test with setup and teardown=SKIP:${message}
+ ... Test with failing setup=SKIP:${message}
+ ... Test with failing teardown=SKIP:${message}
+ ... Failing test with failing teardown=SKIP:${message}
+ Should Contain Tests ${SUITE.suites[1]}
+ ... Pass
+ ... Fail
+ Should Contain Tests ${SUITE.suites[2]}
+ ... Pass=FAIL:Failure occurred and exit-on-failure mode is in use.
+ ... Fail=FAIL:Failure occurred and exit-on-failure mode is in use.
+
+Exit-on-failure is initiated if suite setup fails and skip-on-failure is not active with all tests
+ Run Tests --exit-on-failure --skip-on-failure tag2 --variable SUITE_SETUP:Fail
+ ... misc/setups_and_teardowns.robot misc/pass_and_fail.robot
+ VAR ${prefix}
+ ... Failed test skipped using 'tag2' tag.
+ ...
+ ... Original failure:
+ ... separator=\n
+ Should Contain Tests ${SUITE.suites[0]}
+ ... Test with setup and teardown=SKIP:${prefix}\nParent suite setup failed:\nAssertionError
+ ... Test with failing setup=FAIL:Parent suite setup failed:\nAssertionError
+ ... Test with failing teardown=SKIP:${prefix}\nFailure occurred and exit-on-failure mode is in use.
+ ... Failing test with failing teardown=SKIP:${prefix}\nFailure occurred and exit-on-failure mode is in use.
+ Should Contain Tests ${SUITE.suites[1]}
+ ... Pass=FAIL:Failure occurred and exit-on-failure mode is in use.
+ ... Fail=FAIL:Failure occurred and exit-on-failure mode is in use.
diff --git a/atest/robot/cli/runner/invalid_usage.robot b/atest/robot/cli/runner/invalid_usage.robot
index 38e76f41c35..739b6ea9be9 100644
--- a/atest/robot/cli/runner/invalid_usage.robot
+++ b/atest/robot/cli/runner/invalid_usage.robot
@@ -46,8 +46,8 @@ Invalid --RemoveKeywords
Invalid --loglevel
--loglevel bad tests.robot
- ... Invalid value for option '--loglevel': Invalid level 'BAD'.
+ ... Invalid value for option '--loglevel': Invalid log level 'BAD'.
--loglevel INFO:INV tests.robot
- ... Invalid value for option '--loglevel': Invalid level 'INV'.
+ ... Invalid value for option '--loglevel': Invalid log level 'INV'.
-L INFO:DEBUG tests.robot
... Invalid value for option '--loglevel': Level in log 'DEBUG' is lower than execution level 'INFO'.
diff --git a/atest/robot/cli/runner/log_level.robot b/atest/robot/cli/runner/log_level.robot
index b6033bcc6d7..76531894932 100644
--- a/atest/robot/cli/runner/log_level.robot
+++ b/atest/robot/cli/runner/log_level.robot
@@ -1,71 +1,73 @@
*** Settings ***
-Documentation Tests for setting log level from command line with --loglevel option. Setting log level while executing tests (BuiltIn.Set Log Level) is tested with BuiltIn library keywords.
-Resource atest_resource.robot
+Documentation Tests for setting log level from command line with --loglevel option.
+... Setting log level while executing tests (BuiltIn.Set Log Level) is
+... tested with BuiltIn library keywords.
+Resource atest_resource.robot
*** Variables ***
-${TESTDATA} misc/pass_and_fail.robot
-${LOG NAME} logfile.html
+${TESTDATA} misc/pass_and_fail.robot
+${LOG NAME} logfile.html
*** Test Cases ***
No Log Level Given
[Documentation] Default level of INFO should be used
Run Tests ${EMPTY} ${TESTDATA}
- Check Log Message ${SUITE.tests[0].kws[0].kws[0].msgs[0]} Hello says "Pass"! INFO
- Should Be Empty ${SUITE.tests[0].kws[0].kws[1].messages}
- Check Log Message ${SUITE.tests[1].kws[1].msgs[0]} Expected failure FAIL
+ Check Log Message ${SUITE.tests[0][0, 0, 0]} Hello says "Pass"! INFO
+ Should Be Empty ${SUITE.tests[0][0, 1].messages}
+ Check Log Message ${SUITE.tests[1][1, 0]} Expected failure FAIL
Trace Level
- Run Tests --loglevel TRACE ${TESTDATA}
+ Run Tests --loglevel TRACE ${TESTDATA}
Should Log On Trace Level
Debug Level
- Run Tests --loglevel debug --log ${LOG NAME} ${TESTDATA}
+ Run Tests --loglevel debug --log ${LOG NAME} ${TESTDATA}
Should Log On Debug Level
Min level should be 'DEBUG' and default 'DEBUG'
Debug Level With Default Info
- Run Tests --loglevel dEBug:iNfo --log ${LOG NAME} ${TESTDATA}
+ Run Tests --loglevel dEBug:iNfo --log ${LOG NAME} ${TESTDATA}
Should Log On Debug Level
Min level should be 'DEBUG' and default 'INFO'
Trace Level With Default Debug
- Run Tests --loglevel trace:Debug --log ${LOG NAME} ${TESTDATA}
+ Run Tests --loglevel trace:Debug --log ${LOG NAME} ${TESTDATA}
Should Log On Trace Level
Min level should be 'TRACE' and default 'DEBUG'
Info Level
Run Tests -L InFo ${TESTDATA}
- Check Log Message ${SUITE.tests[0].kws[0].kws[0].msgs[0]} Hello says "Pass"! INFO
- Should Be Empty ${SUITE.tests[0].kws[0].kws[1].messages}
- Check Log Message ${SUITE.tests[1].kws[1].msgs[0]} Expected failure FAIL
+ Check Log Message ${SUITE.tests[0][0, 0, 0]} Hello says "Pass"! INFO
+ Should Be Empty ${SUITE.tests[0][0, 1].messages}
+ Check Log Message ${SUITE.tests[1][1, 0]} Expected failure FAIL
Warn Level
Run Tests --loglevel WARN --variable LEVEL1:WARN --variable LEVEL2:INFO ${TESTDATA}
- Check Log Message ${SUITE.tests[0].kws[0].kws[0].msgs[0]} Hello says "Pass"! WARN
- Should Be Empty ${SUITE.tests[0].kws[0].kws[1].messages}
- Check Log Message ${SUITE.tests[1].kws[1].msgs[0]} Expected failure FAIL
+ Check Log Message ${SUITE.tests[0][0, 0, 0]} Hello says "Pass"! WARN
+ Should Be Empty ${SUITE.tests[0][0, 1].messages}
+ Check Log Message ${SUITE.tests[1][1, 0]} Expected failure FAIL
Warnings Should Be Written To Syslog
- Should Be Equal ${PREV TEST NAME} Warn Level
- Check Log Message ${ERRORS.msgs[0]} Hello says "Suite Setup"! WARN
- Check Log Message ${ERRORS.msgs[1]} Hello says "Pass"! WARN
- Check Log Message ${ERRORS.msgs[2]} Hello says "Fail"! WARN
- Length Should Be ${ERRORS.msgs} 3
- Syslog Should Contain | WARN \ | Hello says "Suite Setup"!
- Syslog Should Contain | WARN \ | Hello says "Pass"!
- Syslog Should Contain | WARN \ | Hello says "Fail"!
+ Should Be Equal ${PREV TEST NAME} Warn Level
+ Check Log Message ${ERRORS[0]} Hello says "Suite Setup"! WARN
+ Check Log Message ${ERRORS[1]} Hello says "Pass"! WARN
+ Check Log Message ${ERRORS[2]} Hello says "Fail"! WARN
+ Length Should Be ${ERRORS.messages} 3
+ Syslog Should Contain | WARN \ | Hello says "Suite Setup"!
+ Syslog Should Contain | WARN \ | Hello says "Pass"!
+ Syslog Should Contain | WARN \ | Hello says "Fail"!
Error Level
Run Tests --loglevel ERROR --variable LEVEL1:ERROR --variable LEVEL2:WARN ${TESTDATA}
- Check Log Message ${SUITE.tests[0].kws[0].kws[0].msgs[0]} Hello says "Pass"! ERROR
- Should Be Empty ${SUITE.tests[0].kws[0].kws[1].messages}
- Check Log Message ${SUITE.tests[1].kws[1].msgs[0]} Expected failure FAIL
+ Check Log Message ${SUITE.tests[0][0, 0, 0]} Hello says "Pass"! ERROR
+ Should Be Empty ${SUITE.tests[0][0, 1].messages}
+ Check Log Message ${SUITE.tests[1][1, 0]} Expected failure FAIL
None Level
Run Tests --loglevel NONE --log ${LOG NAME} --variable LEVEL1:ERROR --variable LEVEL2:WARN ${TESTDATA}
- Should Be Empty ${SUITE.tests[0].kws[0].kws[0].messages}
- Should Be Empty ${SUITE.tests[0].kws[0].kws[1].messages}
- Should Be Empty ${SUITE.tests[1].kws[1].messages}
+ Should Be Empty ${SUITE.tests[0][0, 0].message}
+ Should Be Empty ${SUITE.tests[0][0, 1].messages}
+ Should Be Empty ${SUITE.tests[1][1].messages}
Min level should be 'NONE' and default 'NONE'
*** Keywords ***
@@ -75,14 +77,14 @@ Min level should be '${min}' and default '${default}'
Should contain ${log} "defaultLevel":"${default}"
Should Log On Debug Level
- Check Log Message ${SUITE.tests[0].kws[0].kws[0].msgs[0]} Hello says "Pass"! INFO
- Check Log Message ${SUITE.tests[0].kws[0].kws[1].msgs[0]} Debug message DEBUG
- Check Log Message ${SUITE.tests[1].kws[1].msgs[0]} Expected failure FAIL
+ Check Log Message ${SUITE.tests[0][0, 0, 0]} Hello says "Pass"! INFO
+ Check Log Message ${SUITE.tests[0][0, 1, 0]} Debug message DEBUG
+ Check Log Message ${SUITE.tests[1][1, 0]} Expected failure FAIL
Should Log On Trace Level
- Check Log Message ${SUITE.tests[0].kws[0].kws[0].msgs[0]} Arguments: [ 'Hello says "Pass"!' | 'INFO' ] TRACE
- Check Log Message ${SUITE.tests[0].kws[0].kws[0].msgs[1]} Hello says "Pass"! INFO
- Check Log Message ${SUITE.tests[0].kws[0].kws[0].msgs[2]} Return: None TRACE
- Check Log Message ${SUITE.tests[0].kws[0].kws[1].msgs[1]} Debug message DEBUG
- Check Log Message ${SUITE.tests[1].kws[1].msgs[0]} Arguments: [ 'Expected failure' ] TRACE
- Check Log Message ${SUITE.tests[1].kws[1].msgs[1]} Expected failure FAIL
+ Check Log Message ${SUITE.tests[0][0, 1, 0]} Arguments: [ 'Hello says "Pass"!' | 'INFO' ] TRACE
+ Check Log Message ${SUITE.tests[0][0, 1, 1]} Hello says "Pass"! INFO
+ Check Log Message ${SUITE.tests[0][0, 1, 2]} Return: None TRACE
+ Check Log Message ${SUITE.tests[0][0, 2, 1]} Debug message DEBUG
+ Check Log Message ${SUITE.tests[1][1, 0]} Arguments: [ 'Expected failure' ] TRACE
+ Check Log Message ${SUITE.tests[1][1, 1]} Expected failure FAIL
diff --git a/atest/robot/cli/runner/output_files.robot b/atest/robot/cli/runner/output_files.robot
index c62afc2ba52..00006f221ad 100644
--- a/atest/robot/cli/runner/output_files.robot
+++ b/atest/robot/cli/runner/output_files.robot
@@ -15,13 +15,17 @@ Output And Log
Run Tests Without Processing Output --outputdir ${CLI OUTDIR} --output myoutput.xml --report none --log mylog.html ${TESTFILE}
Output Directory Should Contain mylog.html myoutput.xml
-Disabling output XML only disables log with a warning
+Disabling only output file disables log with a warning
Run Tests Without Processing Output --outputdir ${CLI OUTDIR} -o nOnE -r report.html -l mylog.html ${TESTFILE}
+ Stdout Should Contain Output: \ NONE\nReport:
+ Stderr Should Match Regexp \\[ ERROR \\] Log file cannot be created if output.xml is disabled.
Output Directory Should Contain report.html
- Stderr Should Match Regexp \\[ ERROR \\] Log file cannot be created if output.xml is disabled.
All output files disabled
- Run Tests Without Processing Output --outputdir ${CLI OUTDIR} -o nOnE -r NONE -l none ${TESTFILE}
+ [Documentation] Turning colors on turns also hyperlinks on console and `NONE` cannot be linked.
+ Run Tests Without Processing Output --outputdir ${CLI OUTDIR} -o nOnE -r NONE -l none --console-colors ON ${TESTFILE}
+ Stdout Should Contain Output: \ NONE\n
+ Stderr Should Be Empty
Output Directory Should Be Empty
Debug, Xunit And Report File Can Be Created When Output Is NONE
diff --git a/atest/robot/cli/runner/remove_keywords.robot b/atest/robot/cli/runner/remove_keywords.robot
index 1576131a8d7..05d1dca3f6a 100644
--- a/atest/robot/cli/runner/remove_keywords.robot
+++ b/atest/robot/cli/runner/remove_keywords.robot
@@ -3,65 +3,67 @@ Suite Setup Run Tests And Remove Keywords
Resource atest_resource.robot
*** Variables ***
-${PASS MESSAGE} -PASSED -ALL
-${FAIL MESSAGE} -ALL +PASSED
-${REMOVED FOR MESSAGE} -FOR -ALL
-${KEPT FOR MESSAGE} +FOR -ALL
-${REMOVED WHILE MESSAGE} -WHILE -ALL
-${KEPT WHILE MESSAGE} +WHILE -ALL
-${REMOVED WUKS MESSAGE} -WUKS -ALL
-${KEPT WUKS MESSAGE} +WUKS -ALL
-${REMOVED BY NAME MESSAGE} -BYNAME -ALL
-${KEPT BY NAME MESSAGE} +BYNAME -ALL
+${PASS MESSAGE} -PASSED -ALL
+${FAIL MESSAGE} -ALL +PASSED
+${REMOVED FOR MESSAGE} -FOR -ALL
+${KEPT FOR MESSAGE} +FOR -ALL
+${REMOVED WHILE MESSAGE} -WHILE -ALL
+${KEPT WHILE MESSAGE} +WHILE -ALL
+${REMOVED WUKS MESSAGE} -WUKS -ALL
+${KEPT WUKS MESSAGE} +WUKS -ALL
+${REMOVED BY NAME MESSAGE} -BYNAME -ALL
+${KEPT BY NAME MESSAGE} +BYNAME -ALL
${REMOVED BY PATTERN MESSAGE} -BYPATTERN -ALL
-${KEPT BY PATTERN MESSAGE} +BYPATTERN -ALL
+${KEPT BY PATTERN MESSAGE} +BYPATTERN -ALL
*** Test Cases ***
PASSED option when test passes
Log should not contain ${PASS MESSAGE}
Output should contain pass message
+ Messages from body are removed Passing
PASSED option when test fails
- Log should contain ${FAIL MESSAGE}
+ Log should contain ${FAIL MESSAGE}
Output should contain fail message
+ Messages from body are not removed Failing
FOR option
Log should not contain ${REMOVED FOR MESSAGE}
- Log should contain ${KEPT FOR MESSAGE}
+ Log should contain ${KEPT FOR MESSAGE}
Output should contain for messages
WHILE option
Log should not contain ${REMOVED WHILE MESSAGE}
- Log should contain ${KEPT WHILE MESSAGE}
+ Log should contain ${KEPT WHILE MESSAGE}
Output should contain while messages
WUKS option
Log should not contain ${REMOVED WUKS MESSAGE}
- Log should contain ${KEPT WUKS MESSAGE}
+ Log should contain ${KEPT WUKS MESSAGE}
Output should contain WUKS messages
NAME option
Log should not contain ${REMOVED BY NAME MESSAGE}
- Log should contain ${KEPT BY NAME MESSAGE}
+ Log should contain ${KEPT BY NAME MESSAGE}
Output should contain NAME messages
NAME option with pattern
Log should not contain ${REMOVED BY PATTERN MESSAGE}
- Log should contain ${KEPT BY PATTERN MESSAGE}
+ Log should contain ${KEPT BY PATTERN MESSAGE}
Output should contain NAME messages with patterns
TAGged keywords
- Log should contain This is not removed by TAG
+ Log should contain This is not removed by TAG
Log should not contain This is removed by TAG
Warnings and errors are preserved
+ Log should contain Keywords with warnings are not removed
+ Log should contain Keywords with errors are not removed
Output should contain warning and error
- Log should contain Keywords with warnings are not removed
- Log should contain Keywords with errors are not removed
*** Keywords ***
Run tests and remove keywords
- ${opts} = Catenate
+ VAR ${opts}
... --removekeywords passed
... --RemoveKeywords FoR
... --RemoveKeywords whiLE
@@ -70,10 +72,11 @@ Run tests and remove keywords
... --removekeywords name:Thisshouldbe*
... --removekeywords name:Remove???
... --removekeywords tag:removeANDkitty
+ ... --listener AddMessagesToTestBody
... --log log.html
Run tests ${opts} cli/remove_keywords/all_combinations.robot
- ${LOG} = Get file ${OUTDIR}/log.html
- Set suite variable $LOG
+ ${log} = Get file ${OUTDIR}/log.html
+ VAR ${LOG} ${log} scope=SUITE
Log should not contain
[Arguments] ${msg}
@@ -83,13 +86,23 @@ Log should contain
[Arguments] ${msg}
Should contain ${LOG} ${msg}
+Messages from body are removed
+ [Arguments] ${name}
+ Log should not contain Hello '${name}', says listener!
+ Log should not contain Bye '${name}', says listener!
+
+Messages from body are not removed
+ [Arguments] ${name}
+ Log should contain Hello '${name}', says listener!
+ Log should contain Bye '${name}', says listener!
+
Output should contain pass message
${tc} = Check test case Passing
- Check Log Message ${tc.kws[0].msgs[0]} ${PASS MESSAGE}
+ Check Log Message ${tc[1, 0]} ${PASS MESSAGE}
Output should contain fail message
${tc} = Check test case Failing
- Check Log Message ${tc.kws[0].msgs[0]} ${FAIL MESSAGE}
+ Check Log Message ${tc[1, 0]} ${FAIL MESSAGE}
Output should contain for messages
Test should contain for messages FOR when test passes
@@ -98,11 +111,10 @@ Output should contain for messages
Test should contain for messages
[Arguments] ${name}
${tc} = Check test case ${name}
- ${for} = Set Variable ${tc.kws[0].kws[0]}
- Check log message ${for.body[0].body[0].body[1].body[0].body[0]} ${REMOVED FOR MESSAGE} one
- Check log message ${for.body[1].body[0].body[1].body[0].body[0]} ${REMOVED FOR MESSAGE} two
- Check log message ${for.body[2].body[0].body[1].body[0].body[0]} ${REMOVED FOR MESSAGE} three
- Check log message ${for.body[3].body[0].body[0].body[0].body[0]} ${KEPT FOR MESSAGE} LAST
+ Check log message ${tc[1, 0, 0, 0, 1, 0, 0]} ${REMOVED FOR MESSAGE} one
+ Check log message ${tc[1, 0, 1, 0, 1, 0, 0]} ${REMOVED FOR MESSAGE} two
+ Check log message ${tc[1, 0, 2, 0, 1, 0, 0]} ${REMOVED FOR MESSAGE} three
+ Check log message ${tc[1, 0, 3, 0, 0, 0, 0]} ${KEPT FOR MESSAGE} LAST
Output should contain while messages
Test should contain while messages WHILE when test passes
@@ -111,11 +123,10 @@ Output should contain while messages
Test should contain while messages
[Arguments] ${name}
${tc} = Check test case ${name}
- ${while} = Set Variable ${tc.kws[0].kws[1]}
- Check log message ${while.body[0].body[0].body[1].body[0].body[0]} ${REMOVED WHILE MESSAGE} 1
- Check log message ${while.body[1].body[0].body[1].body[0].body[0]} ${REMOVED WHILE MESSAGE} 2
- Check log message ${while.body[2].body[0].body[1].body[0].body[0]} ${REMOVED WHILE MESSAGE} 3
- Check log message ${while.body[3].body[0].body[0].body[0].body[0]} ${KEPT WHILE MESSAGE} 4
+ Check log message ${tc[1, 1, 0, 0, 1, 0, 0]} ${REMOVED WHILE MESSAGE} 1
+ Check log message ${tc[1, 1, 1, 0, 1, 0, 0]} ${REMOVED WHILE MESSAGE} 2
+ Check log message ${tc[1, 1, 2, 0, 1, 0, 0]} ${REMOVED WHILE MESSAGE} 3
+ Check log message ${tc[1, 1, 3, 0, 0, 0, 0]} ${KEPT WHILE MESSAGE} 4
Output should contain WUKS messages
Test should contain WUKS messages WUKS when test passes
@@ -124,9 +135,9 @@ Output should contain WUKS messages
Test should contain WUKS messages
[Arguments] ${name}
${tc} = Check test case ${name}
- Check log message ${tc.kws[0].kws[0].kws[1].kws[0].msgs[0]} ${REMOVED WUKS MESSAGE} FAIL
- Check log message ${tc.kws[0].kws[8].kws[1].kws[0].msgs[0]} ${REMOVED WUKS MESSAGE} FAIL
- Check log message ${tc.kws[0].kws[9].kws[2].kws[0].msgs[0]} ${KEPT WUKS MESSAGE} FAIL
+ Check log message ${tc[1, 0, 1, 0, 0]} ${REMOVED WUKS MESSAGE} FAIL
+ Check log message ${tc[1, 8, 1, 0, 0]} ${REMOVED WUKS MESSAGE} FAIL
+ Check log message ${tc[1, 9, 2, 0, 0]} ${KEPT WUKS MESSAGE} FAIL
Output should contain NAME messages
Test should contain NAME messages NAME when test passes
@@ -135,10 +146,10 @@ Output should contain NAME messages
Test should contain NAME messages
[Arguments] ${name}
${tc}= Check test case ${name}
- Check log message ${tc.kws[0].kws[0].msgs[0]} ${REMOVED BY NAME MESSAGE}
- Check log message ${tc.kws[1].kws[0].msgs[0]} ${REMOVED BY NAME MESSAGE}
- Check log message ${tc.kws[2].kws[0].kws[0].msgs[0]} ${REMOVED BY NAME MESSAGE}
- Check log message ${tc.kws[2].kws[1].msgs[0]} ${KEPT BY NAME MESSAGE}
+ Check log message ${tc[1, 0, 0]} ${REMOVED BY NAME MESSAGE}
+ Check log message ${tc[2, 0, 0]} ${REMOVED BY NAME MESSAGE}
+ Check log message ${tc[3, 0, 0, 0]} ${REMOVED BY NAME MESSAGE}
+ Check log message ${tc[3, 1, 0]} ${KEPT BY NAME MESSAGE}
Output should contain NAME messages with patterns
Test should contain NAME messages with * pattern NAME with * pattern when test passes
@@ -149,20 +160,20 @@ Output should contain NAME messages with patterns
Test should contain NAME messages with * pattern
[Arguments] ${name}
${tc}= Check test case ${name}
- Check log message ${tc.kws[0].kws[0].msgs[0]} ${REMOVED BY PATTERN MESSAGE}
- Check log message ${tc.kws[1].kws[0].msgs[0]} ${REMOVED BY PATTERN MESSAGE}
- Check log message ${tc.kws[2].kws[0].msgs[0]} ${REMOVED BY PATTERN MESSAGE}
- Check log message ${tc.kws[3].kws[0].kws[0].msgs[0]} ${REMOVED BY PATTERN MESSAGE}
- Check log message ${tc.kws[3].kws[1].msgs[0]} ${KEPT BY PATTERN MESSAGE}
+ Check log message ${tc[1, 0, 0]} ${REMOVED BY PATTERN MESSAGE}
+ Check log message ${tc[2, 0, 0]} ${REMOVED BY PATTERN MESSAGE}
+ Check log message ${tc[3, 0, 0]} ${REMOVED BY PATTERN MESSAGE}
+ Check log message ${tc[4, 0, 0, 0]} ${REMOVED BY PATTERN MESSAGE}
+ Check log message ${tc[4, 1, 0]} ${KEPT BY PATTERN MESSAGE}
Test should contain NAME messages with ? pattern
[Arguments] ${name}
${tc}= Check test case ${name}
- Check log message ${tc.kws[0].kws[0].msgs[0]} ${REMOVED BY PATTERN MESSAGE}
- Check log message ${tc.kws[1].kws[0].kws[0].msgs[0]} ${REMOVED BY PATTERN MESSAGE}
- Check log message ${tc.kws[1].kws[1].msgs[0]} ${KEPT BY PATTERN MESSAGE}
+ Check log message ${tc[1, 0, 0]} ${REMOVED BY PATTERN MESSAGE}
+ Check log message ${tc[2, 0, 0, 0]} ${REMOVED BY PATTERN MESSAGE}
+ Check log message ${tc[2, 1, 0]} ${KEPT BY PATTERN MESSAGE}
Output should contain warning and error
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} Keywords with warnings are not removed WARN
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} Keywords with errors are not removed ERROR
+ Check Log Message ${tc[1, 0, 0, 0]} Keywords with warnings are not removed WARN
+ Check Log Message ${tc[2, 0, 0]} Keywords with errors are not removed ERROR
diff --git a/atest/robot/cli/runner/rerunfailed.robot b/atest/robot/cli/runner/rerunfailed.robot
index adacf4a0d7b..68d263d8d34 100644
--- a/atest/robot/cli/runner/rerunfailed.robot
+++ b/atest/robot/cli/runner/rerunfailed.robot
@@ -49,7 +49,7 @@ Suite initialization
Run Tests ${EMPTY} ${SUITE DIR}
Copy File ${OUTFILE} ${RUN FAILED FROM}
Copy File ${ORIG DIR}/runfailed2.robot ${SUITE DIR}/runfailed.robot
- Run Tests --rerunfailed ${RUN FAILED FROM} --test Selected --exclude excluded_tag ${SUITE DIR}
+ Run Tests --rerunfailed ${RUN FAILED FROM} --test Selected --include common --exclude excluded_tag ${SUITE DIR}
Test Should Have Been Executed
[Arguments] ${name}
diff --git a/atest/robot/core/binary_data.robot b/atest/robot/core/binary_data.robot
index e3372e88519..f6c70ccc3bb 100644
--- a/atest/robot/core/binary_data.robot
+++ b/atest/robot/core/binary_data.robot
@@ -28,13 +28,13 @@ Print Bytes
... 116 t
... 123 {
... 127 \x7f
- Check Log Message ${tc.kws[0].msgs[${index}]} Byte ${index}: '${exp}'
+ Check Log Message ${tc[0, ${index}]} Byte ${index}: '${exp}'
END
# Check that all bytes were really written without errors.
FOR ${index} IN RANGE 256
- Should Start With ${tc.kws[0].msgs[${index}].message} Byte ${index}:
+ Should Start With ${tc[0, ${index}].message} Byte ${index}:
END
- Check Log Message ${tc.kws[0].msgs[-1]} All bytes printed successfully
+ Check Log Message ${tc[0, -1]} All bytes printed successfully
Byte Error
[Documentation] Check an exception containing control chars is handled ok
@@ -46,7 +46,7 @@ Byte Error In Setup And Teardown
Binary Data
[Documentation] Make sure even totally binary data doesn't break anything
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[1]} Binary data printed successfully
+ Check Log Message ${tc[0, 1]} Binary data printed successfully
*** Keywords ***
My Run Tests
diff --git a/atest/robot/core/filter_by_names.robot b/atest/robot/core/filter_by_names.robot
index a85d64e3876..221f274127c 100644
--- a/atest/robot/core/filter_by_names.robot
+++ b/atest/robot/core/filter_by_names.robot
@@ -17,16 +17,10 @@ ${SUITE DIR} misc/suites
Run And Check Tests --test *one --test Fi?st First Second One Third One
Run And Check Tests --test [Great]Lob[sterB]estCase[!3-9] GlobTestCase1 GlobTestCase2
---test is cumulative with --include
- Run And Check Tests --test fifth --include t1 First Fifth
-
---exclude wins ovet --test
- Run And Check Tests --test fi* --exclude t1 Fifth
-
--test not matching
Run Failing Test
... Suite 'Many Tests' contains no tests matching name 'notexists'.
- ... --test notexists ${SUITE FILE}
+ ... --test notexists
--test not matching with multiple inputs
Run Failing Test
@@ -36,6 +30,18 @@ ${SUITE DIR} misc/suites
... Suite 'My Name' contains no tests matching name 'notexists'.
... --name "My Name" --test notexists ${SUITE FILE} ${SUITE DIR}
+--test and --include must both match
+ Run And Check Tests --test first --include t1 -i f1 First
+ Run Failing Test
+ ... Suite 'Many Tests' contains no tests matching name 'fifth' and matching tag 't1'.
+ ... --test fifth --include t1
+
+--exclude wins over --test
+ Run And Check Tests --test fi* --exclude t1 Fifth
+ Run Failing Test
+ ... Suite 'Many Tests' contains no tests matching name 'first' and not matching tag 'f1'.
+ ... --test first --exclude f1
+
--suite once
Run Suites --suite tsuite1
Should Contain Suites ${SUITE} TSuite1
@@ -60,7 +66,7 @@ ${SUITE DIR} misc/suites
Parent suite init files are processed
Previous Test Should Have Passed --suite with patterns
Should Be True ${SUITE.teardown}
- Check log message ${SUITE.teardown.msgs[0]} Default suite teardown
+ Check log message ${SUITE.teardown[0]} Default suite teardown
--suite matching directory
Run Suites --suite sub?uit[efg]s
@@ -131,7 +137,7 @@ Parent suite init files are processed
Should Contain Tests ${SUITE} Suite1 First Suite3 First
--suite, --test, --include and --exclude
- Run Suites --suite sub* --suite "custom name *" --test *first -s nomatch -t nomatch --include sub3 --exclude t1
+ Run Suites --suite sub* --suite "custom name *" --test "subsuite3 second" -t *first -s nomatch -t nomatch --include f1 --exclude t1
Should Contain Suites ${SUITE} Custom name for 📂 'subsuites2' Subsuites
Should Contain Tests ${SUITE} SubSuite2 First SubSuite3 Second
@@ -162,6 +168,6 @@ Run Suites
Stderr Should Be Empty
Run Failing Test
- [Arguments] ${error} ${options} ${sources}
+ [Arguments] ${error} ${options} ${sources}=${SUITE FILE}
Run Tests Without Processing Output ${options} ${sources}
Stderr Should Be Equal To [ ERROR ] ${error}${USAGE TIP}\n
diff --git a/atest/robot/core/keyword_setup.robot b/atest/robot/core/keyword_setup.robot
index f7ba4f05495..1f8f91963f4 100644
--- a/atest/robot/core/keyword_setup.robot
+++ b/atest/robot/core/keyword_setup.robot
@@ -5,42 +5,42 @@ Resource atest_resource.robot
*** Test Cases ***
Passing setup
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].setup.msgs[0]} Hello, setup!
+ Check Log Message ${tc[0].setup[0]} Hello, setup!
Failing setup
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].setup.msgs[0]} Hello, setup! FAIL
- Should Be Equal ${tc.body[0].body[0].status} NOT RUN
+ Check Log Message ${tc[0].setup[0]} Hello, setup! FAIL
+ Should Be Equal ${tc[0, 0].status} NOT RUN
Failing setup and passing teardown
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.setup.setup.msgs[0]} Hello, setup! FAIL
- Should Be Equal ${tc.setup.body[0].status} NOT RUN
- Check Log Message ${tc.setup.teardown.msgs[0]} Hello, teardown! INFO
+ Check Log Message ${tc.setup.setup[0]} Hello, setup! FAIL
+ Should Be Equal ${tc.setup[0].status} NOT RUN
+ Check Log Message ${tc.setup.teardown[0]} Hello, teardown! INFO
Failing setup and teardown
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].setup.msgs[0]} Hello, setup! FAIL
- Should Be Equal ${tc.body[0].body[0].status} NOT RUN
- Check Log Message ${tc.body[0].teardown.msgs[0]} Hello, teardown! FAIL
+ Check Log Message ${tc[0].setup[0]} Hello, setup! FAIL
+ Should Be Equal ${tc[0, 0].status} NOT RUN
+ Check Log Message ${tc[0].teardown[0]} Hello, teardown! FAIL
Continue-on-failure mode is not enabled in setup
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.setup.setup.body[0].msgs[0]} Hello, setup! INFO
- Check Log Message ${tc.setup.setup.body[1].msgs[0]} Hello again, setup! FAIL
- Should Be Equal ${tc.setup.setup.body[2].status} NOT RUN
+ Check Log Message ${tc.setup.setup[0, 0]} Hello, setup! INFO
+ Check Log Message ${tc.setup.setup[1, 0]} Hello again, setup! FAIL
+ Should Be Equal ${tc.setup.setup[2].status} NOT RUN
NONE is same as no setup
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].setup.name} ${None}
+ Should Be Equal ${tc[0].setup.name} ${None}
Empty [Setup] is same as no setup
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].setup.name} ${None}
+ Should Be Equal ${tc[0].setup.name} ${None}
Using variable
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].setup.name} Log
- Should Be Equal ${tc.body[1].setup.name} ${None}
- Should Be Equal ${tc.body[2].setup.name} ${None}
- Should Be Equal ${tc.body[3].setup.name} Fail
+ Should Be Equal ${tc[0].setup.name} Log
+ Should Be Equal ${tc[1].setup.name} ${None}
+ Should Be Equal ${tc[2].setup.name} ${None}
+ Should Be Equal ${tc[3].setup.name} Fail
diff --git a/atest/robot/core/keyword_teardown.robot b/atest/robot/core/keyword_teardown.robot
index 4c0506c3ef1..d15cfe8bb28 100644
--- a/atest/robot/core/keyword_teardown.robot
+++ b/atest/robot/core/keyword_teardown.robot
@@ -1,67 +1,67 @@
*** Settings ***
-Resource atest_resource.robot
-Suite Setup Run Tests ${EMPTY} core/keyword_teardown.robot
+Resource atest_resource.robot
+Suite Setup Run Tests ${EMPTY} core/keyword_teardown.robot
*** Test Cases ***
Passing Keyword with Teardown
- ${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} In UK
- Check Log Message ${tc.kws[0].teardown.msgs[0]} In UK Teardown
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0, 0]} In UK
+ Check Log Message ${tc[0].teardown[0]} In UK Teardown
Failing Keyword with Teardown
- ${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} Expected Failure! FAIL
- Check Log Message ${tc.kws[0].teardown.msgs[0]} In Failing UK Teardown
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0, 0]} Expected Failure! FAIL
+ Check Log Message ${tc[0].teardown[0]} In Failing UK Teardown
Teardown in keyword with embedded arguments
- ${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} In UK with Embedded Arguments
- Check Log Message ${tc.kws[0].teardown.msgs[0]} In Teardown of UK with Embedded Arguments
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} Expected Failure in UK with Embedded Arguments FAIL
- Check Log Message ${tc.kws[1].teardown.msgs[0]} In Teardown of Failing UK with Embedded Arguments
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0, 0]} In UK with Embedded Arguments
+ Check Log Message ${tc[0].teardown[0]} In Teardown of UK with Embedded Arguments
+ Check Log Message ${tc[1, 0, 0]} Expected Failure in UK with Embedded Arguments FAIL
+ Check Log Message ${tc[1].teardown[0]} In Teardown of Failing UK with Embedded Arguments
Failure in Keyword Teardown
- ${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} In UK
- Check Log Message ${tc.kws[0].teardown.msgs[0]} Failing in UK Teardown FAIL
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0, 0]} In UK
+ Check Log Message ${tc[0].teardown[0]} Failing in UK Teardown FAIL
Failures in Keyword and Teardown
- ${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} Expected Failure! FAIL
- Check Log Message ${tc.kws[0].teardown.msgs[0]} Failing in UK Teardown FAIL
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0, 0]} Expected Failure! FAIL
+ Check Log Message ${tc[0].teardown[0]} Failing in UK Teardown FAIL
Multiple Failures in Keyword Teardown
- ${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].teardown.kws[0].msgs[0]} Failure in Teardown FAIL
- Check Log Message ${tc.kws[0].teardown.kws[1].kws[0].msgs[0]} Expected Failure! FAIL
- Check Log Message ${tc.kws[0].teardown.kws[1].kws[1].msgs[0]} Executed if in nested Teardown
- Check Log Message ${tc.kws[0].teardown.kws[2].msgs[0]} Third failure in Teardown FAIL
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0].teardown[0, 0]} Failure in Teardown FAIL
+ Check Log Message ${tc[0].teardown[1, 0, 0]} Expected Failure! FAIL
+ Check Log Message ${tc[0].teardown[1, 1, 0]} Executed if in nested Teardown
+ Check Log Message ${tc[0].teardown[2, 0]} Third failure in Teardown FAIL
Nested Keyword Teardowns
- ${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} In UK
- Check Log Message ${tc.kws[0].kws[0].teardown.msgs[0]} In UK Teardown
- Check Log Message ${tc.kws[0].teardown.kws[0].msgs[0]} In UK
- Check Log Message ${tc.kws[0].teardown.teardown.msgs[0]} In UK Teardown
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0, 0, 0]} In UK
+ Check Log Message ${tc[0, 0].teardown[0]} In UK Teardown
+ Check Log Message ${tc[0].teardown[0, 0]} In UK
+ Check Log Message ${tc[0].teardown.teardown[0]} In UK Teardown
Nested Keyword Teardown Failures
- ${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].teardown.msgs[0]} Failing in UK Teardown FAIL
- Check Log Message ${tc.kws[0].teardown.msgs[0]} Failing in outer UK Teardown FAIL
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0].teardown[0]} Failing in UK Teardown FAIL
+ Check Log Message ${tc[0].teardown[0]} Failing in outer UK Teardown FAIL
Continuable Failure in Keyword
- ${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} Please continue FAIL
- Check Log Message ${tc.kws[0].kws[1].msgs[0]} After continuable failure
- Check Log Message ${tc.kws[0].teardown.msgs[0]} In UK Teardown
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0, 0, 0]} Please continue FAIL
+ Check Log Message ${tc[0, 1, 0]} After continuable failure
+ Check Log Message ${tc[0].teardown[0]} In UK Teardown
Non-ASCII Failure in Keyword Teardown
- ${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} åäö
- Check Log Message ${tc.kws[0].teardown.msgs[0]} Hyvää äitienpäivää! FAIL
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0, 0]} åäö
+ Check Log Message ${tc[0].teardown[0]} Hyvää äitienpäivää! FAIL
Keyword cannot have only teardown
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Replacing Variables in Keyword Teardown Fails
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME}
diff --git a/atest/robot/core/non_ascii.robot b/atest/robot/core/non_ascii.robot
index 0d59f975c0b..732acc79e9b 100644
--- a/atest/robot/core/non_ascii.robot
+++ b/atest/robot/core/non_ascii.robot
@@ -6,41 +6,41 @@ Variables unicode_vars.py
*** Test Cases ***
Non-ASCII Log Messages
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} ${MESSAGE1}
- Check Log Message ${tc.kws[0].msgs[1]} ${MESSAGE2}
- Check Log Message ${tc.kws[0].msgs[2]} ${MESSAGE3}
+ Check Log Message ${tc[0, 0]} ${MESSAGE1}
+ Check Log Message ${tc[0, 1]} ${MESSAGE2}
+ Check Log Message ${tc[0, 2]} ${MESSAGE3}
Non-ASCII Return Value
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[2].msgs[0]} Français
+ Check Log Message ${tc[2, 0]} Français
Non-ASCII In Return Value Attributes
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} ${MESSAGES}
- Check Log Message ${tc.kws[0].msgs[1]} \${obj} = ${MESSAGES}
- Check Log Message ${tc.kws[1].msgs[0]} ${MESSAGES}
+ Check Log Message ${tc[0, 0]} ${MESSAGES}
+ Check Log Message ${tc[0, 1]} \${obj} = ${MESSAGES}
+ Check Log Message ${tc[1, 0]} ${MESSAGES}
Non-ASCII Failure
${tc} = Check Test Case ${TESTNAME} FAIL ${MESSAGES}
- Check Log Message ${tc.kws[0].msgs[0]} ${MESSAGES} FAIL
+ Check Log Message ${tc[0, 0]} ${MESSAGES} FAIL
Non-ASCII Failure In Setup
${tc} = Check Test Case ${TESTNAME} FAIL Setup failed:\n${MESSAGES}
- Check Log Message ${tc.setup.msgs[0]} ${MESSAGES} FAIL
+ Check Log Message ${tc.setup[0]} ${MESSAGES} FAIL
Non-ASCII Failure In Teardown
${tc} = Check Test Case ${TESTNAME} FAIL Teardown failed:\n${MESSAGES}
- Check Log Message ${tc.teardown.msgs[0]} ${MESSAGES} FAIL
+ Check Log Message ${tc.teardown[0]} ${MESSAGES} FAIL
Non-ASCII Failure In Teardown After Normal Failure
Check Test Case ${TESTNAME} FAIL Just ASCII here\n\nAlso teardown failed:\n${MESSAGES}
Ñöñ-ÄŚÇÏÏ Tëśt äņd Këywörd Nämës, Спасибо
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].name} Ñöñ-ÄŚÇÏÏ Këywörd Nämë
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} Hyvää päivää
+ Should Be Equal ${tc[0].name} Ñöñ-ÄŚÇÏÏ Këywörd Nämë
+ Check Log Message ${tc[0, 0, 0]} Hyvää päivää
Non-ASCII Failure In Suite Setup and Teardown
Check Test Case ${TESTNAME}
- Check Log Message ${SUITE.suites[1].setup.msgs[0]} ${MESSAGES} FAIL
- Check Log Message ${SUITE.suites[1].teardown.msgs[0]} ${MESSAGES} FAIL
+ Check Log Message ${SUITE.suites[1].setup[0]} ${MESSAGES} FAIL
+ Check Log Message ${SUITE.suites[1].teardown[0]} ${MESSAGES} FAIL
diff --git a/atest/robot/core/overriding_default_settings_with_none.robot b/atest/robot/core/overriding_default_settings_with_none.robot
index 9e3dae2bb86..627d11d77b0 100644
--- a/atest/robot/core/overriding_default_settings_with_none.robot
+++ b/atest/robot/core/overriding_default_settings_with_none.robot
@@ -22,15 +22,15 @@ Overriding Test Teardown from Command Line
Overriding Test Template
${tc}= Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].full_name} BuiltIn.No Operation
+ Should Be Equal ${tc[0].full_name} BuiltIn.No Operation
Overriding Test Timeout
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].msgs[0]} Slept 123 milliseconds.
+ Check Log Message ${tc[0, 0]} Slept 123 milliseconds.
Overriding Test Timeout from Command Line
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].msgs[0]} Slept 123 milliseconds.
+ Check Log Message ${tc[0, 0]} Slept 123 milliseconds.
Overriding Default Tags
${tc}= Check Test Case ${TESTNAME}
@@ -44,5 +44,5 @@ Overriding Is Case Insensitive
${tc}= Check Test Case ${TESTNAME}
Setup Should Not Be Defined ${tc}
Teardown Should Not Be Defined ${tc}
- Should Be Equal ${tc.body[0].full_name} BuiltIn.No Operation
+ Should Be Equal ${tc[0].full_name} BuiltIn.No Operation
Should Be Empty ${tc.tags}
diff --git a/atest/robot/core/suite_setup_and_teardown.robot b/atest/robot/core/suite_setup_and_teardown.robot
index 55428c0caf1..5db730961b7 100644
--- a/atest/robot/core/suite_setup_and_teardown.robot
+++ b/atest/robot/core/suite_setup_and_teardown.robot
@@ -1,35 +1,32 @@
*** Settings ***
-Resource atest_resource.robot
+Resource atest_resource.robot
*** Variables ***
-${1 PASS MSG} 1 test, 1 passed, 0 failed
-${1 FAIL MSG} 1 test, 0 passed, 1 failed
-${2 FAIL MSG} 2 tests, 0 passed, 2 failed
-${4 FAIL MSG} 4 tests, 0 passed, 4 failed
-${5 FAIL MSG} 5 tests, 0 passed, 5 failed
-${12 FAIL MSG} 12 tests, 0 passed, 12 failed
-${ALSO} \n\nAlso teardown of the parent suite failed.
+${1 PASS MSG} 1 test, 1 passed, 0 failed
+${1 FAIL MSG} 1 test, 0 passed, 1 failed
+${2 FAIL MSG} 2 tests, 0 passed, 2 failed
+${4 FAIL MSG} 4 tests, 0 passed, 4 failed
+${5 FAIL MSG} 5 tests, 0 passed, 5 failed
+${12 FAIL MSG} 12 tests, 0 passed, 12 failed
+${ALSO} \n\nAlso teardown of the parent suite failed.
${EXECUTED FILE} %{TEMPDIR}/robot-suite-teardown-executed.txt
*** Test Cases ***
Passing Suite Setup
Run Tests ${EMPTY} core/passing_suite_setup.robot
- Check Suite Status ${SUITE} PASS ${1 PASS MSG}
- ... Verify Suite Setup
+ Check Suite Status ${SUITE} PASS ${1 PASS MSG} Verify Suite Setup
Passing Suite Teardown
[Setup] Remove File ${EXECUTED FILE}
Run Tests ${EMPTY} core/passing_suite_teardown.robot
- Check Suite Status ${SUITE} PASS ${1 PASS MSG}
- ... Test
+ Check Suite Status ${SUITE} PASS ${1 PASS MSG} Test
File Should Exist ${EXECUTED FILE}
[Teardown] Remove File ${EXECUTED FILE}
Passing Suite Setup And Teardown
[Setup] Remove File ${EXECUTED FILE}
Run Tests ${EMPTY} core/passing_suite_setup_and_teardown.robot
- Check Suite Status ${SUITE} PASS ${1 PASS MSG}
- ... Verify Suite Setup
+ Check Suite Status ${SUITE} PASS ${1 PASS MSG} Verify Suite Setup
File Should Exist ${EXECUTED FILE}
[Teardown] Remove File ${EXECUTED FILE}
@@ -38,11 +35,10 @@ Failing Suite Setup
Check Suite Status ${SUITE} FAIL
... Suite setup failed:\nExpected failure\n\n${2 FAIL MSG}
... Test 1 Test 2
- Should Be Equal ${SUITE.setup.status} FAIL
- Should Be Equal ${SUITE.teardown.status} PASS
- Length Should Be ${SUITE.teardown.msgs} 1
+ Should Be Equal ${SUITE.setup.status} FAIL
+ Should Be Equal ${SUITE.teardown.status} PASS
+ Length Should Be ${SUITE.teardown.body} 1
Check Log Message ${SUITE.teardown.messages[0]} Suite teardown executed
- Should Be Empty ${SUITE.teardown.kws}
Erroring Suite Setup
Run Tests ${EMPTY} core/erroring_suite_setup.robot
@@ -50,15 +46,15 @@ Erroring Suite Setup
... Suite setup failed:\nNo keyword with name 'Non-Existing Keyword' found.\n\n${2 FAIL MSG}
... Test 1 Test 2
Should Be Equal ${SUITE.setup.status} FAIL
- ${td} = Set Variable ${SUITE.teardown}
- Should Be Equal ${td.name} My TD
- Should Be Equal ${td.status} PASS
- Should Be Empty ${td.msgs}
- Length Should Be ${td.kws} 2
- Length Should Be ${td.kws[0].msgs} 1
- Check Log Message ${td.kws[0].msgs[0]} Hello from suite teardown!
- Should Be Empty ${td.kws[0].kws}
- Should Be Equal ${td.kws[1].full_name} BuiltIn.No Operation
+ VAR ${td} ${SUITE.teardown}
+ Should Be Equal ${td.name} My TD
+ Should Be Equal ${td.status} PASS
+ Length Should Be ${td.body} 2
+ Length Should Be ${td.messages} 0
+ Length Should Be ${td[0].body} 1
+ Length Should Be ${td[0].messages} 1
+ Check Log Message ${td[0, 0]} Hello from suite teardown!
+ Should Be Equal ${td[1].full_name} BuiltIn.No Operation
Failing Higher Level Suite Setup
Run Tests ${EMPTY} core/failing_higher_level_suite_setup
@@ -104,7 +100,7 @@ Failing Suite Setup And Teardown
... in two lines
Check Suite Status ${SUITE} FAIL ${error}\n\n${2 FAIL MSG}
... Test 1 Test 2
- Should Be Equal ${SUITE.setup.status} FAIL
+ Should Be Equal ${SUITE.setup.status} FAIL
Should Be Equal ${SUITE.teardown.status} FAIL
Output should contain teardown error Teardown failure\nin two lines
@@ -161,10 +157,14 @@ Long Error Messages
*** Keywords ***
Check Suite Status
[Arguments] ${suite or name} ${status} ${message} @{tests}
- ${is string} = Run Keyword And Return Status Should Be String ${suite or name}
- ${suite} = Run Keyword If ${is string} Get Test Suite ${suite or name}
- ... ELSE Set Variable ${suite or name}
- Should Be Equal ${suite.status} ${status} Wrong suite status
+ TRY
+ Should Be String ${suite or name}
+ EXCEPT
+ VAR ${suite} ${suite or name}
+ ELSE
+ ${suite} = Get Test Suite ${suite or name}
+ END
+ Should Be Equal ${suite.status} ${status} Wrong suite status
Should Be Equal ${suite.full_message} ${message} Wrong suite message
Should Contain Tests ${suite} @{tests}
diff --git a/atest/robot/core/test_suite_init_file.robot b/atest/robot/core/test_suite_init_file.robot
index 59d27cef032..fa952fba835 100644
--- a/atest/robot/core/test_suite_init_file.robot
+++ b/atest/robot/core/test_suite_init_file.robot
@@ -21,14 +21,14 @@ Suite Documentation
Suite Setup
[Documentation] Setting and not setting setup using suite file
- Check Log Message ${suite.setup.kws[0].msgs[0]} Setup of test suite directory
+ Check Log Message ${suite.setup[0, 0]} Setup of test suite directory
Setup Should Not Be Defined ${subsuite_with_init}
Setup Should Not Be Defined ${subsuite_without_init}
Suite Teardown
[Documentation] Setting and not setting teardown using suite file
- Check Log Message ${suite.teardown.kws[1].msgs[0]} Teardown of test suite directory
- Check Log Message ${subsuite_with_init.teardown.kws[1].msgs[0]} Teardown of sub test suite directory
+ Check Log Message ${suite.teardown[1, 0]} Teardown of test suite directory
+ Check Log Message ${subsuite_with_init.teardown[1, 0]} Teardown of sub test suite directory
Teardown Should Not Be Defined ${subsuite_without_init}
Invalid Suite Setting
diff --git a/atest/robot/keywords/dots_in_keyword_name.robot b/atest/robot/keywords/dots_in_keyword_name.robot
index ac30e4bf2c8..1ea6962e9a1 100644
--- a/atest/robot/keywords/dots_in_keyword_name.robot
+++ b/atest/robot/keywords/dots_in_keyword_name.robot
@@ -44,5 +44,5 @@ Dots in library name and keyword name with full name
Conflicting names with dots
${tc} = Check Test Case ${TESTNAME}
- Check log message ${tc.kws[0].msgs[0]} Running keyword 'Conflict'.
- Check log message ${tc.kws[1].msgs[0]} Executing keyword 'In.name.conflict'.
+ Check log message ${tc[0, 0]} Running keyword 'Conflict'.
+ Check log message ${tc[1, 0]} Executing keyword 'In.name.conflict'.
diff --git a/atest/robot/keywords/duplicate_dynamic_keywords.robot b/atest/robot/keywords/duplicate_dynamic_keywords.robot
index 143869d3102..15e1a07854b 100644
--- a/atest/robot/keywords/duplicate_dynamic_keywords.robot
+++ b/atest/robot/keywords/duplicate_dynamic_keywords.robot
@@ -5,14 +5,14 @@ Resource atest_resource.robot
*** Test Cases ***
Using keyword defined multiple times fails
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].full_name} DupeDynamicKeywords.Defined Twice
+ Should Be Equal ${tc[0].full_name} DupeDynamicKeywords.Defined Twice
Error in library DupeDynamicKeywords
... Adding keyword 'DEFINED TWICE' failed:
... Keyword with same name defined multiple times.
Keyword with embedded arguments defined multiple times fails at run-time
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].full_name} Embedded twice
+ Should Be Equal ${tc[0].full_name} Embedded twice
Length Should Be ${ERRORS} 1
Exact duplicate is accepted
diff --git a/atest/robot/keywords/duplicate_hybrid_keywords.robot b/atest/robot/keywords/duplicate_hybrid_keywords.robot
index 5e86f8cfffe..3269b524a3c 100644
--- a/atest/robot/keywords/duplicate_hybrid_keywords.robot
+++ b/atest/robot/keywords/duplicate_hybrid_keywords.robot
@@ -5,14 +5,14 @@ Resource atest_resource.robot
*** Test Cases ***
Using keyword defined multiple times fails
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].full_name} DupeHybridKeywords.Defined Twice
+ Should Be Equal ${tc[0].full_name} DupeHybridKeywords.Defined Twice
Error in library DupeHybridKeywords
... Adding keyword 'DEFINED TWICE' failed:
... Keyword with same name defined multiple times.
Keyword with embedded arguments defined multiple times fails at run-time
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].full_name} Embedded twice
+ Should Be Equal ${tc[0].full_name} Embedded twice
Length Should Be ${ERRORS} 1
Exact duplicate is accepted
diff --git a/atest/robot/keywords/duplicate_static_keywords.robot b/atest/robot/keywords/duplicate_static_keywords.robot
index c712e80e7d1..c2d9ce15ff7 100644
--- a/atest/robot/keywords/duplicate_static_keywords.robot
+++ b/atest/robot/keywords/duplicate_static_keywords.robot
@@ -5,20 +5,20 @@ Resource atest_resource.robot
*** Test Cases ***
Using keyword defined twice fails
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].full_name} DupeKeywords.Defined Twice
+ Should Be Equal ${tc[0].full_name} DupeKeywords.Defined Twice
Creating keyword should have failed 2 Defined twice
Using keyword defined thrice fails as well
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].full_name} DupeKeywords.Defined Thrice
+ Should Be Equal ${tc[0].full_name} DupeKeywords.Defined Thrice
Creating keyword should have failed 0 Defined Thrice
Creating keyword should have failed 1 Defined Thrice
Keyword with embedded arguments defined twice fails at run-time
${tc} = Check Test Case ${TESTNAME}: Called with embedded args
- Should Be Equal ${tc.kws[0].full_name} Embedded arguments twice
+ Should Be Equal ${tc[0].full_name} Embedded arguments twice
${tc} = Check Test Case ${TESTNAME}: Called with exact name
- Should Be Equal ${tc.kws[0].full_name} Embedded \${arguments match} twice
+ Should Be Equal ${tc[0].full_name} Embedded \${arguments match} twice
Length Should Be ${ERRORS} 3
*** Keywords ***
diff --git a/atest/robot/keywords/embedded_arguments.robot b/atest/robot/keywords/embedded_arguments.robot
index 1540be432a8..b17b2ccfccc 100644
--- a/atest/robot/keywords/embedded_arguments.robot
+++ b/atest/robot/keywords/embedded_arguments.robot
@@ -5,62 +5,60 @@ Resource atest_resource.robot
*** Test Cases ***
Embedded Arguments In User Keyword Name
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} This is always executed
- Check Keyword Data ${tc.kws[0]} User Peke Selects Advanced Python From Webshop \${name}, \${book}
- Check Log Message ${tc.kws[2].kws[0].msgs[0]} This is always executed
- Check Keyword Data ${tc.kws[2]} User Juha Selects Playboy From Webshop \${name}, \${book}
- File Should Contain ${OUTFILE}
- ... name="User Peke Selects Advanced Python From Webshop"
- File Should Contain ${OUTFILE}
- ... source_name="User \${user} Selects \${item} From Webshop"
- File Should Not Contain ${OUTFILE} source_name="Log"
+ Check Log Message ${tc[0, 0, 0]} This is always executed
+ Check Keyword Data ${tc[0]} User Peke Selects Advanced Python From Webshop \${name}, \${book}
+ Check Log Message ${tc[2, 0, 0]} This is always executed
+ Check Keyword Data ${tc[2]} User Juha Selects Playboy From Webshop \${name}, \${book}
+ File Should Contain ${OUTFILE} name="User Peke Selects Advanced Python From Webshop"
+ File Should Contain ${OUTFILE} source_name="User \${user} Selects \${item} From Webshop"
+ File Should Not Contain ${OUTFILE} source_name="Log"
Complex Embedded Arguments
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} feature-works
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} test case-is *executed*
- Check Log Message ${tc.kws[2].kws[0].msgs[0]} issue-is about to be done!
- File Should Contain ${OUTFILE} source_name="\${prefix:Given|When|Then} this
- File Should Not Contain ${OUTFILE} source_name="Log"
+ Check Log Message ${tc[0, 0, 0]} feature-works
+ Check Log Message ${tc[1, 0, 0]} test case-is *executed*
+ Check Log Message ${tc[2, 0, 0]} issue-is about to be done!
+ File Should Contain ${OUTFILE} source_name="\${prefix:Given|When|Then} this
+ File Should Not Contain ${OUTFILE} source_name="Log"
Embedded Arguments with BDD Prefixes
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0]} Given user x selects y from webshop
- Check Keyword Data ${tc.kws[1]} When user x selects y from webshop
- Check Keyword Data ${tc.kws[2]} Then user x selects y from webshop \${x}, \${y}
- File Should Contain ${OUTFILE}
- ... name="Given user x selects y from webshop"
- File Should Contain ${OUTFILE}
- ... source_name="User \${user} Selects \${item} From Webshop"
+ Check Keyword Data ${tc[0]} Given user x selects y from webshop
+ Check Keyword Data ${tc[1]} When user x selects y from webshop
+ Check Keyword Data ${tc[2]} Then user x selects y from webshop \${x}, \${y}
+ File Should Contain ${OUTFILE} name="Given user x selects y from webshop"
+ File Should Contain ${OUTFILE} source_name="User \${user} Selects \${item} From Webshop"
File Should Not Contain ${OUTFILE} source_name="Log"
Argument Namespaces with Embedded Arguments
Check Test Case ${TEST NAME}
- File Should Contain ${OUTFILE} name="My embedded warrior"
- File Should Contain ${OUTFILE} source_name="My embedded \${var}"
+ File Should Contain ${OUTFILE} name="My embedded warrior"
+ File Should Contain ${OUTFILE} source_name="My embedded \${var}"
File Should Not Contain ${OUTFILE} source_name="Log"
Embedded Arguments as Variables
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0]} User \${42} Selects \${EMPTY} From Webshop \${name}, \${item}
- Check Keyword Data ${tc.kws[2]} User \${name} Selects \${SPACE * 10} From Webshop \${name}, \${item}
- File Should Contain ${OUTFILE}
- ... name="User \${42} Selects \${EMPTY} From Webshop"
- File Should Contain ${OUTFILE}
- ... source_name="User \${user} Selects \${item} From Webshop"
- File Should Contain ${OUTFILE}
- ... name="User \${name} Selects \${SPACE * 10} From Webshop"
- File Should Contain ${OUTFILE}
- ... source_name="User \${user} Selects \${item} From Webshop"
+ Check Keyword Data ${tc[0]} User \${42} Selects \${EMPTY} From Webshop \${name}, \${item}
+ Check Keyword Data ${tc[2]} User \${name} Selects \${SPACE * 100}[:10] From Webshop \${name}, \${item}
+ File Should Contain ${OUTFILE} name="User \${42} Selects \${EMPTY} From Webshop"
+ File Should Contain ${OUTFILE} name="User \${name} Selects \${SPACE * 100}[:10] From Webshop"
+ File Should Contain ${OUTFILE} source_name="User \${user} Selects \${item} From Webshop"
File Should Not Contain ${OUTFILE} source_name="Log">
+Embedded arguments as variables and other content
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Keyword Data ${tc[0]} User \${foo}\${EMPTY}\${bar} Selects \${foo}, \${bar} and \${zap} From Webshop \${name}, \${item}
+
+Embedded arguments as variables containing characters in keyword name
+ Check Test Case ${TEST NAME}
+
Embedded Arguments as List And Dict Variables
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[1]} User \@{i1} Selects \&{i2} From Webshop \${o1}, \${o2}
+ Check Keyword Data ${tc[1]} User \@{i1} Selects \&{i2} From Webshop \${o1}, \${o2}
Non-Existing Variable in Embedded Arguments
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0]} User \${non existing} Selects \${variables} From Webshop status=FAIL
+ Check Keyword Data ${tc[0]} User \${non existing} Selects \${variables} From Webshop status=FAIL
Invalid List Variable as Embedded Argument
Check Test Case ${TEST NAME}
@@ -89,44 +87,44 @@ Grouping Custom Regexp
Custom Regexp Matching Variables
Check Test Case ${TEST NAME}
+Custom regexp with inline Python evaluation
+ Check Test Case ${TEST NAME}
+
Non Matching Variable Is Accepted With Custom Regexp (But Not For Long)
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[0].msgs[0]}
+ Check Log Message ${tc[0, 0]}
... Embedded argument 'x' got value 'foo' that does not match custom pattern 'bar'. The argument is still accepted, but this behavior will change in Robot Framework 8.0. WARN
Partially Matching Variable Is Accepted With Custom Regexp (But Not For Long)
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[0].msgs[0]}
+ Check Log Message ${tc[0, 0]}
... Embedded argument 'x' got value 'ba' that does not match custom pattern 'bar'. The argument is still accepted, but this behavior will change in Robot Framework 8.0. WARN
- Check Log Message ${tc.body[0].msgs[1]}
+ Check Log Message ${tc[0, 1]}
... Embedded argument 'y' got value 'zapzap' that does not match custom pattern '...'. The argument is still accepted, but this behavior will change in Robot Framework 8.0. WARN
Non String Variable Is Accepted With Custom Regexp
Check Test Case ${TEST NAME}
-Regexp Extensions Are Not Supported
+Custom regexp with inline flag
Check Test Case ${TEST NAME}
- Creating Keyword Failed 0 292
- ... Regexp extensions like \${x:(?x)re} are not supported
- ... Regexp extensions are not allowed in embedded arguments.
Invalid Custom Regexp
Check Test Case ${TEST NAME}
- Creating Keyword Failed 1 295
+ Creating Keyword Failed 0 334
... Invalid \${x:(} Regexp
... Compiling embedded arguments regexp failed: *
Escaping Values Given As Embedded Arguments
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0]} User \\\${nonex} Selects \\\\ From Webshop \${name}, \${item}
- Check Keyword Data ${tc.kws[2]} User \\ Selects \\ \\ From Webshop \${name}, \${item}
+ Check Keyword Data ${tc[0]} User \\\${nonex} Selects \\\\ From Webshop \${name}, \${item}
+ Check Keyword Data ${tc[2]} User \\ Selects \\ \\ From Webshop \${name}, \${item}
Embedded Arguments Syntax Is Case Insensitive
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0]} x Gets y From The z
- Check Keyword Data ${tc.kws[1]} x gets y from the z
- Check Keyword Data ${tc.kws[2]} x GETS y from the z
- Check Keyword Data ${tc.kws[3]} x gets y FROM THE z
+ Check Keyword Data ${tc[0]} x Gets y From The z
+ Check Keyword Data ${tc[1]} x gets y from the z
+ Check Keyword Data ${tc[2]} x GETS y from the z
+ Check Keyword Data ${tc[3]} x gets y FROM THE z
Embedded Arguments Syntax is Space Sensitive
Check Test Case ${TEST NAME}
@@ -136,11 +134,11 @@ Embedded Arguments Syntax is Underscore Sensitive
Embedded Arguments In Resource File
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0]} embedded_args_in_uk_1.Juha Uses Resource File \${ret}
+ Check Keyword Data ${tc[0]} embedded_args_in_uk_1.Juha Uses Resource File \${ret}
Embedded Arguments In Resource File Used Explicitly
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0]} embedded_args_in_uk_1.peke uses resource file \${ret}
+ Check Keyword Data ${tc[0]} embedded_args_in_uk_1.peke uses resource file \${ret}
Keyword with only embedded arguments doesn't accept normal arguments
Check Test Case ${TEST NAME}
@@ -150,37 +148,37 @@ Keyword with embedded args cannot be used as "normal" keyword
Keyword with both embedded and normal arguments
${tc} = Check Test Case ${TEST NAME}
- Check Log message ${tc.body[0].body[0].msgs[0]} 2 horses are walking
- Check Log message ${tc.body[1].body[0].msgs[0]} 2 horses are swimming
- Check Log message ${tc.body[2].body[0].msgs[0]} 3 dogs are walking
+ Check Log message ${tc[0, 0, 0]} 2 horses are walking
+ Check Log message ${tc[1, 0, 0]} 2 horses are swimming
+ Check Log message ${tc[2, 0, 0]} 3 dogs are walking
Keyword with both embedded and normal arguments with too few arguments
Check Test Case ${TEST NAME}
Keyword matching multiple keywords in test case file
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} foo+tc+bar
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} foo-tc-bar
- Check Log Message ${tc.kws[2].kws[0].msgs[0]} foo+tc+bar+tc+zap
+ Check Log Message ${tc[0, 0, 0]} foo+tc+bar
+ Check Log Message ${tc[1, 0, 0]} foo-tc-bar
+ Check Log Message ${tc[2, 0, 0]} foo+tc+bar+tc+zap
Keyword matching multiple keywords in one resource file
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} foo+r1+bar
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} foo-r1-bar
+ Check Log Message ${tc[0, 0, 0]} foo+r1+bar
+ Check Log Message ${tc[1, 0, 0]} foo-r1-bar
Keyword matching multiple keywords in different resource files
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} foo-r1-bar
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} foo-r2-bar
+ Check Log Message ${tc[0, 0, 0]} foo-r1-bar
+ Check Log Message ${tc[1, 0, 0]} foo-r2-bar
Keyword matching multiple keywords in one and different resource files
Check Test Case ${TEST NAME}
Same name with different regexp works
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} a car
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} a dog
- Check Log Message ${tc.kws[2].kws[0].msgs[0]} a cow
+ Check Log Message ${tc[0, 0, 0]} a car
+ Check Log Message ${tc[1, 0, 0]} a dog
+ Check Log Message ${tc[2, 0, 0]} a cow
Same name with different regexp matching multiple fails
Check Test Case ${TEST NAME}
diff --git a/atest/robot/keywords/embedded_arguments_library_keywords.robot b/atest/robot/keywords/embedded_arguments_library_keywords.robot
index b0646a0c6e1..67da8ca77ce 100755
--- a/atest/robot/keywords/embedded_arguments_library_keywords.robot
+++ b/atest/robot/keywords/embedded_arguments_library_keywords.robot
@@ -5,66 +5,69 @@ Resource atest_resource.robot
*** Test Cases ***
Embedded Arguments In Library Keyword Name
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} This is always executed
- Check Keyword Data ${tc.kws[0]} embedded_args_in_lk_1.User Peke Selects Advanced Python From Webshop \${name}, \${book}
- Check Log Message ${tc.kws[2].msgs[0]} This is always executed
- Check Keyword Data ${tc.kws[2]} embedded_args_in_lk_1.User Juha selects Playboy from webshop \${name}, \${book}
- File Should Contain ${OUTFILE}
- ... name="User Peke Selects Advanced Python From Webshop"
- File Should Contain ${OUTFILE}
- ... owner="embedded_args_in_lk_1"
- File Should Contain ${OUTFILE}
- ... source_name="User \${user} Selects \${item} From Webshop"
- File Should Not Contain ${OUTFILE} source_name="Log"
+ Check Log Message ${tc[0, 0]} This is always executed
+ Check Keyword Data ${tc[0]} embedded_args_in_lk_1.User Peke Selects Advanced Python From Webshop \${name}, \${book}
+ Check Log Message ${tc[2, 0]} This is always executed
+ Check Keyword Data ${tc[2]} embedded_args_in_lk_1.User Juha selects Playboy from webshop \${name}, \${book}
+ File Should Contain ${OUTFILE} name="User Peke Selects Advanced Python From Webshop"
+ File Should Contain ${OUTFILE} owner="embedded_args_in_lk_1"
+ File Should Contain ${OUTFILE} source_name="User \${user} Selects \${item} From Webshop"
+ File Should Not Contain ${OUTFILE} source_name="Log"
Complex Embedded Arguments
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} feature-works
- Check Log Message ${tc.kws[1].msgs[0]} test case-is *executed*
- Check Log Message ${tc.kws[2].msgs[0]} issue-is about to be done!
- File Should Contain ${OUTFILE} source_name="\${prefix:Given|When|Then} this
- File Should Not Contain ${OUTFILE} source_name="Log"
+ Check Log Message ${tc[0, 0]} feature-works
+ Check Log Message ${tc[1, 0]} test case-is *executed*
+ Check Log Message ${tc[2, 0]} issue-is about to be done!
+ File Should Contain ${OUTFILE} source_name="\${prefix:Given|When|Then} this
+ File Should Not Contain ${OUTFILE} source_name="Log"
Embedded Arguments with BDD Prefixes
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0]} embedded_args_in_lk_1.Given user x selects y from webshop
- Check Keyword Data ${tc.kws[1]} embedded_args_in_lk_1.When user x selects y from webshop
- Check Keyword Data ${tc.kws[2]} embedded_args_in_lk_1.Then user x selects y from webshop \${x}, \${y}
- File Should Contain ${OUTFILE} name="Given user x selects y from webshop"
- File Should Contain ${OUTFILE} owner="embedded_args_in_lk_1"
- File Should Contain ${OUTFILE} source_name="User \${user} Selects \${item} From Webshop"
+ Check Keyword Data ${tc[0]} embedded_args_in_lk_1.Given user x selects y from webshop
+ Check Keyword Data ${tc[1]} embedded_args_in_lk_1.When user x selects y from webshop
+ Check Keyword Data ${tc[2]} embedded_args_in_lk_1.Then user x selects y from webshop \${x}, \${y}
+ File Should Contain ${OUTFILE} name="Given user x selects y from webshop"
+ File Should Contain ${OUTFILE} owner="embedded_args_in_lk_1"
+ File Should Contain ${OUTFILE} source_name="User \${user} Selects \${item} From Webshop"
File Should Not Contain ${OUTFILE} source_name="Log"
Argument Namespaces with Embedded Arguments
Check Test Case ${TEST NAME}
- File Should Contain ${OUTFILE} name="My embedded warrior"
- File Should Contain ${OUTFILE} owner="embedded_args_in_lk_1"
- File Should Contain ${OUTFILE} source_name="My embedded \${var}"
+ File Should Contain ${OUTFILE} name="My embedded warrior"
+ File Should Contain ${OUTFILE} owner="embedded_args_in_lk_1"
+ File Should Contain ${OUTFILE} source_name="My embedded \${var}"
File Should Not Contain ${OUTFILE} source_name="Log"
Embedded Arguments as Variables
${tc} = Check Test Case ${TEST NAME}
- File Should Contain ${OUTFILE}
- ... name="User \${42} Selects \${EMPTY} From Webshop"
- File Should Contain ${OUTFILE}
- ... owner="embedded_args_in_lk_1"
- File Should Contain ${OUTFILE}
- ... source_name="User \${user} Selects \${item} From Webshop"
- File Should Contain ${OUTFILE}
- ... name="User \${name} Selects \${SPACE * 10} From Webshop"
+ File Should Contain ${OUTFILE} name="User \${42} Selects \${EMPTY} From Webshop"
+ File Should Contain ${OUTFILE} owner="embedded_args_in_lk_1"
+ File Should Contain ${OUTFILE} source_name="User \${user} Selects \${item} From Webshop"
+ File Should Contain ${OUTFILE} name="User \${name} Selects \${SPACE * 100}[:10] From Webshop"
File Should Not Contain ${OUTFILE} source_name="Log"
+Embedded arguments as variables and other content
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Keyword Data ${tc[0]} embedded_args_in_lk_1.User \${foo}\${EMPTY}\${bar} Selects \${foo}, \${bar} and \${zap} From Webshop \${name}, \${item}
+
+Embedded arguments as variables containing characters in keyword name
+ Check Test Case ${TEST NAME}
+
Embedded Arguments as List And Dict Variables
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[1]} embedded_args_in_lk_1.User \@{inp1} Selects \&{inp2} From Webshop \${out1}, \${out2}
+ Check Keyword Data ${tc[1]} embedded_args_in_lk_1.User \@{inp1} Selects \&{inp2} From Webshop \${out1}, \${out2}
Non-Existing Variable in Embedded Arguments
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0]} embedded_args_in_lk_1.User \${non existing} Selects \${variables} From Webshop status=FAIL
+ Check Keyword Data ${tc[0]} embedded_args_in_lk_1.User \${non existing} Selects \${variables} From Webshop status=FAIL
Custom Embedded Argument Regexp
Check Test Case ${TEST NAME}
+Custom regexp with inline flags
+ Check Test Case ${TEST NAME}
+
Custom Regexp With Curly Braces
Check Test Case ${TEST NAME}
@@ -77,16 +80,19 @@ Grouping Custom Regexp
Custom Regexp Matching Variables
Check Test Case ${TEST NAME}
+Custom regexp with inline Python evaluation
+ Check Test Case ${TEST NAME}
+
Non Matching Variable Is Accepted With Custom Regexp (But Not For Long)
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[0].msgs[0]}
+ Check Log Message ${tc[0, 0]}
... Embedded argument 'x' got value 'foo' that does not match custom pattern 'bar'. The argument is still accepted, but this behavior will change in Robot Framework 8.0. WARN
Partially Matching Variable Is Accepted With Custom Regexp (But Not For Long)
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[0].msgs[0]}
+ Check Log Message ${tc[0, 0]}
... Embedded argument 'x' got value 'ba' that does not match custom pattern 'bar'. The argument is still accepted, but this behavior will change in Robot Framework 8.0. WARN
- Check Log Message ${tc.body[0].msgs[1]}
+ Check Log Message ${tc[0, 1]}
... Embedded argument 'y' got value 'zapzap' that does not match custom pattern '...'. The argument is still accepted, but this behavior will change in Robot Framework 8.0. WARN
Non String Variable Is Accepted With Custom Regexp
@@ -100,9 +106,9 @@ Embedded Arguments Syntax is Underscore Sensitive
Keyword matching multiple keywords in library file
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} foo+lib+bar
- Check Log Message ${tc.kws[1].msgs[0]} foo-lib-bar
- Check Log Message ${tc.kws[2].msgs[0]} foo+lib+bar+lib+zap
+ Check Log Message ${tc[0, 0]} foo+lib+bar
+ Check Log Message ${tc[1, 0]} foo-lib-bar
+ Check Log Message ${tc[2, 0]} foo+lib+bar+lib+zap
Keyword matching multiple keywords in different library files
Check Test Case ${TEST NAME}
@@ -115,9 +121,9 @@ Keyword with embedded args cannot be used as "normal" keyword
Keyword with both embedded and normal arguments
${tc} = Check Test Case ${TEST NAME}
- Check Log message ${tc.body[0].msgs[0]} 2 horses are walking
- Check Log message ${tc.body[1].msgs[0]} 2 horses are swimming
- Check Log message ${tc.body[2].msgs[0]} 3 dogs are walking
+ Check Log message ${tc[0, 0]} 2 horses are walking
+ Check Log message ${tc[1, 0]} 2 horses are swimming
+ Check Log message ${tc[2, 0]} 3 dogs are walking
Conversion with embedded and normal arguments
Check Test Case ${TEST NAME}
@@ -130,6 +136,7 @@ Must accept at least as many positional arguments as there are embedded argument
Error in library embedded_args_in_lk_1
... Adding keyword 'Wrong \${number} of embedded \${args}' failed:
... Keyword must accept at least as many positional arguments as it has embedded arguments.
+ ... index=2
Optional Non-Embedded Args Are Okay
Check Test Case ${TESTNAME}
@@ -142,12 +149,27 @@ Lists are not expanded when keyword accepts varargs
Same name with different regexp works
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} a car
- Check Log Message ${tc.kws[1].msgs[0]} a dog
- Check Log Message ${tc.kws[2].msgs[0]} a cow
+ Check Log Message ${tc[0, 0]} a car
+ Check Log Message ${tc[1, 0]} a dog
+ Check Log Message ${tc[2, 0]} a cow
Same name with different regexp matching multiple fails
Check Test Case ${TEST NAME}
Same name with same regexp fails
Check Test Case ${TEST NAME}
+
+Embedded arguments cannot have type information
+ Check Test Case ${TEST NAME}
+ Error in library embedded_args_in_lk_1
+ ... Adding keyword 'Embedded \${arg: int} with type is not supported' failed:
+ ... Library keywords do not support type information with embedded arguments like '\${arg: int}'.
+ ... Use type hints with function arguments instead.
+ ... index=1
+
+Embedded type can nevertheless be invalid
+ Check Test Case ${TEST NAME}
+ Error in library embedded_args_in_lk_1
+ ... Adding keyword 'embedded_types_can_be_invalid' failed:
+ ... Invalid embedded argument '\${invalid: bad}': Unrecognized type 'bad'.
+ ... index=0
diff --git a/atest/robot/keywords/keyword_documentation.robot b/atest/robot/keywords/keyword_documentation.robot
index 8cc336b170e..2ae9f37eeba 100644
--- a/atest/robot/keywords/keyword_documentation.robot
+++ b/atest/robot/keywords/keyword_documentation.robot
@@ -26,4 +26,4 @@ Multiline documentation with split short doc
Verify Documentation
[Arguments] ${doc} ${test}=${TEST NAME}
${tc} = Check Test Case ${test}
- Should Be Equal ${tc.kws[0].doc} ${doc}
+ Should Be Equal ${tc[0].doc} ${doc}
diff --git a/atest/robot/keywords/keyword_names.robot b/atest/robot/keywords/keyword_names.robot
index 88e2ddc7c6a..dccf6c6afa7 100644
--- a/atest/robot/keywords/keyword_names.robot
+++ b/atest/robot/keywords/keyword_names.robot
@@ -20,38 +20,38 @@ Base Keyword Names In Test Case
Test Case File User Keyword Names In Test Case File User Keyword
${test} = Check Test Case Test Case File User Keyword Names In Test Case File User Keyword
- Check Name and Three Keyword Names ${test.body[0]} Using Test Case File User Keywords Keyword Only In Test Case File
- Should Be Equal ${test.body[1].full_name} Using Test Case File User Keywords Nested
- Check Name and Three Keyword Names ${test.body[1].body[0]} Using Test Case File User Keywords Keyword Only In Test Case File
- Check Name and Three Keyword Names ${test.body[1].body[1]} Using Test Case File User Keywords Keyword Only In Test Case File
+ Check Name and Three Keyword Names ${test[0]} Using Test Case File User Keywords Keyword Only In Test Case File
+ Should Be Equal ${test[1].full_name} Using Test Case File User Keywords Nested
+ Check Name and Three Keyword Names ${test[1, 0]} Using Test Case File User Keywords Keyword Only In Test Case File
+ Check Name and Three Keyword Names ${test[1, 1]} Using Test Case File User Keywords Keyword Only In Test Case File
Resource File User Keyword Names In Test Case File User Keyword
${test} = Check Test Case Resource File User Keyword Names In Test Case File User Keyword
- Check Name and Three Keyword Names ${test.body[0]} Using Resource File User Keywords my_resource_1.Keyword Only In Resource 1
- Should Be Equal ${test.body[1].full_name} Using Resource File User Keywords Nested
- Check Name and Three Keyword Names ${test.body[1].body[0]} Using Resource File User Keywords my_resource_1.Keyword Only In Resource 1
- Check Name and Three Keyword Names ${test.body[1].body[1]} Using Resource File User Keywords my_resource_1.Keyword Only In Resource 1
+ Check Name and Three Keyword Names ${test[0]} Using Resource File User Keywords my_resource_1.Keyword Only In Resource 1
+ Should Be Equal ${test[1].full_name} Using Resource File User Keywords Nested
+ Check Name and Three Keyword Names ${test[1, 0]} Using Resource File User Keywords my_resource_1.Keyword Only In Resource 1
+ Check Name and Three Keyword Names ${test[1, 1]} Using Resource File User Keywords my_resource_1.Keyword Only In Resource 1
Base Keyword Names In Test Case File User Keyword
${test} = Check Test Case Base Keyword Names In Test Case File User Keyword
- Check Name and Three Keyword Names ${test.body[0]} Using Base Keywords MyLibrary1.Keyword Only In Library 1
- Should Be Equal ${test.body[1].full_name} Using Base Keywords Nested
- Check Name and Three Keyword Names ${test.body[1].body[0]} Using Base Keywords MyLibrary1.Keyword Only In Library 1
- Check Name and Three Keyword Names ${test.body[1].body[1]} Using Base Keywords MyLibrary1.Keyword Only In Library 1
+ Check Name and Three Keyword Names ${test[0]} Using Base Keywords MyLibrary1.Keyword Only In Library 1
+ Should Be Equal ${test[1].full_name} Using Base Keywords Nested
+ Check Name and Three Keyword Names ${test[1, 0]} Using Base Keywords MyLibrary1.Keyword Only In Library 1
+ Check Name and Three Keyword Names ${test[1, 1]} Using Base Keywords MyLibrary1.Keyword Only In Library 1
Test Case File User Keyword Names In Resource File User Keyword
${test} = Check Test Case Test Case File User Keyword Names In Resource File User Keyword
- Should Be Equal ${test.body[0].full_name} my_resource_1.Using Test Case File User Keywords In Resource
- Check Name and Three Keyword Names ${test.body[0].body[0]} Using Test Case File User Keywords Keyword Only In Test Case File
+ Should Be Equal ${test[0].full_name} my_resource_1.Using Test Case File User Keywords In Resource
+ Check Name and Three Keyword Names ${test[0, 0]} Using Test Case File User Keywords Keyword Only In Test Case File
Resource File User Keyword Names In Resource File User Keyword
${test} = Check Test Case Resource File User Keyword Names In Resource File User Keyword
- Check Name and Three Keyword Names ${test.body[0]} my_resource_1.Using Resource File User Keywords In Resource 1 my_resource_1.Keyword Only In Resource 1
- Check Name and Three Keyword Names ${test.body[1]} my_resource_1.Using Resource File User Keywords In Resource 2 my_resource_2.Keyword Only In Resource 2
+ Check Name and Three Keyword Names ${test[0]} my_resource_1.Using Resource File User Keywords In Resource 1 my_resource_1.Keyword Only In Resource 1
+ Check Name and Three Keyword Names ${test[1]} my_resource_1.Using Resource File User Keywords In Resource 2 my_resource_2.Keyword Only In Resource 2
Base Keyword Names In Resource File User Keyword
${test} = Check Test Case Base Keyword Names In Resource File User Keyword
- Check Name and Three Keyword Names ${test.body[0]} my_resource_1.Using Base Keywords In Resource MyLibrary1.Keyword Only In Library 1
+ Check Name and Three Keyword Names ${test[0]} my_resource_1.Using Base Keywords In Resource MyLibrary1.Keyword Only In Library 1
User Keyword Name Containing Dots
Check Test And Three Keyword Names User Keyword Name Containing Dots User Keyword.Name
@@ -61,47 +61,47 @@ User Keyword Name Ending With Dot
Name Set Using 'robot_name' Attribute
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].full_name} MyLibrary1.Name set using 'robot_name' attribute
- Check Log Message ${tc.kws[0].msgs[0]} My name was set using 'robot_name' attribute!
+ Should Be Equal ${tc[0].full_name} MyLibrary1.Name set using 'robot_name' attribute
+ Check Log Message ${tc[0, 0]} My name was set using 'robot_name' attribute!
Name Set Using 'robot.api.deco.keyword' Decorator
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].full_name} MyLibrary1.Name set using 'robot.api.deco.keyword' decorator
- Check Log Message ${tc.kws[0].msgs[0]} My name was set using 'robot.api.deco.keyword' decorator!
+ Should Be Equal ${tc[0].full_name} MyLibrary1.Name set using 'robot.api.deco.keyword' decorator
+ Check Log Message ${tc[0, 0]} My name was set using 'robot.api.deco.keyword' decorator!
Custom non-ASCII name
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].full_name} MyLibrary1.Custom nön-ÄSCII name
+ Should Be Equal ${tc[0].full_name} MyLibrary1.Custom nön-ÄSCII name
Old Name Doesn't Work If Name Set Using 'robot_name'
Check Test Case ${TESTNAME}
Keyword can just be marked without changing its name
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].full_name} MyLibrary1.No Custom Name Given 1
- Should Be Equal ${tc.kws[1].full_name} MyLibrary1.No Custom Name Given 2
+ Should Be Equal ${tc[0].full_name} MyLibrary1.No Custom Name Given 1
+ Should Be Equal ${tc[1].full_name} MyLibrary1.No Custom Name Given 2
Functions decorated with @keyword can start with underscrore
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].full_name} MyLibrary1.I Start With An Underscore And I Am Ok
- Check Log Message ${tc.kws[0].msgs[0]} I'm marked with @keyword
- Should Be Equal ${tc.kws[1].full_name} MyLibrary1.Function name can be whatever
- Check Log Message ${tc.kws[1].msgs[0]} Real name set by @keyword
+ Should Be Equal ${tc[0].full_name} MyLibrary1.I Start With An Underscore And I Am Ok
+ Check Log Message ${tc[0, 0]} I'm marked with @keyword
+ Should Be Equal ${tc[1].full_name} MyLibrary1.Function name can be whatever
+ Check Log Message ${tc[1, 0]} Real name set by @keyword
Assignment is not part of name
${tc} = Check Test Case ${TESTNAME}
- Check Keyword Data ${tc.kws[0]} BuiltIn.Log args=No assignment
- Check Keyword Data ${tc.kws[1]} BuiltIn.Set Variable assign=\${var} args=value
- Check Keyword Data ${tc.kws[2]} BuiltIn.Set Variable assign=\${v1}, \${v2} args=1, 2
- Check Keyword Data ${tc.kws[3]} BuiltIn.Evaluate assign=\${first}, \@{rest} args=range(10)
+ Check Keyword Data ${tc[0]} BuiltIn.Log args=No assignment
+ Check Keyword Data ${tc[1]} BuiltIn.Set Variable assign=\${var} args=value
+ Check Keyword Data ${tc[2]} BuiltIn.Set Variable assign=\${v1}, \${v2} args=1, 2
+ Check Keyword Data ${tc[3]} BuiltIn.Evaluate assign=\${first}, \@{rest} args=range(10)
Library name and keyword name are separate
${tc} = Check Test Case ${TESTNAME}
- Keyword and library names should be ${tc.kws[0]} Keyword Only In Test Case File
- Keyword and library names should be ${tc.kws[1]} Keyword Only In Resource 1 my_resource_1
- Keyword and library names should be ${tc.kws[2]} Keyword Only In Resource 1 my_resource_1
- Keyword and library names should be ${tc.kws[3]} Log BuiltIn
- Keyword and library names should be ${tc.kws[4]} Log BuiltIn
+ Keyword and library names should be ${tc[0]} Keyword Only In Test Case File
+ Keyword and library names should be ${tc[1]} Keyword Only In Resource 1 my_resource_1
+ Keyword and library names should be ${tc[2]} Keyword Only In Resource 1 my_resource_1
+ Keyword and library names should be ${tc[3]} Log BuiltIn
+ Keyword and library names should be ${tc[4]} Log BuiltIn
Empty keyword name is not allowed
Error in library MyLibrary1
@@ -121,9 +121,9 @@ Check Name And Three Keyword Names
Check Three Keyword Names
[Arguments] ${item} ${exp_kw_name}
- Should Be Equal ${item.body[0].full_name} ${exp_kw_name}
- Should Be Equal ${item.body[1].full_name} ${exp_kw_name}
- Should Be Equal ${item.body[2].full_name} ${exp_kw_name}
+ Should Be Equal ${item[0].full_name} ${exp_kw_name}
+ Should Be Equal ${item[1].full_name} ${exp_kw_name}
+ Should Be Equal ${item[2].full_name} ${exp_kw_name}
Keyword and library names should be
[Arguments] ${kw} ${kwname} ${libname}=${None}
diff --git a/atest/robot/keywords/keyword_namespaces.robot b/atest/robot/keywords/keyword_namespaces.robot
index 0037600209b..b18f7f4fd36 100644
--- a/atest/robot/keywords/keyword_namespaces.robot
+++ b/atest/robot/keywords/keyword_namespaces.robot
@@ -31,39 +31,39 @@ Keyword From Test Case File Overriding Local Keyword In Resource File Is Depreca
... Keyword 'my_resource_1.Use test case file keyword even when local keyword with same name exists' called keyword
... 'Keyword Everywhere' that exists both in the same resource file as the caller and in the suite file using that
... resource. The keyword in the suite file is used now, but this will change in Robot Framework 8.0.
- Check Log Message ${tc.body[0].body[0].msgs[0]} ${message} WARN
+ Check Log Message ${tc[0, 0, 0]} ${message} WARN
Check Log Message ${ERRORS}[1] ${message} WARN
Local keyword in resource file has precedence over keywords in other resource files
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[0].body[0].body[0].msgs[0]} Keyword in resource 1
- Check Log Message ${tc.body[1].body[0].body[0].msgs[0]} Keyword in resource 2
+ Check Log Message ${tc[0, 0, 0, 0]} Keyword in resource 1
+ Check Log Message ${tc[1, 0, 0, 0]} Keyword in resource 2
Search order has precedence over local keyword in resource file
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[0].body[0].body[0].msgs[0]} Keyword in resource 1
- Check Log Message ${tc.body[1].body[0].body[0].msgs[0]} Keyword in resource 1
+ Check Log Message ${tc[0, 0, 0, 0]} Keyword in resource 1
+ Check Log Message ${tc[1, 0, 0, 0]} Keyword in resource 1
Keyword From Custom Library Overrides Keywords From Standard Library
${tc} = Check Test Case ${TEST NAME}
- Verify Override Message ${ERRORS}[2] ${tc.kws[0]} Comment BuiltIn
- Verify Override Message ${ERRORS}[3] ${tc.kws[1]} Copy Directory OperatingSystem
+ Verify Override Message ${ERRORS}[2] ${tc[0]} Comment BuiltIn
+ Verify Override Message ${ERRORS}[3] ${tc[1]} Copy Directory OperatingSystem
Search order can give presedence to standard library keyword over custom keyword
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[1]} BuiltIn.Comment args=Used from BuiltIn
- Verify Override Message ${ERRORS}[4] ${tc.kws[2]} Copy Directory OperatingSystem
+ Check Keyword Data ${tc[1]} BuiltIn.Comment args=Used from BuiltIn
+ Verify Override Message ${ERRORS}[4] ${tc[2]} Copy Directory OperatingSystem
Search order can give presedence to custom keyword over standard library keyword
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[1]} MyLibrary1.Comment
- Check Log Message ${tc.kws[1].msgs[0]} Overrides keyword from BuiltIn library
- Check Keyword Data ${tc.kws[2]} MyLibrary1.Copy Directory
- Check Log Message ${tc.kws[2].msgs[0]} Overrides keyword from OperatingSystem library
+ Check Keyword Data ${tc[1]} MyLibrary1.Comment
+ Check Log Message ${tc[1, 0]} Overrides keyword from BuiltIn library
+ Check Keyword Data ${tc[2]} MyLibrary1.Copy Directory
+ Check Log Message ${tc[2, 0]} Overrides keyword from OperatingSystem library
Keyword From Custom Library Overrides Keywords From Standard Library Even When Std Lib Imported With Different Name
${tc} = Check Test Case ${TEST NAME}
- Verify Override Message ${ERRORS}[5] ${tc.kws[0]} Replace String
+ Verify Override Message ${ERRORS}[5] ${tc[0]} Replace String
... String MyLibrary2 Std With Name My With Name
No Warning When Custom Library Keyword Is Registered As RunKeyword Variant And It Has Same Name As Std Keyword
@@ -76,10 +76,10 @@ Keyword In More Than One Custom Library And Standard Library
Keywords are first searched from test case file even if they contain dot
${tc} = Check Test Case ${TESTNAME}
- Check log message ${tc.kws[0].kws[0].msgs[0]} Keyword in test case file overriding keyword in my_resource_1
- Check log message ${tc.kws[0].kws[1].kws[0].msgs[0]} Keyword in resource 1
- Check log message ${tc.kws[1].kws[0].msgs[0]} Keyword in test case file overriding keyword in BuiltIn
- Check log message ${tc.kws[1].kws[1].msgs[0]} Using keyword in test case file here!
+ Check log message ${tc[0, 0, 0]} Keyword in test case file overriding keyword in my_resource_1
+ Check log message ${tc[0, 1, 0, 0]} Keyword in resource 1
+ Check log message ${tc[1, 0, 0]} Keyword in test case file overriding keyword in BuiltIn
+ Check log message ${tc[1, 1, 0]} Using keyword in test case file here!
*** Keywords ***
Verify override message
@@ -95,5 +95,5 @@ Verify override message
... To select explicitly, and to get rid of this warning, use either '${ctm long}.${name}'
... or '${std long}.${name}'.
Check Log Message ${error msg} ${expected} WARN
- Check Log Message ${kw.msgs[0]} ${expected} WARN
- Check Log Message ${kw.msgs[1]} Overrides keyword from ${standard} library
+ Check Log Message ${kw[0]} ${expected} WARN
+ Check Log Message ${kw[1]} Overrides keyword from ${standard} library
diff --git a/atest/robot/keywords/keywords_implemented_in_c.robot b/atest/robot/keywords/keywords_implemented_in_c.robot
index 0f44b4e807e..99bd99a9164 100644
--- a/atest/robot/keywords/keywords_implemented_in_c.robot
+++ b/atest/robot/keywords/keywords_implemented_in_c.robot
@@ -5,7 +5,7 @@ Resource atest_resource.robot
*** Test Cases ***
Use with correct arguments
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[-1].msgs[0]} This is a bit weird ...
+ Check Log Message ${tc[-1, 0]} This is a bit weird ...
Use with incorrect arguments
${error} = Set Variable If ${INTERPRETER.is_pypy} or ${INTERPRETER.version_info} >= (3, 7)
diff --git a/atest/robot/keywords/optional_given_when_then.robot b/atest/robot/keywords/optional_given_when_then.robot
index 9f8dd9f884f..5af7f0f4e6e 100644
--- a/atest/robot/keywords/optional_given_when_then.robot
+++ b/atest/robot/keywords/optional_given_when_then.robot
@@ -5,65 +5,81 @@ Resource atest_resource.robot
*** Test Cases ***
In user keyword name with normal arguments
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].full_name} Given we don't drink too many beers
- Should Be Equal ${tc.kws[1].full_name} When we are in
- Should Be Equal ${tc.kws[2].full_name} But we don't drink too many beers
- Should Be Equal ${tc.kws[3].full_name} And time
- Should Be Equal ${tc.kws[4].full_name} Then we get this feature ready today
- Should Be Equal ${tc.kws[5].full_name} and we don't drink too many beers
+ Should Be Equal ${tc[0].full_name} Given we don't drink too many beers
+ Should Be Equal ${tc[1].full_name} When we are in
+ Should Be Equal ${tc[2].full_name} But we don't drink too many beers
+ Should Be Equal ${tc[3].full_name} And time
+ Should Be Equal ${tc[4].full_name} Then we get this feature ready today
+ Should Be Equal ${tc[5].full_name} and we don't drink too many beers
In user keyword name with embedded arguments
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].full_name} Given we are in Berlin city
- Should Be Equal ${tc.kws[1].full_name} When it does not rain
- Should Be Equal ${tc.kws[2].full_name} And we get this feature implemented
- Should Be Equal ${tc.kws[3].full_name} Then we go to walking tour
- Should Be Equal ${tc.kws[4].full_name} but it does not rain
+ Should Be Equal ${tc[0].full_name} Given we are in Berlin city
+ Should Be Equal ${tc[1].full_name} When it does not rain
+ Should Be Equal ${tc[2].full_name} And we get this feature implemented
+ Should Be Equal ${tc[3].full_name} Then we go to walking tour
+ Should Be Equal ${tc[4].full_name} but it does not rain
In library keyword name
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].full_name} BuiltIn.Given Should Be Equal
- Should Be Equal ${tc.kws[1].full_name} BuiltIn.And Should Not Match
- Should Be Equal ${tc.kws[2].full_name} BuiltIn.But Should Match
- Should Be Equal ${tc.kws[3].full_name} BuiltIn.When set test variable
- Should Be Equal ${tc.kws[4].full_name} BuiltIn.THEN should be equal
+ Should Be Equal ${tc[0].full_name} BuiltIn.Given Should Be Equal
+ Should Be Equal ${tc[1].full_name} BuiltIn.And Should Not Match
+ Should Be Equal ${tc[2].full_name} BuiltIn.But Should Match
+ Should Be Equal ${tc[3].full_name} BuiltIn.When set test variable
+ Should Be Equal ${tc[4].full_name} BuiltIn.THEN should be equal
In user keyword in resource file
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].full_name} optional_given_when_then.Given Keyword Is In Resource File
- Should Be Equal ${tc.kws[1].full_name} optional_given_when_then.and another resource file
+ Should Be Equal ${tc[0].full_name} optional_given_when_then.Given Keyword Is In Resource File
+ Should Be Equal ${tc[1].full_name} optional_given_when_then.and another resource file
Correct Name Shown in Keyword Not Found Error
Check Test Case ${TEST NAME}
Keyword can be used with and without prefix
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].full_name} GiveN we don't drink too many beers
- Should Be Equal ${tc.kws[1].full_name} and we don't drink too many beers
- Should Be Equal ${tc.kws[2].full_name} We don't drink too many beers
- Should Be Equal ${tc.kws[3].full_name} When time
- Should Be Equal ${tc.kws[4].full_name} Time
- Should Be Equal ${tc.kws[5].full_name} Then we are in Berlin city
- Should Be Equal ${tc.kws[6].full_name} we are in Berlin city
+ Should Be Equal ${tc[0].full_name} GiveN we don't drink too many beers
+ Should Be Equal ${tc[1].full_name} and we don't drink too many beers
+ Should Be Equal ${tc[2].full_name} We don't drink too many beers
+ Should Be Equal ${tc[3].full_name} When time
+ Should Be Equal ${tc[4].full_name} Time
+ Should Be Equal ${tc[5].full_name} Then we are in Berlin city
+ Should Be Equal ${tc[6].full_name} we are in Berlin city
+
+Only single prefixes are a processed
+ ${tc} = Check Test Case ${TEST NAME}
+ Should Be Equal ${tc[0].full_name} Given we are in Berlin city
+ Should Be Equal ${tc[1].full_name} but then we are in Berlin city
+
+First word of a keyword can be a prefix
+ ${tc} = Check Test Case ${TEST NAME}
+ Should Be Equal ${tc[0].full_name} Given the prefix is part of the keyword
+
+First word in a keyword can be an argument
+ ${tc} = Check Test Case ${TEST NAME}
+ Should Be Equal ${tc[0].full_name} Given we don't drink too many beers
+ Should Be Equal ${tc[1].full_name} Then Pekka drinks lonkero instead
+ Should Be Equal ${tc[2].full_name} and Miikka drinks water instead
+ Should Be Equal ${tc[3].full_name} Étant donné Miikka drinks water instead
Localized prefixes
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].full_name} Oletetaan we don't drink too many beers
- Should Be Equal ${tc.kws[1].full_name} Kun we are in
- Should Be Equal ${tc.kws[2].full_name} mutta we don't drink too many beers
- Should Be Equal ${tc.kws[3].full_name} Ja time
- Should Be Equal ${tc.kws[4].full_name} Niin we get this feature ready today
- Should Be Equal ${tc.kws[5].full_name} ja we don't drink too many beers
+ Should Be Equal ${tc[0].full_name} Oletetaan we don't drink too many beers
+ Should Be Equal ${tc[1].full_name} Kun we are in
+ Should Be Equal ${tc[2].full_name} mutta we don't drink too many beers
+ Should Be Equal ${tc[3].full_name} Ja time
+ Should Be Equal ${tc[4].full_name} Niin we get this feature ready today
+ Should Be Equal ${tc[5].full_name} ja we don't drink too many beers
Prefix consisting of multiple words
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].full_name} Étant donné multipart prefixes didn't work with RF 6.0
- Should Be Equal ${tc.kws[1].full_name} Zakładając, że multipart prefixes didn't work with RF 6.0
- Should Be Equal ${tc.kws[2].full_name} Diyelim ki multipart prefixes didn't work with RF 6.0
- Should Be Equal ${tc.kws[3].full_name} Eğer ki multipart prefixes didn't work with RF 6.0
- Should Be Equal ${tc.kws[4].full_name} O zaman multipart prefixes didn't work with RF 6.0
- Should Be Equal ${tc.kws[5].full_name} В случай че multipart prefixes didn't work with RF 6.0
- Should Be Equal ${tc.kws[6].full_name} Fie ca multipart prefixes didn't work with RF 6.0
+ Should Be Equal ${tc[0].full_name} Étant donné multipart prefixes didn't work with RF 6.0
+ Should Be Equal ${tc[1].full_name} Zakładając, że multipart prefixes didn't work with RF 6.0
+ Should Be Equal ${tc[2].full_name} Diyelim ki multipart prefixes didn't work with RF 6.0
+ Should Be Equal ${tc[3].full_name} Eğer ki multipart prefixes didn't work with RF 6.0
+ Should Be Equal ${tc[4].full_name} O zaman multipart prefixes didn't work with RF 6.0
+ Should Be Equal ${tc[5].full_name} В случай че multipart prefixes didn't work with RF 6.0
+ Should Be Equal ${tc[6].full_name} Fie ca multipart prefixes didn't work with RF 6.0
Prefix must be followed by space
Check Test Case ${TEST NAME}
diff --git a/atest/robot/keywords/positional_only_args.robot b/atest/robot/keywords/positional_only_args.robot
index b6969a820ed..2644754cd9b 100644
--- a/atest/robot/keywords/positional_only_args.robot
+++ b/atest/robot/keywords/positional_only_args.robot
@@ -1,16 +1,18 @@
*** Settings ***
Suite Setup Run Tests ${EMPTY} keywords/positional_only_args.robot
-Force Tags require-py3.8
Resource atest_resource.robot
*** Test Cases ***
Normal usage
Check Test Case ${TESTNAME}
-Named syntax is not used
+Default values
Check Test Case ${TESTNAME}
-Default values
+Positional only value can contain '=' without it being considered named argument
+ Check Test Case ${TESTNAME}
+
+Name of positional only argument can be used with kwargs
Check Test Case ${TESTNAME}
Type conversion
@@ -19,16 +21,9 @@ Type conversion
Too few arguments
Check Test Case ${TESTNAME} 1
Check Test Case ${TESTNAME} 2
+ Check Test Case ${TESTNAME} 3
Too many arguments
Check Test Case ${TESTNAME} 1
Check Test Case ${TESTNAME} 2
-
-Named argument syntax doesn't work after valid named arguments
- Check Test Case ${TESTNAME}
-
-Name can be used with kwargs
- Check Test Case ${TESTNAME}
-
-Mandatory positional-only missing with kwargs
- Check Test Case ${TESTNAME}
+ Check Test Case ${TESTNAME} 3
diff --git a/atest/robot/keywords/private.robot b/atest/robot/keywords/private.robot
index f85ee0a7bec..f8a13aef81c 100644
--- a/atest/robot/keywords/private.robot
+++ b/atest/robot/keywords/private.robot
@@ -5,40 +5,40 @@ Resource atest_resource.robot
*** Test Cases ***
Valid Usage With Local Keyword
${tc}= Check Test Case ${TESTNAME}
- Length Should Be ${tc.body[0].body} 1
+ Length Should Be ${tc[0].body} 1
Invalid Usage With Local Keyword
${tc}= Check Test Case ${TESTNAME}
- Private Call Warning Should Be Private Keyword ${tc.body[0].body[0]} ${ERRORS[0]}
- Length Should Be ${tc.body[0].body} 2
+ Private Call Warning Should Be Private Keyword ${tc[0, 0]} ${ERRORS[0]}
+ Length Should Be ${tc[0].body} 2
Valid Usage With Resource Keyword
${tc}= Check Test Case ${TESTNAME}
- Length Should Be ${tc.body[0].body} 1
+ Length Should Be ${tc[0].body} 1
Invalid Usage With Resource Keyword
${tc}= Check Test Case ${TESTNAME}
- Private Call Warning Should Be private.Private Keyword In Resource ${tc.body[0].body[0]} ${ERRORS[1]}
- Length Should Be ${tc.body[0].body} 2
+ Private Call Warning Should Be private.Private Keyword In Resource ${tc[0, 0]} ${ERRORS[1]}
+ Length Should Be ${tc[0].body} 2
Invalid Usage in Resource File
${tc}= Check Test Case ${TESTNAME}
- Private Call Warning Should Be private2.Private Keyword In Resource 2 ${tc.body[0].body[0].body[0]} ${ERRORS[2]}
- Length Should Be ${tc.body[0].body[0].body} 2
+ Private Call Warning Should Be private2.Private Keyword In Resource 2 ${tc[0, 0, 0]} ${ERRORS[2]}
+ Length Should Be ${tc[0, 0].body} 2
Local Private Keyword In Resource File Has Precedence Over Keywords In Another Resource
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].body[0].body[0].msgs[0]} private.resource
- Check Log Message ${tc.body[0].body[1].body[0].msgs[0]} private.resource
+ Check Log Message ${tc[0, 0, 0, 0]} private.resource
+ Check Log Message ${tc[0, 1, 0, 0]} private.resource
Search Order Has Precedence Over Local Private Keyword In Resource File
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].body[0].body[0].msgs[0]} private2.resource
+ Check Log Message ${tc[0, 0, 0, 0]} private2.resource
Imported Public Keyword Has Precedence Over Imported Private Keywords
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].body[0].msgs[0]} private2.resource
- Check Log Message ${tc.body[1].body[0].body[0].msgs[0]} private2.resource
+ Check Log Message ${tc[0, 0, 0]} private2.resource
+ Check Log Message ${tc[1, 0, 0, 0]} private2.resource
If All Keywords Are Private Raise Multiple Keywords Found
Check Test Case ${TESTNAME}
diff --git a/atest/robot/keywords/trace_log_keyword_arguments.robot b/atest/robot/keywords/trace_log_keyword_arguments.robot
index 2b651548cbe..23523614e19 100644
--- a/atest/robot/keywords/trace_log_keyword_arguments.robot
+++ b/atest/robot/keywords/trace_log_keyword_arguments.robot
@@ -37,6 +37,11 @@ Variable Number of Arguments
... \${mand}='mandatory' | \@{vargs}=[]
... 'mandatory'
+Named only
+ Check Argument Value Trace
+ ... \${no1}='a' | \${no2}='b'
+ ... no1='a' | no2='b'
+
Kwargs
Check Argument Value Trace
... \&{kwargs}={}
@@ -46,8 +51,8 @@ Kwargs
All args
Check Argument Value Trace
- ... \${positional}='1' | \@{varargs}=['2', '3'] | \&{kwargs}={'d': '4'}
- ... '1' | '2' | '3' | d='4'
+ ... \${positional}='1' | \@{varargs}=['2', '3'] | \${named_only}='4' | \&{kwargs}={'free': '5'}
+ ... '1' | '2' | '3' | named_only='4' | free='5'
Non String Object as Argument
Check Argument Value Trace
@@ -68,18 +73,18 @@ Object With Unicode Repr as Argument
Arguments With Run Keyword
${tc}= Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[1].msgs[0]} Arguments: [ '\${keyword name}' | '\@{VALUES}' ] TRACE
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} Arguments: [ 'a' | 'b' | 'c' | 'd' ] TRACE
+ Check Log Message ${tc[1, 0]} Arguments: [ '\${keyword name}' | '\@{VALUES}' ] TRACE
+ Check Log Message ${tc[1, 1, 0]} Arguments: [ 'a' | 'b' | 'c' | 'd' ] TRACE
Embedded Arguments
${tc}= Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Arguments: [ \${first}='foo' | \${second}=42 | \${what}='UK' ] TRACE
- Check Log Message ${tc.kws[1].msgs[0]} Arguments: [ 'bar' | 'Embedded Arguments' ] TRACE
- Check Log Message ${tc.kws[2].msgs[0]} Arguments: [ \${embedded}='embedded' | \${normal}='argument' ] TRACE
- Check Log Message ${tc.kws[3].msgs[0]} Arguments: [ \${embedded}='embedded' | \${normal}='argument' ] TRACE
- FOR ${kw} IN @{tc.kws}
- Check Log Message ${kw.msgs[-1]} Return: None TRACE
- Length Should Be ${kw.msgs} 2
+ Check Log Message ${tc[0, 0]} Arguments: [ \${first}='foo' | \${second}=42 | \${what}='UK' ] TRACE
+ Check Log Message ${tc[1, 0]} Arguments: [ 'bar' | 'Embedded Arguments' ] TRACE
+ Check Log Message ${tc[2, 0]} Arguments: [ \${embedded}='embedded' | \${normal}='argument' ] TRACE
+ Check Log Message ${tc[3, 0]} Arguments: [ \${embedded}='embedded' | \${normal}='argument' ] TRACE
+ FOR ${kw} IN @{tc.body}
+ Check Log Message ${kw[-1]} Return: None TRACE
+ Length Should Be ${kw.messages} 2
END
*** Keywords ***
@@ -88,7 +93,7 @@ Check Argument Value Trace
${tc} = Check Test Case ${TEST NAME}
${length} = Get Length ${expected}
FOR ${index} IN RANGE 0 ${length}
- Check Log Message ${tc.kws[${index}].msgs[0]} Arguments: [ ${expected}[${index}] ] TRACE
+ Check Log Message ${tc[${index}, 0]} Arguments: [ ${expected}[${index}] ] TRACE
END
Check UKW Default, LKW Default, UKW Varargs, and LKW Varargs
diff --git a/atest/robot/keywords/trace_log_return_value.robot b/atest/robot/keywords/trace_log_return_value.robot
index 3bced7ccaa4..acf1d128701 100644
--- a/atest/robot/keywords/trace_log_return_value.robot
+++ b/atest/robot/keywords/trace_log_return_value.robot
@@ -5,35 +5,35 @@ Resource atest_resource.robot
*** Test Cases ***
Return from user keyword
${test} = Check Test Case ${TESTNAME}
- Check Log Message ${test.kws[0].msgs[1]} Return: 'value' TRACE
- Check Log Message ${test.kws[0].kws[0].msgs[1]} Return: 'value' TRACE
+ Check Log Message ${test[0, 3]} Return: 'value' TRACE
+ Check Log Message ${test[0, 1, 1]} Return: 'value' TRACE
Return from library keyword
${test} = Check Test Case ${TESTNAME}
- Check Log Message ${test.kws[0].msgs[1]} Return: 'value' TRACE
+ Check Log Message ${test[0, 1]} Return: 'value' TRACE
Return from Run Keyword
${test} = Check Test Case ${TESTNAME}
- Check Log Message ${test.kws[0].msgs[1]} Return: 'value' TRACE
- Check Log Message ${test.kws[0].kws[0].msgs[1]} Return: 'value' TRACE
+ Check Log Message ${test[0, 2]} Return: 'value' TRACE
+ Check Log Message ${test[0, 1, 1]} Return: 'value' TRACE
Return non-string value
${test} = Check Test Case ${TESTNAME}
- Check Log Message ${test.kws[0].msgs[2]} Return: 1 TRACE
+ Check Log Message ${test[0, 2]} Return: 1 TRACE
Return None
${test} = Check Test Case ${TESTNAME}
- Check Log Message ${test.kws[0].msgs[1]} Return: None TRACE
+ Check Log Message ${test[0, 1]} Return: None TRACE
Return non-ASCII string
${test} = Check Test Case ${TESTNAME}
- Check Log Message ${test.kws[0].msgs[1]} Return: "Hyvää 'Päivää'\\n" TRACE
+ Check Log Message ${test[0, 1]} Return: "Hyvää 'Päivää'\\n" TRACE
Return object with non-ASCII repr
${test} = Check Test Case ${TESTNAME}
- Check Log Message ${test.kws[0].msgs[1]} Return: Hyvä TRACE
+ Check Log Message ${test[0, 1]} Return: Hyvä TRACE
Return object with invalid repr
${test} = Check Test Case ${TESTNAME}
- Check Log Message ${test.kws[0].msgs[1]}
+ Check Log Message ${test[0, 1]}
... Return: TRACE
diff --git a/atest/robot/keywords/type_conversion/annotations.robot b/atest/robot/keywords/type_conversion/annotations.robot
index 7435614728b..ad426e03ecd 100644
--- a/atest/robot/keywords/type_conversion/annotations.robot
+++ b/atest/robot/keywords/type_conversion/annotations.robot
@@ -177,6 +177,9 @@ Invalid frozenset
Unknown types are not converted
Check Test Case ${TESTNAME}
+Unknown types are not converted in union
+ Check Test Case ${TESTNAME}
+
Non-type values don't cause errors
Check Test Case ${TESTNAME}
@@ -216,6 +219,9 @@ None as default with unknown type
Forward references
Check Test Case ${TESTNAME}
+Unknown forward references
+ Check Test Case ${TESTNAME}
+
@keyword decorator overrides annotations
Check Test Case ${TESTNAME}
@@ -239,3 +245,8 @@ Default value is used if explicit type conversion fails
Explicit conversion failure is used if both conversions fail
Check Test Case ${TESTNAME}
+
+Deferred evaluation of annotations
+ [Documentation] https://peps.python.org/pep-0649
+ [Tags] require-py3.14
+ Check Test Case ${TESTNAME}
diff --git a/atest/robot/keywords/type_conversion/annotations_with_typing.robot b/atest/robot/keywords/type_conversion/annotations_with_typing.robot
index bf906b1fc66..90da0f1516e 100644
--- a/atest/robot/keywords/type_conversion/annotations_with_typing.robot
+++ b/atest/robot/keywords/type_conversion/annotations_with_typing.robot
@@ -75,7 +75,10 @@ TypedDict
Stringified TypedDict types
Check Test Case ${TESTNAME}
-Optional TypedDict keys can be omitted
+Optional TypedDict keys can be omitted (total=False)
+ Check Test Case ${TESTNAME}
+
+Not required TypedDict keys can be omitted (NotRequired/Required)
Check Test Case ${TESTNAME}
Required TypedDict keys cannot be omitted
diff --git a/atest/robot/keywords/type_conversion/unions.robot b/atest/robot/keywords/type_conversion/unions.robot
index e0011d8a2ce..d8d9630fe8f 100644
--- a/atest/robot/keywords/type_conversion/unions.robot
+++ b/atest/robot/keywords/type_conversion/unions.robot
@@ -24,6 +24,9 @@ Union with subscripted generics and str
Union with TypedDict
Check Test Case ${TESTNAME}
+Union with str and TypedDict
+ Check Test Case ${TESTNAME}
+
Union with item not liking isinstance
Check Test Case ${TESTNAME}
diff --git a/atest/robot/libdoc/LibDocLib.py b/atest/robot/libdoc/LibDocLib.py
index 9482485f52f..6a4663f61cd 100644
--- a/atest/robot/libdoc/LibDocLib.py
+++ b/atest/robot/libdoc/LibDocLib.py
@@ -3,15 +3,17 @@
import pprint
import shlex
from pathlib import Path
-from subprocess import run, PIPE, STDOUT
+from subprocess import PIPE, run, STDOUT
-from jsonschema import Draft202012Validator
+try:
+ from jsonschema import Draft202012Validator as JSONValidator
+except ImportError:
+ JSONValidator = None
from xmlschema import XMLSchema
from robot.api import logger
-from robot.utils import NOT_SET, SYSTEM_ENCODING
from robot.running.arguments import ArgInfo, TypeInfo
-
+from robot.utils import NOT_SET, SYSTEM_ENCODING
ROOT = Path(__file__).absolute().parent.parent.parent.parent
@@ -20,9 +22,14 @@ class LibDocLib:
def __init__(self, interpreter=None):
self.interpreter = interpreter
- self.xml_schema = XMLSchema(str(ROOT/'doc/schema/libdoc.xsd'))
- with open(ROOT/'doc/schema/libdoc.json') as f:
- self.json_schema = Draft202012Validator(json.load(f))
+ self.xml_schema = XMLSchema(str(ROOT / "doc/schema/libdoc.xsd"))
+ self.json_schema = self._load_json_schema()
+
+ def _load_json_schema(self):
+ if not JSONValidator:
+ return None
+ with open(ROOT / "doc/schema/libdoc.json", encoding="UTF-8") as f:
+ return JSONValidator(json.load(f))
@property
def libdoc(self):
@@ -30,21 +37,28 @@ def libdoc(self):
def run_libdoc(self, args):
cmd = self.libdoc + self._split_args(args)
- cmd[-1] = cmd[-1].replace('/', os.sep)
- logger.info(' '.join(cmd))
- result = run(cmd, cwd=ROOT/'src', stdout=PIPE, stderr=STDOUT,
- encoding=SYSTEM_ENCODING, timeout=120, universal_newlines=True)
+ cmd[-1] = cmd[-1].replace("/", os.sep)
+ logger.info(" ".join(cmd))
+ result = run(
+ cmd,
+ cwd=ROOT / "src",
+ stdout=PIPE,
+ stderr=STDOUT,
+ encoding=SYSTEM_ENCODING,
+ timeout=120,
+ text=True,
+ )
logger.info(result.stdout)
return result.stdout
def _split_args(self, args):
lexer = shlex.shlex(args, posix=True)
- lexer.escape = ''
+ lexer.escape = ""
lexer.whitespace_split = True
return list(lexer)
def get_libdoc_model_from_html(self, path):
- with open(path, encoding='UTF-8') as html_file:
+ with open(path, encoding="UTF-8") as html_file:
model_string = self._find_model(html_file)
model = json.loads(model_string)
logger.info(pprint.pformat(model))
@@ -52,33 +66,46 @@ def get_libdoc_model_from_html(self, path):
def _find_model(self, html_file):
for line in html_file:
- if line.startswith('libdoc = '):
- return line.split('=', 1)[1].strip(' \n;')
- raise RuntimeError('No model found from HTML')
+ if line.startswith("libdoc = "):
+ return line.split("=", 1)[1].strip(" \n;")
+ raise RuntimeError("No model found from HTML")
def validate_xml_spec(self, path):
self.xml_schema.validate(path)
def validate_json_spec(self, path):
- with open(path) as f:
+ if not self.json_schema:
+ raise RuntimeError("jsonschema module is not installed!")
+ with open(path, encoding="UTF-8") as f:
self.json_schema.validate(json.load(f))
def get_repr_from_arg_model(self, model):
- return str(ArgInfo(kind=model['kind'],
- name=model['name'],
- type=self._get_type_info(model['type']),
- default=model['default'] or NOT_SET))
+ return str(
+ ArgInfo(
+ kind=model["kind"],
+ name=model["name"],
+ type=self._get_type_info(model["type"]),
+ default=self._get_default(model["default"]),
+ )
+ )
def get_repr_from_json_arg_model(self, model):
- return str(ArgInfo(kind=model['kind'],
- name=model['name'],
- type=self._get_type_info(model['type']),
- default=model['defaultValue'] or NOT_SET))
+ return str(
+ ArgInfo(
+ kind=model["kind"],
+ name=model["name"],
+ type=self._get_type_info(model["type"]),
+ default=self._get_default(model["defaultValue"]),
+ )
+ )
def _get_type_info(self, data):
if not data:
return None
if isinstance(data, str):
return TypeInfo.from_string(data)
- nested = [self._get_type_info(n) for n in data.get('nested', ())]
- return TypeInfo(data['name'], None, nested=nested or None)
+ nested = [self._get_type_info(n) for n in data.get("nested", ())]
+ return TypeInfo(data["name"], None, nested=nested or None)
+
+ def _get_default(self, data):
+ return data if data is not None else NOT_SET
diff --git a/atest/robot/libdoc/backwards_compatibility.robot b/atest/robot/libdoc/backwards_compatibility.robot
index 587664238ce..029d9dbef29 100644
--- a/atest/robot/libdoc/backwards_compatibility.robot
+++ b/atest/robot/libdoc/backwards_compatibility.robot
@@ -64,14 +64,14 @@ Validate keyword 'Simple'
Keyword Name Should Be 1 Simple
Keyword Doc Should Be 1 Some doc.
Keyword Tags Should Be 1 example
- Keyword Lineno Should Be 1 34
+ Keyword Lineno Should Be 1 31
Keyword Arguments Should Be 1
Validate keyword 'Arguments'
Keyword Name Should Be 0 Arguments
Keyword Doc Should Be 0 ${EMPTY}
Keyword Tags Should Be 0
- Keyword Lineno Should Be 0 42
+ Keyword Lineno Should Be 0 39
Keyword Arguments Should Be 0 a b=2 *c d=4 e **f
Validate keyword 'Types'
diff --git a/atest/robot/libdoc/cli.robot b/atest/robot/libdoc/cli.robot
index 47d18c5aec2..905e60c695d 100644
--- a/atest/robot/libdoc/cli.robot
+++ b/atest/robot/libdoc/cli.robot
@@ -61,6 +61,11 @@ Theme
--theme light String ${OUTHTML} HTML String theme=light
--theme NoNe String ${OUTHTML} HTML String theme=
+Language
+ --language EN String ${OUTHTML} HTML String lang=en
+ --language fI String ${OUTHTML} HTML String lang=fi
+ --language NoNe String ${OUTHTML} HTML String language=
+
Relative path with Python libraries
[Template] NONE
${dir in libdoc exec dir}= Normalize Path ${ROBOTPATH}/../TempDirInExecDir
@@ -86,12 +91,14 @@ Non-existing resource
*** Keywords ***
Run Libdoc And Verify Created Output File
- [Arguments] ${args} ${format} ${name} ${version}= ${path}=${OUTHTML} ${theme}= ${quiet}=False
+ [Arguments] ${args} ${format} ${name} ${version}= ${path}=${OUTHTML} ${theme}= ${lang}= ${quiet}=False
${stdout} = Run Libdoc ${args}
Run Keyword ${format} Doc Should Have Been Created ${path} ${name} ${version}
File Should Have Correct Line Separators ${path}
IF "${theme}"
File Should Contain ${path} "theme": "${theme}"
+ ELSE IF "${lang}"
+ File Should Contain ${path} "lang": "${lang}"
ELSE
File Should Not Contain ${path} "theme":
END
@@ -105,7 +112,7 @@ Run Libdoc And Verify Created Output File
HTML Doc Should Have Been Created
[Arguments] ${path} ${name} ${version}
${libdoc}= Get File ${path}
- Should Start With ${libdoc} ${HTML DOC} HTML --format jSoN --specdocformat hTML DocFormat.py
${HTML DOC}
HTML --format jSoN DocFormat.py
${HTML DOC}
HTML --docfor RoBoT -f JSON -s HTML DocFormatHtml.py
@@ -68,6 +70,7 @@ Format from XML spec
Format from JSON RAW spec
[Template] NONE
+ [Tags] require-jsonschema
Test Format In JSON ${RAW DOC} ROBOT -F Robot -s RAW lib=DocFormat.py
Copy File ${OUTJSON} ${OUTBASE}-2.json
Test Format In JSON
${HTML DOC}
HTML lib=${OUTBASE}-2.json
@@ -80,6 +83,7 @@ Format from LIBSPEC spec
Format from JSON spec
[Template] NONE
+ [Tags] require-jsonschema
Test Format In JSON
${HTML DOC}
HTML -F Robot lib=DocFormat.py
Copy File ${OUTJSON} ${OUTBASE}-2.json
Test Format In JSON
${HTML DOC}
HTML lib=${OUTBASE}-2.json
diff --git a/atest/robot/libdoc/dynamic_library.robot b/atest/robot/libdoc/dynamic_library.robot
index a3adf492b29..ea4698aca0b 100644
--- a/atest/robot/libdoc/dynamic_library.robot
+++ b/atest/robot/libdoc/dynamic_library.robot
@@ -39,7 +39,7 @@ Init arguments
Init Source Info
Keyword Should Not Have Source 0 xpath=inits/init
- Keyword Lineno Should Be 0 9 xpath=inits/init
+ Keyword Lineno Should Be 0 10 xpath=inits/init
Keyword names
Keyword Name Should Be 0 0
@@ -101,7 +101,7 @@ No keyword source info
Keyword source info
Keyword Name Should Be 14 Source Info
Keyword Should Not Have Source 14
- Keyword Lineno Should Be 14 83
+ Keyword Lineno Should Be 14 90
Keyword source info with different path than library
Keyword Name Should Be 16 Source Path Only
diff --git a/atest/robot/libdoc/html_output.robot b/atest/robot/libdoc/html_output.robot
index 94967285a0e..d259c49bc7d 100644
--- a/atest/robot/libdoc/html_output.robot
+++ b/atest/robot/libdoc/html_output.robot
@@ -33,7 +33,7 @@ Keyword Arguments
[Template] Verify Argument Models
${MODEL}[keywords][0][args]
${MODEL}[keywords][1][args] a1=d *a2
- ${MODEL}[keywords][6][args] arg=hyv\\xe4
+ ${MODEL}[keywords][6][args] arg=hyvä
${MODEL}[keywords][9][args] arg=hyvä
${MODEL}[keywords][10][args] a=1 b=True c=(1, 2, None)
${MODEL}[keywords][11][args] arg=\\ robot \\ escapers\\n\\t\\r \\ \\
diff --git a/atest/robot/libdoc/json_output.robot b/atest/robot/libdoc/json_output.robot
index cfcaf4045a2..deec2eb1cf4 100644
--- a/atest/robot/libdoc/json_output.robot
+++ b/atest/robot/libdoc/json_output.robot
@@ -2,6 +2,7 @@
Resource libdoc_resource.robot
Suite Setup Run Libdoc And Parse Model From JSON ${TESTDATADIR}/module.py
Test Template Should Be Equal Multiline
+Test Tags require-jsonschema
*** Test Cases ***
Name
@@ -33,7 +34,7 @@ Keyword Arguments
[Template] Verify Argument Models
${MODEL}[keywords][0][args]
${MODEL}[keywords][1][args] a1=d *a2
- ${MODEL}[keywords][6][args] arg=hyv\\xe4
+ ${MODEL}[keywords][6][args] arg=hyvä
${MODEL}[keywords][9][args] arg=hyvä
${MODEL}[keywords][10][args] a=1 b=True c=(1, 2, None)
${MODEL}[keywords][11][args] arg=\\ robot \\ escapers\\n\\t\\r \\ \\
diff --git a/atest/robot/libdoc/module_library.robot b/atest/robot/libdoc/module_library.robot
index f05c7d6f054..deb44bffdb7 100644
--- a/atest/robot/libdoc/module_library.robot
+++ b/atest/robot/libdoc/module_library.robot
@@ -44,7 +44,7 @@ Keyword Arguments
Keyword Arguments Should Be 12 a b *args **kwargs
Non-ASCII Bytes Defaults
- Keyword Arguments Should Be 6 arg=hyv\\xe4
+ Keyword Arguments Should Be 6 arg=hyvä
Non-ASCII String Defaults
Keyword Arguments Should Be 9 arg=hyvä
@@ -100,9 +100,9 @@ Keyword tags
Keyword source info
Keyword Name Should Be 0 Get Hello
Keyword Should Not Have Source 0
- Keyword Lineno Should Be 0 17
+ Keyword Lineno Should Be 0 16
Keyword source info with decorated function
Keyword Name Should Be 13 Takes \${embedded} \${args}
Keyword Should Not Have Source 13
- Keyword Lineno Should Be 13 71
+ Keyword Lineno Should Be 13 70
diff --git a/atest/robot/libdoc/python_library.robot b/atest/robot/libdoc/python_library.robot
index e0d09b4c784..73f295ed31a 100644
--- a/atest/robot/libdoc/python_library.robot
+++ b/atest/robot/libdoc/python_library.robot
@@ -26,7 +26,7 @@ Scope
Source info
Source should be ${CURDIR}/../../../src/robot/libraries/Telnet.py
- Lineno should be 36
+ Lineno should be 37
Spec version
Spec version should be correct
@@ -45,7 +45,7 @@ Init Arguments
Init Source Info
Keyword Should Not Have Source 0 xpath=inits/init
- Keyword Lineno Should Be 0 281 xpath=inits/init
+ Keyword Lineno Should Be 0 283 xpath=inits/init
Keyword Names
Keyword Name Should Be 0 Close All Connections
@@ -76,39 +76,38 @@ Keyword Source Info
# This keyword is from the "main library".
Keyword Name Should Be 0 Close All Connections
Keyword Should Not Have Source 0
- Keyword Lineno Should Be 0 470
+ Keyword Lineno Should Be 0 513
# This keyword is from an external library component.
Keyword Name Should Be 7 Read Until Prompt
Keyword Should Not Have Source 7
- Keyword Lineno Should Be 7 1009
+ Keyword Lineno Should Be 7 1083
KwArgs and VarArgs
- Run Libdoc And Parse Output Process
- Keyword Name Should Be 7 Run Process
- Keyword Arguments Should Be 7 command *arguments **configuration
+ Run Libdoc And Parse Output ${TESTDATADIR}/KwArgs.py
+ Keyword Arguments Should Be 2 *varargs **kwargs
+ Keyword Arguments Should Be 3 a / b c=d *e f g=h **i
Keyword-only Arguments
- Run Libdoc And Parse Output ${TESTDATADIR}/KeywordOnlyArgs.py
+ Run Libdoc And Parse Output ${TESTDATADIR}/KwArgs.py
Keyword Arguments Should Be 0 * kwo
Keyword Arguments Should Be 1 *varargs kwo another=default
Positional-only Arguments
- [Tags] require-py3.8
Run Libdoc And Parse Output ${DATADIR}/keywords/PositionalOnly.py
- Keyword Arguments Should Be 2 arg /
+ Keyword Arguments Should Be 1 arg /
Keyword Arguments Should Be 5 posonly / normal
Keyword Arguments Should Be 0 required optional=default /
- Keyword Arguments Should Be 4 first: int second: float /
+ Keyword Arguments Should Be 3 first: int second: float /
Decorators
Run Libdoc And Parse Output ${TESTDATADIR}/Decorators.py
Keyword Name Should Be 0 Keyword Using Decorator
Keyword Arguments Should Be 0 *args **kwargs
Keyword Should Not Have Source 0
- Keyword Lineno Should Be 0 8
+ Keyword Lineno Should Be 0 7
Keyword Name Should Be 1 Keyword Using Decorator With Wraps
Keyword Arguments Should Be 1 args are preserved=True
- Keyword Lineno Should Be 1 26
+ Keyword Lineno Should Be 1 27
Documentation set in __init__
Run Libdoc And Parse Output ${TESTDATADIR}/DocSetInInit.py
@@ -135,3 +134,8 @@ Deprecation
...
... RF and Libdoc don't consider this being deprecated.
Keyword Should Not Be Deprecated 3
+
+NOT_SET as default value
+ Run Libdoc And Parse Output Collections
+ Keyword Name Should Be 17 Get From Dictionary
+ Keyword Arguments Should Be 17 dictionary key default=
diff --git a/atest/robot/libdoc/return_type_json.robot b/atest/robot/libdoc/return_type_json.robot
index 9a2851643ee..2a2de45eff5 100644
--- a/atest/robot/libdoc/return_type_json.robot
+++ b/atest/robot/libdoc/return_type_json.robot
@@ -2,6 +2,7 @@
Suite Setup Run Libdoc And Parse Model From JSON ${TESTDATADIR}/ReturnType.py
Test Template Return type should be
Resource libdoc_resource.robot
+Test Tags require-jsonschema
*** Test Cases ***
No return
diff --git a/atest/robot/output/LegacyOutputHelper.py b/atest/robot/output/LegacyOutputHelper.py
index 2713985be77..f9e558a5ccf 100644
--- a/atest/robot/output/LegacyOutputHelper.py
+++ b/atest/robot/output/LegacyOutputHelper.py
@@ -2,12 +2,12 @@
def mask_changing_parts(path):
- with open(path) as file:
+ with open(path, encoding="UTF-8") as file:
content = file.read()
for pattern, replace in [
(r'"20\d{6} \d{2}:\d{2}:\d{2}\.\d{3}"', '"[timestamp]"'),
(r'generator=".*?"', 'generator="[generator]"'),
- (r'source=".*?"', 'source="[source]"')
+ (r'source=".*?"', 'source="[source]"'),
]:
content = re.sub(pattern, replace, content)
return content
diff --git a/atest/robot/output/LogDataFinder.py b/atest/robot/output/LogDataFinder.py
index 18f11d08051..98d731cf595 100644
--- a/atest/robot/output/LogDataFinder.py
+++ b/atest/robot/output/LogDataFinder.py
@@ -26,25 +26,27 @@ def get_all_stats(path):
def _get_output_line(path, prefix):
- logger.info("Getting '%s' from '%s'."
- % (prefix, path, path), html=True)
- prefix += ' = '
- with open(path, encoding='UTF-8') as file:
+ logger.info(
+ f"Getting '{prefix}' from '{path}'.",
+ html=True,
+ )
+ prefix += " = "
+ with open(path, encoding="UTF-8") as file:
for line in file:
if line.startswith(prefix):
- logger.info('Found: %s' % line)
- return line[len(prefix):-2]
+ logger.info(f"Found: {line}")
+ return line[len(prefix) : -2]
def verify_stat(stat, *attrs):
- stat.pop('elapsed')
+ stat.pop("elapsed")
expected = dict(_get_expected_stat(attrs))
if stat != expected:
- raise WrongStat('\n%-9s: %s\n%-9s: %s' % ('Got', stat, 'Expected', expected))
+ raise WrongStat(f"\nGot : {stat}\nExpected : {expected}")
def _get_expected_stat(attrs):
- for key, value in (a.split(':', 1) for a in attrs):
+ for key, value in (a.split(":", 1) for a in attrs):
value = int(value) if value.isdigit() else str(value)
yield str(key), value
diff --git a/atest/robot/output/flatten_keyword.robot b/atest/robot/output/flatten_keyword.robot
index 008427d710f..fb9a6b5e3c1 100644
--- a/atest/robot/output/flatten_keyword.robot
+++ b/atest/robot/output/flatten_keyword.robot
@@ -14,145 +14,131 @@ ${ERROR} [ ERROR ] Invalid value for option '--flattenkeywords': Expected
*** Test Cases ***
Non-matching keyword is not flattened
- Should Be Equal ${TC.kws[0].message} ${EMPTY}
- Should Be Equal ${TC.kws[0].doc} Doc of keyword 2
- Length Should Be ${TC.kws[0].kws} 2
- Length Should Be ${TC.kws[0].msgs} 0
- Check Log Message ${TC.kws[0].kws[0].msgs[0]} 2
- Check Log Message ${TC.kws[0].kws[1].kws[1].msgs[0]} 1
+ Should Be Equal ${TC[0].message} ${EMPTY}
+ Should Be Equal ${TC[0].doc} Doc of keyword 2
+ Check Counts ${TC[0]} 0 2
+ Check Log Message ${TC[0, 0, 0]} 2
+ Check Log Message ${TC[0, 1, 1, 0]} 1
Exact match
- Should Be Equal ${TC.kws[1].message} *HTML* ${FLATTENED}
- Should Be Equal ${TC.kws[1].doc} Doc of keyword 3
- Length Should Be ${TC.kws[1].kws} 0
- Length Should Be ${TC.kws[1].msgs} 3
- Check Log Message ${TC.kws[1].msgs[0]} 3
- Check Log Message ${TC.kws[1].msgs[1]} 2
- Check Log Message ${TC.kws[1].msgs[2]} 1
+ Should Be Equal ${TC[1].message} *HTML* ${FLATTENED}
+ Should Be Equal ${TC[1].doc} Doc of keyword 3
+ Check Counts ${TC[1]} 3
+ Check Log Message ${TC[1, 0]} 3
+ Check Log Message ${TC[1, 1]} 2
+ Check Log Message ${TC[1, 2]} 1
Pattern match
- Should Be Equal ${TC.kws[2].message} *HTML* ${FLATTENED}
- Should Be Equal ${TC.kws[2].doc} ${EMPTY}
- Length Should Be ${TC.kws[2].kws} 0
- Length Should Be ${TC.kws[2].msgs} 6
- Check Log Message ${TC.kws[2].msgs[0]} 3
- Check Log Message ${TC.kws[2].msgs[1]} 2
- Check Log Message ${TC.kws[2].msgs[2]} 1
- Check Log Message ${TC.kws[2].msgs[3]} 2
- Check Log Message ${TC.kws[2].msgs[4]} 1
- Check Log Message ${TC.kws[2].msgs[5]} 1
+ Should Be Equal ${TC[2].message} *HTML* ${FLATTENED}
+ Should Be Equal ${TC[2].doc} ${EMPTY}
+ Check Counts ${TC[2]} 6
+ Check Log Message ${TC[2, 0]} 3
+ Check Log Message ${TC[2, 1]} 2
+ Check Log Message ${TC[2, 2]} 1
+ Check Log Message ${TC[2, 3]} 2
+ Check Log Message ${TC[2, 4]} 1
+ Check Log Message ${TC[2, 5]} 1
Tag match when keyword has no message
- Should Be Equal ${TC.kws[5].message} *HTML* ${FLATTENED}
- Should Be Equal ${TC.kws[5].doc} ${EMPTY}
- Length Should Be ${TC.kws[5].kws} 0
- Length Should Be ${TC.kws[5].msgs} 1
+ Should Be Equal ${TC[5].message} *HTML* ${FLATTENED}
+ Should Be Equal ${TC[5].doc} ${EMPTY}
+ Check Counts ${TC[5]} 1
Tag match when keyword has message
- Should Be Equal ${TC.kws[6].message} *HTML* Expected e&<aped failure!${FLATTENED}
- Should Be Equal ${TC.kws[6].doc} Doc of flat keyword.
- Length Should Be ${TC.kws[6].kws} 0
- Length Should Be ${TC.kws[6].msgs} 1
+ Should Be Equal ${TC[6].message} *HTML* Expected e&<aped failure!${FLATTENED}
+ Should Be Equal ${TC[6].doc} Doc of flat keyword.
+ Check Counts ${TC[6]} 1
Match full name
- Should Be Equal ${TC.kws[3].message} *HTML* ${FLATTENED}
- Should Be Equal ${TC.kws[3].doc} Logs the given message with the given level.
- Length Should Be ${TC.kws[3].kws} 0
- Length Should Be ${TC.kws[3].msgs} 1
- Check Log Message ${TC.kws[3].msgs[0]} Flatten me too!!
+ Should Be Equal ${TC[3].message} *HTML* ${FLATTENED}
+ Should Be Equal ${TC[3].doc} Logs the given message with the given level.
+ Check Counts ${TC[3]} 1
+ Check Log Message ${TC[3, 0]} Flatten me too!!
Flattened in log after execution
- Should Contain ${LOG} "*Content flattened."
+ Should Contain ${LOG} "*Content flattened."
Flatten controls in keyword
${tc} = Check Test Case ${TEST NAME}
- Length Should Be ${tc.body[0].body.filter(messages=False)} 0
- Length Should Be ${tc.body[0].body.filter(messages=True)} 23
- Length Should Be ${tc.body[0].body} 23
+ Check Counts ${tc[0]} 23
@{expected} = Create List
... Outside IF Inside IF 1 Nested IF
... 3 2 1 BANG!
... FOR: 0 1 FOR: 1 1 FOR: 2 1
... WHILE: 2 1 \${i} = 1 WHILE: 1 1 \${i} = 0
... AssertionError 1 finally
- FOR ${msg} ${exp} IN ZIP ${tc.body[0].body} ${expected}
+ FOR ${msg} ${exp} IN ZIP ${tc[0].body} ${expected}
Check Log Message ${msg} ${exp} level=IGNORE
END
Flatten FOR
Run Rebot --flatten For ${OUTFILE COPY}
${tc} = Check Test Case FOR loop
- Should Be Equal ${tc.kws[0].type} FOR
- Should Be Equal ${tc.kws[0].message} *HTML* ${FLATTENED}
- Length Should Be ${tc.kws[0].kws} 0
- Length Should Be ${tc.kws[0].msgs} 60
+ Should Be Equal ${tc[0].type} FOR
+ Should Be Equal ${tc[0].message} *HTML* ${FLATTENED}
+ Check Counts ${tc[0]} 60
FOR ${index} IN RANGE 10
- Check Log Message ${tc.kws[0].msgs[${index * 6 + 0}]} index: ${index}
- Check Log Message ${tc.kws[0].msgs[${index * 6 + 1}]} 3
- Check Log Message ${tc.kws[0].msgs[${index * 6 + 2}]} 2
- Check Log Message ${tc.kws[0].msgs[${index * 6 + 3}]} 1
- Check Log Message ${tc.kws[0].msgs[${index * 6 + 4}]} 2
- Check Log Message ${tc.kws[0].msgs[${index * 6 + 5}]} 1
+ Check Log Message ${tc[0, ${index * 6 + 0}]} index: ${index}
+ Check Log Message ${tc[0, ${index * 6 + 1}]} 3
+ Check Log Message ${tc[0, ${index * 6 + 2}]} 2
+ Check Log Message ${tc[0, ${index * 6 + 3}]} 1
+ Check Log Message ${tc[0, ${index * 6 + 4}]} 2
+ Check Log Message ${tc[0, ${index * 6 + 5}]} 1
END
Flatten FOR iterations
Run Rebot --flatten ForItem ${OUTFILE COPY}
${tc} = Check Test Case FOR loop
- Should Be Equal ${tc.kws[0].type} FOR
- Should Be Equal ${tc.kws[0].message} ${EMPTY}
- Length Should Be ${tc.kws[0].kws} 10
- Should Be Empty ${tc.kws[0].msgs}
+ Should Be Equal ${tc[0].type} FOR
+ Should Be Equal ${tc[0].message} ${EMPTY}
+ Check Counts ${tc[0]} 0 10
FOR ${index} IN RANGE 10
- Should Be Equal ${tc.kws[0].kws[${index}].type} ITERATION
- Should Be Equal ${tc.kws[0].kws[${index}].message} *HTML* ${FLATTENED}
- Length Should Be ${tc.kws[0].kws[${index}].kws} 0
- Length Should Be ${tc.kws[0].kws[${index}].msgs} 6
- Check Log Message ${tc.kws[0].kws[${index}].msgs[0]} index: ${index}
- Check Log Message ${tc.kws[0].kws[${index}].msgs[1]} 3
- Check Log Message ${tc.kws[0].kws[${index}].msgs[2]} 2
- Check Log Message ${tc.kws[0].kws[${index}].msgs[3]} 1
- Check Log Message ${tc.kws[0].kws[${index}].msgs[4]} 2
- Check Log Message ${tc.kws[0].kws[${index}].msgs[5]} 1
+ Should Be Equal ${tc[0, ${index}].type} ITERATION
+ Should Be Equal ${tc[0, ${index}].message} *HTML* ${FLATTENED}
+ Check Counts ${tc[0, ${index}]} 6
+ Check Log Message ${tc[0, ${index}, 0]} index: ${index}
+ Check Log Message ${tc[0, ${index}, 1]} 3
+ Check Log Message ${tc[0, ${index}, 2]} 2
+ Check Log Message ${tc[0, ${index}, 3]} 1
+ Check Log Message ${tc[0, ${index}, 4]} 2
+ Check Log Message ${tc[0, ${index}, 5]} 1
END
Flatten WHILE
Run Rebot --flatten WHile ${OUTFILE COPY}
${tc} = Check Test Case WHILE loop
- Should Be Equal ${tc.body[1].type} WHILE
- Should Be Equal ${tc.body[1].message} *HTML* ${FLATTENED}
- Length Should Be ${tc.body[1].kws} 0
- Length Should Be ${tc.body[1].msgs} 70
+ Should Be Equal ${tc[1].type} WHILE
+ Should Be Equal ${tc[1].message} *HTML* ${FLATTENED}
+ Check Counts ${tc[1]} 70
FOR ${index} IN RANGE 10
- Check Log Message ${tc.body[1].msgs[${index * 7 + 0}]} index: ${index}
- Check Log Message ${tc.body[1].msgs[${index * 7 + 1}]} 3
- Check Log Message ${tc.body[1].msgs[${index * 7 + 2}]} 2
- Check Log Message ${tc.body[1].msgs[${index * 7 + 3}]} 1
- Check Log Message ${tc.body[1].msgs[${index * 7 + 4}]} 2
- Check Log Message ${tc.body[1].msgs[${index * 7 + 5}]} 1
+ Check Log Message ${tc[1, ${index * 7 + 0}]} index: ${index}
+ Check Log Message ${tc[1, ${index * 7 + 1}]} 3
+ Check Log Message ${tc[1, ${index * 7 + 2}]} 2
+ Check Log Message ${tc[1, ${index * 7 + 3}]} 1
+ Check Log Message ${tc[1, ${index * 7 + 4}]} 2
+ Check Log Message ${tc[1, ${index * 7 + 5}]} 1
${i}= Evaluate $index + 1
- Check Log Message ${tc.body[1].msgs[${index * 7 + 6}]} \${i} = ${i}
+ Check Log Message ${tc[1, ${index * 7 + 6}]} \${i} = ${i}
END
Flatten WHILE iterations
Run Rebot --flatten iteration ${OUTFILE COPY}
${tc} = Check Test Case WHILE loop
- Should Be Equal ${tc.body[1].type} WHILE
- Should Be Equal ${tc.body[1].message} ${EMPTY}
- Length Should Be ${tc.body[1].body} 10
- Should Be Empty ${tc.body[1].msgs}
+ Should Be Equal ${tc[1].type} WHILE
+ Should Be Equal ${tc[1].message} ${EMPTY}
+ Check Counts ${tc[1]} 0 10
FOR ${index} IN RANGE 10
- Should Be Equal ${tc.kws[1].kws[${index}].type} ITERATION
- Should Be Equal ${tc.kws[1].kws[${index}].message} *HTML* ${FLATTENED}
- Length Should Be ${tc.kws[1].kws[${index}].kws} 0
- Length Should Be ${tc.kws[1].kws[${index}].msgs} 7
- Check Log Message ${tc.kws[1].kws[${index}].msgs[0]} index: ${index}
- Check Log Message ${tc.kws[1].kws[${index}].msgs[1]} 3
- Check Log Message ${tc.kws[1].kws[${index}].msgs[2]} 2
- Check Log Message ${tc.kws[1].kws[${index}].msgs[3]} 1
- Check Log Message ${tc.kws[1].kws[${index}].msgs[4]} 2
- Check Log Message ${tc.kws[1].kws[${index}].msgs[5]} 1
+ Should Be Equal ${tc[1, ${index}].type} ITERATION
+ Should Be Equal ${tc[1, ${index}].message} *HTML* ${FLATTENED}
+ Check Counts ${tc[1, ${index}]} 7
+ Check Log Message ${tc[1, ${index}, 0]} index: ${index}
+ Check Log Message ${tc[1, ${index}, 1]} 3
+ Check Log Message ${tc[1, ${index}, 2]} 2
+ Check Log Message ${tc[1, ${index}, 3]} 1
+ Check Log Message ${tc[1, ${index}, 4]} 2
+ Check Log Message ${tc[1, ${index}, 5]} 1
${i}= Evaluate $index + 1
- Check Log Message ${tc.kws[1].kws[${index}].msgs[6]} \${i} = ${i}
+ Check Log Message ${tc[1, ${index}, 6]} \${i} = ${i}
END
Invalid usage
@@ -170,3 +156,8 @@ Run And Rebot Flattened
Run Rebot ${FLATTEN} ${OUTFILE COPY}
${TC} = Check Test Case Flatten stuff
Set Suite Variable $TC
+
+Check Counts
+ [Arguments] ${item} ${messages} ${non_messages}=0
+ Length Should Be ${item.messages} ${messages}
+ Length Should Be ${item.non_messages} ${non_messages}
diff --git a/atest/robot/output/json_output.robot b/atest/robot/output/json_output.robot
new file mode 100644
index 00000000000..d703bf2b8ec
--- /dev/null
+++ b/atest/robot/output/json_output.robot
@@ -0,0 +1,42 @@
+*** Settings ***
+Documentation JSON output is tested in detailed level using unit tests.
+Resource atest_resource.robot
+
+*** Variables ***
+${JSON} %{TEMPDIR}/output.json
+${XML} %{TEMPDIR}/output.xml
+
+*** Test Cases ***
+JSON output contains same suite information as XML output
+ Run Tests ${EMPTY} misc
+ Copy File ${OUTFILE} ${XML}
+ Run Tests Without Processing Output -o ${JSON} misc
+ Outputs Should Contain Same Data ${JSON} ${XML} ignore_timestamps=True
+
+JSON output structure
+ [Documentation] Full JSON schema validation would be good, but it's too slow with big output files.
+ ... The test after this one validates a smaller suite against a schema.
+ ${data} = Evaluate json.load(open($JSON, encoding='UTF-8'))
+ Lists Should Be Equal ${data} ${{['generator', 'generated', 'rpa', 'suite', 'statistics', 'errors']}}
+ Should Match ${data}[generator] Robot ?.* (* on *)
+ Should Match ${data}[generated] 20??-??-??T??:??:??.??????
+ Should Be Equal ${data}[rpa] ${False}
+ Should Be Equal ${data}[suite][name] Misc
+ Should Be Equal ${data}[suite][suites][1][name] Everything
+ Should Be Equal ${data}[statistics][total][skip] ${3}
+ Should Be Equal ${data}[statistics][tags][4][label] f1
+ Should Be Equal ${data}[statistics][suites][-1][id] s1-s17
+ Should Be Equal ${data}[errors][0][level] ERROR
+
+JSON output matches schema
+ [Tags] require-jsonschema
+ Run Tests Without Processing Output -o OUT.JSON misc/everything.robot
+ Validate JSON Output ${OUTDIR}/OUT.JSON
+
+Invalid JSON output file
+ ${path} = Normalize Path ${JSON}
+ Remove File ${path}
+ Create Directory ${path}
+ Run Tests Without Processing Output -o ${path} misc/pass_and_fail.robot
+ Stderr Should Match [[] ERROR ] Opening output file '${path}' failed: *${USAGE TIP}\n
+ [Teardown] Remove Directory ${JSON}
diff --git a/atest/robot/output/legacy_output.robot b/atest/robot/output/legacy_output.robot
index 2f69f066d83..017cf0cc68a 100644
--- a/atest/robot/output/legacy_output.robot
+++ b/atest/robot/output/legacy_output.robot
@@ -11,6 +11,13 @@ Legacy output with Rebot
Run Tests ${EMPTY} output/legacy.robot
Copy Previous Outfile
Run Rebot --legacy-output ${OUTFILE COPY} validate output=False
+ Validate output
+
+Legacy output with Rebot when all times are not set
+ Run Rebot --legacy-output --test Passing ${OUTFILE COPY} validate output=False
+ Should Be Equal ${SUITE.start_time} ${None}
+ Should Be Equal ${SUITE.end_time} ${None}
+ Should Contain Tests ${SUITE} Passing
*** Keywords ***
Validate output
diff --git a/atest/robot/output/listener_interface/body_items_v3.robot b/atest/robot/output/listener_interface/body_items_v3.robot
index 97c2f53cb6e..fab0a6ee538 100644
--- a/atest/robot/output/listener_interface/body_items_v3.robot
+++ b/atest/robot/output/listener_interface/body_items_v3.robot
@@ -7,7 +7,7 @@ ${SOURCE} output/listener_interface/body_items_v3/tests.robot
${MODIFIER} output/listener_interface/body_items_v3/Modifier.py
@{ALL TESTS} Library keyword User keyword Non-existing keyword
... Empty keyword Duplicate keyword Invalid keyword
-... IF TRY FOR WHILE VAR RETURN
+... IF TRY FOR WHILE WHILE with modified limit VAR RETURN
... Invalid syntax Run Keyword
*** Test Cases ***
@@ -25,40 +25,47 @@ Modify invalid keyword
Modify keyword results
${tc} = Get Test Case Invalid keyword
- Check Keyword Data ${tc.body[0]} Invalid keyword
+ Check Keyword Data ${tc[0]} Invalid keyword
... args=\${secret}
... tags=end, fixed, start
... doc=Results can be modified both in start and end!
Modify FOR
${tc} = Check Test Case FOR FAIL Listener failed me at 'b'!
- Length Should Be ${tc.body[0].body} 2
- Should Be Equal ${tc.body[0].assign}[0] secret
- Should Be Equal ${tc.body[0].body[0].assign}[\${x}] xxx
- Should Be Equal ${tc.body[0].body[1].assign}[\${x}] xxx
+ Length Should Be ${tc[0].body} 2
+ Should Be Equal ${tc[0].assign}[0] secret
+ Should Be Equal ${tc[0, 0].assign}[\${x}] xxx
+ Should Be Equal ${tc[0, 1].assign}[\${x}] xxx
Modify WHILE
${tc} = Check Test Case WHILE FAIL Fail at iteration 10.
- Length Should Be ${tc.body[0].body} 10
+ Length Should Be ${tc[0].body} 10
+
+Modify WHILE limit
+ ${tc} = Check Test Case WHILE with modified limit PASS ${EMPTY}
+ Length Should Be ${tc[1].body} 3
+ Check Log Message ${tc[1, 0, 0, 0]} \${x} = 1
+ Check Log Message ${tc[1, 1, 0, 0]} \${x} = 2
+ Check Log Message ${tc[1, 2]} Modified limit message.
Modify IF
${tc} = Check Test Case IF FAIL Executed!
- Should Be Equal ${tc.body[0].body[0].message} Secret message!
- Should Be Equal ${tc.body[0].body[1].message} Secret message!
- Should Be Equal ${tc.body[0].body[2].message} Executed!
+ Should Be Equal ${tc[0, 0].message} Secret message!
+ Should Be Equal ${tc[0, 1].message} Secret message!
+ Should Be Equal ${tc[0, 2].message} Executed!
Modify TRY
${tc} = Check Test Case TRY FAIL Not caught!
- Length Should Be ${tc.body[0].body} 3
+ Length Should Be ${tc[0].body} 3
Modify VAR
${tc} = Check Test Case VAR FAIL value != VAR by listener
- Should Be Equal ${tc.body[0].value}[0] secret
- Should Be Equal ${tc.body[1].value}[0] secret
+ Should Be Equal ${tc[0].value}[0] secret
+ Should Be Equal ${tc[1].value}[0] secret
Modify RETURN
${tc} = Check Test Case RETURN FAIL RETURN by listener != value
- Should Be Equal ${tc.body[0].body[1].values}[0] secret
+ Should Be Equal ${tc[0, 1].values}[0] secret
Validate that all methods are called correctly
Run Tests --variable VALIDATE_EVENTS:True ${SOURCE}
diff --git a/atest/robot/output/listener_interface/change_status.robot b/atest/robot/output/listener_interface/change_status.robot
new file mode 100644
index 00000000000..be97fe5db3f
--- /dev/null
+++ b/atest/robot/output/listener_interface/change_status.robot
@@ -0,0 +1,73 @@
+*** Settings ***
+Suite Setup Run Tests --listener ${DATADIR}/${MODIFIER} ${SOURCE}
+Resource atest_resource.robot
+
+*** Variables ***
+${SOURCE} output/listener_interface/body_items_v3/change_status.robot
+${MODIFIER} output/listener_interface/body_items_v3/ChangeStatus.py
+
+*** Test Cases ***
+Fail to pass
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Fail args=Pass me! status=PASS message=Failure hidden!
+ Check Log Message ${tc[0, 0]} Pass me! level=FAIL
+ Check Keyword Data ${tc[1]} BuiltIn.Log args=I'm run. status=PASS message=
+
+Pass to fail
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Log args=Fail me! status=FAIL message=Ooops!!
+ Check Log Message ${tc[0, 0]} Fail me! level=INFO
+ Check Keyword Data ${tc[1]} BuiltIn.Log args=I'm not run. status=NOT RUN message=
+
+Pass to fail without a message
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Log args=Silent fail! status=FAIL message=
+ Check Keyword Data ${tc[1]} BuiltIn.Log args=I'm not run. status=NOT RUN message=
+
+Skip to fail
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Skip args=Fail me! status=FAIL message=Failing!
+ Check Log Message ${tc[0, 0]} Fail me! level=SKIP
+ Check Keyword Data ${tc[1]} BuiltIn.Log args=I'm not run. status=NOT RUN message=
+
+Fail to skip
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Fail args=Skip me! status=SKIP message=Skipping!
+ Check Log Message ${tc[0, 0]} Skip me! level=FAIL
+ Check Keyword Data ${tc[1]} BuiltIn.Log args=I'm not run. status=NOT RUN message=
+
+Not run to fail
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Log args=Fail me! status=FAIL message=Ooops!!
+ Check Keyword Data ${tc[1]} BuiltIn.Log args=I'm not run. status=NOT RUN message=
+ Check Keyword Data ${tc[2]} BuiltIn.Log args=Fail me! status=FAIL message=Failing without running!
+ Check Keyword Data ${tc[3]} BuiltIn.Log args=I'm not run. status=NOT RUN message=
+
+Pass and fail to not run
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Log args=Mark not run! status=NOT RUN message=
+ Check Keyword Data ${tc[1]} BuiltIn.Fail args=Mark not run! status=NOT RUN message=Mark not run!
+ Check Keyword Data ${tc[2]} BuiltIn.Fail args=I fail! status=FAIL message=I fail!
+
+Only message
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Fail args=Change me! status=FAIL message=Changed!
+ Check Keyword Data ${tc[1]} Change message status=NOT RUN message=Changed!
+
+Control structures
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Control Structure ${tc[0]} FOR
+ Check Control Structure ${tc[1]} WHILE
+ Check Control Structure ${tc[2]} IF/ELSE ROOT
+ Check Control Structure ${tc[3]} TRY/EXCEPT ROOT
+
+*** Keywords ***
+Check Control Structure
+ [Arguments] ${item} ${type}
+ VAR ${msg} Handled on ${type} level.
+ Should Be Equal ${item.type} ${type}
+ Should Be Equal ${item.status} PASS
+ Should Be Equal ${item.message} ${msg}
+ Should Be Equal ${item[0].status} FAIL
+ Should Be Equal ${item[0].message} ${msg}
+ Check Keyword Data ${item[0, 0]} BuiltIn.Fail args=${msg} status=FAIL message=${msg}
diff --git a/atest/robot/output/listener_interface/keyword_arguments_v3.robot b/atest/robot/output/listener_interface/keyword_arguments_v3.robot
index 8ab077c3698..09b8b7d26b1 100644
--- a/atest/robot/output/listener_interface/keyword_arguments_v3.robot
+++ b/atest/robot/output/listener_interface/keyword_arguments_v3.robot
@@ -7,49 +7,46 @@ ${SOURCE} output/listener_interface/body_items_v3/keyword_arguments.robo
${MODIFIER} output/listener_interface/body_items_v3/ArgumentModifier.py
*** Test Cases ***
-Arguments as strings
+Library keyword arguments
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.body[0]} Library.Library Keyword
+ Check Keyword Data ${tc[0]} Library.Library Keyword
... args=\${STATE}, number=\${123}, obj=None, escape=c:\\\\temp\\\\new
- Check Keyword Data ${tc.body[1]} Library.Library Keyword
+ Check Keyword Data ${tc[1]} Library.Library Keyword
... args=new, 123, c:\\\\temp\\\\new, NONE
+ Check Keyword Data ${tc[2]} Library.Library Keyword
+ ... args=new, number=\${42}, escape=c:\\\\temp\\\\new, obj=Object(42)
+ Check Keyword Data ${tc[3]} Library.Library Keyword
+ ... args=number=1.0, escape=c:\\\\temp\\\\new, obj=Object(1), state=new
-Arguments as tuples
+User keyword arguments
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.body[0]} Library.Library Keyword
- ... args=\${STATE}, escape=c:\\\\temp\\\\new, obj=Object(123), number=\${123}
- Check Keyword Data ${tc.body[1]} Library.Library Keyword
- ... args=new, 1.0, obj=Object(1), escape=c:\\\\temp\\\\new
+ Check Keyword Data ${tc[0]} User keyword
+ ... args=A, B, C, D
+ Check Keyword Data ${tc[1]} User keyword
+ ... args=A, B, d=D, c=\${{"c".upper()}}
-Arguments directly as positional and named
- ${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.body[0]} Library.Library Keyword
- ... args=\${XXX}, 456, c:\\temp\\new, obj=Object(456)
- Check Keyword Data ${tc.body[1]} Library.Library Keyword
- ... args=state=\${XXX}, obj=Object(1), number=1.0, escape=c:\\temp\\new
+Invalid keyword arguments
+ ${tc} = Check Test Case Library keyword arguments
+ Check Keyword Data ${tc[4]} Non-existing
+ ... args=p, n=1 status=FAIL
Too many arguments
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.body[0]} Library.Library Keyword
+ Check Keyword Data ${tc[0]} Library.Library Keyword
+ ... args=a, b, c, d, e, f, g status=FAIL
+ Check Keyword Data ${tc[1]} User keyword
... args=a, b, c, d, e, f, g status=FAIL
- Check Keyword Data ${tc.body[1]} Library.Library Keyword
+ Check Keyword Data ${tc[2]} Library.Library Keyword
... args=${{', '.join(str(i) for i in range(100))}} status=FAIL
Conversion error
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.body[0]} Library.Library Keyword
+ Check Keyword Data ${tc[0]} Library.Library Keyword
... args=whatever, not a number status=FAIL
- Check Keyword Data ${tc.body[1]} Library.Library Keyword
+ Check Keyword Data ${tc[1]} Library.Library Keyword
... args=number=bad status=FAIL
-Named argument not matching
- ${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.body[0]} Library.Library Keyword
- ... args=no=match status=FAIL
- Check Keyword Data ${tc.body[1]} Library.Library Keyword
- ... args=o, k, bad=name status=FAIL
-
Positional after named
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.body[0]} Library.Library Keyword
- ... args=positional, name=value, ooops status=FAIL
+ Check Keyword Data ${tc[0]} Library.Library Keyword
+ ... args=positional, number=-1, ooops status=FAIL
diff --git a/atest/robot/output/listener_interface/listener_failing.robot b/atest/robot/output/listener_interface/listener_failing.robot
index 9fd5417ac19..da2f6870fb2 100644
--- a/atest/robot/output/listener_interface/listener_failing.robot
+++ b/atest/robot/output/listener_interface/listener_failing.robot
@@ -43,7 +43,7 @@ Listener errors should be reported
Library listener errors should be reported
FOR ${index} ${method} IN ENUMERATE
- ... start_suite start_test start_keyword log_message
+ ... message start_suite start_test start_keyword log_message
... end_keyword end_test end_suite
Error should be reported in execution errors ${index} ${method} failing_listener
END
diff --git a/atest/robot/output/listener_interface/listener_logging.robot b/atest/robot/output/listener_interface/listener_logging.robot
index 9a4a4978cea..bbeafc6c077 100644
--- a/atest/robot/output/listener_interface/listener_logging.robot
+++ b/atest/robot/output/listener_interface/listener_logging.robot
@@ -10,16 +10,29 @@ Logging from listener does not break output file
All start and end methods can log warnings to execution errors
Correct warnings should be shown in execution errors
-Methods inside start_keyword and end_keyword can log normal messages
+Methods under tests can log normal messages
Correct messages should be logged to normal log
-Methods outside start_keyword and end_keyword can log messages to syslog
+Methods outside tests can log messages to syslog
+ Correct messages should be logged to syslog
+
+Logging from listener when using JSON output
+ [Setup] Run Tests With Logging Listener format=json
+ Test statuses should be correct
+ Log and report should be created
+ Correct messages should be logged to normal log
+ Correct warnings should be shown in execution errors
Correct messages should be logged to syslog
*** Keywords ***
Run Tests With Logging Listener
- ${path} = Normalize Path ${LISTENER DIR}/logging_listener.py
- Run Tests --listener ${path} -l l.html -r r.html misc/pass_and_fail.robot
+ [Arguments] ${format}=xml
+ Should Be True $format in ('xml', 'json')
+ VAR ${output} ${OUTDIR}/output.${format}
+ VAR ${options}
+ ... --listener ${LISTENER DIR}/logging_listener.py
+ ... -o ${output} -l l.html -r r.html
+ Run Tests ${options} misc/pass_and_fail.robot output=${output}
Test statuses should be correct
Check Test Case Pass
@@ -49,6 +62,8 @@ Correct start/end warnings should be shown in execution errors
... @{setup}
... start_test
... @{uk}
+ ... start keyword start keyword end keyword end keyword
+ ... @{kw}
... end_test
... start_test
... @{uk}
@@ -71,70 +86,79 @@ Get start/end messages
Correct messages should be logged to normal log
'My Keyword' has correct messages ${SUITE.setup} Suite Setup
${tc} = Check Test Case Pass
- 'My Keyword' has correct messages ${tc.kws[0]} Pass
+ Check Log Message ${tc[0]} start_test INFO
+ Check Log Message ${tc[1]} start_test WARN
+ 'My Keyword' has correct messages ${tc[2]} Pass
+ Check Log Message ${tc[5]} end_test INFO
+ Check Log Message ${tc[6]} end_test WARN
${tc} = Check Test Case Fail
- 'My Keyword' has correct messages ${tc.kws[0]} Fail
- 'Fail' has correct messages ${tc.kws[1]}
+ Check Log Message ${tc[0]} start_test INFO
+ Check Log Message ${tc[1]} start_test WARN
+ 'My Keyword' has correct messages ${tc[2]} Fail
+ 'Fail' has correct messages ${tc[3]}
+ Check Log Message ${tc[4]} end_test INFO
+ Check Log Message ${tc[5]} end_test WARN
'My Keyword' has correct messages
[Arguments] ${kw} ${name}
IF '${name}' == 'Suite Setup'
- ${type} = Set Variable setup
+ VAR ${type} setup
ELSE
- ${type} = Set Variable keyword
+ VAR ${type} keyword
END
- Check Log Message ${kw.body[0]} start ${type} INFO
- Check Log Message ${kw.body[1]} start ${type} WARN
- Check Log Message ${kw.body[2].body[0]} start keyword INFO
- Check Log Message ${kw.body[2].body[1]} start keyword WARN
- Check Log Message ${kw.body[2].body[2]} log_message: INFO Hello says "${name}"! INFO
- Check Log Message ${kw.body[2].body[3]} log_message: INFO Hello says "${name}"! WARN
- Check Log Message ${kw.body[2].body[4]} Hello says "${name}"! INFO
- Check Log Message ${kw.body[2].body[5]} end keyword INFO
- Check Log Message ${kw.body[2].body[6]} end keyword WARN
- Check Log Message ${kw.body[3].body[0]} start keyword INFO
- Check Log Message ${kw.body[3].body[1]} start keyword WARN
- Check Log Message ${kw.body[3].body[2]} end keyword INFO
- Check Log Message ${kw.body[3].body[3]} end keyword WARN
- Check Log Message ${kw.body[4].body[0]} start keyword INFO
- Check Log Message ${kw.body[4].body[1]} start keyword WARN
- Check Log Message ${kw.body[4].body[2]} log_message: INFO \${assign} = JUST TESTING... INFO
- Check Log Message ${kw.body[4].body[3]} log_message: INFO \${assign} = JUST TESTING... WARN
- Check Log Message ${kw.body[4].body[4]} \${assign} = JUST TESTING... INFO
- Check Log Message ${kw.body[4].body[5]} end keyword INFO
- Check Log Message ${kw.body[4].body[6]} end keyword WARN
- Check Log Message ${kw.body[5].body[0]} start var INFO
- Check Log Message ${kw.body[5].body[1]} start var WARN
- Check Log Message ${kw.body[5].body[2]} end var INFO
- Check Log Message ${kw.body[5].body[3]} end var WARN
- Check Log Message ${kw.body[6].body[0]} start keyword INFO
- Check Log Message ${kw.body[6].body[1]} start keyword WARN
- Check Log Message ${kw.body[6].body[2]} end keyword INFO
- Check Log Message ${kw.body[6].body[3]} end keyword WARN
- Check Log Message ${kw.body[7].body[0]} start return INFO
- Check Log Message ${kw.body[7].body[1]} start return WARN
- Check Log Message ${kw.body[7].body[2]} end return INFO
- Check Log Message ${kw.body[7].body[3]} end return WARN
- Check Log Message ${kw.body[8]} end ${type} INFO
- Check Log Message ${kw.body[9]} end ${type} WARN
+ Check Log Message ${kw[0]} start ${type} INFO
+ Check Log Message ${kw[1]} start ${type} WARN
+ Check Log Message ${kw[2, 0]} start keyword INFO
+ Check Log Message ${kw[2, 1]} start keyword WARN
+ Check Log Message ${kw[2, 2]} log_message: INFO Hello says "${name}"! INFO
+ Check Log Message ${kw[2, 3]} log_message: INFO Hello says "${name}"! WARN
+ Check Log Message ${kw[2, 4]} Hello says "${name}"! INFO
+ Check Log Message ${kw[2, 5]} end keyword INFO
+ Check Log Message ${kw[2, 6]} end keyword WARN
+ Check Log Message ${kw[3, 0]} start keyword INFO
+ Check Log Message ${kw[3, 1]} start keyword WARN
+ Check Log Message ${kw[3, 2]} end keyword INFO
+ Check Log Message ${kw[3, 3]} end keyword WARN
+ Check Log Message ${kw[4, 0]} start keyword INFO
+ Check Log Message ${kw[4, 1]} start keyword WARN
+ Check Log Message ${kw[4, 2]} log_message: INFO \${assign} = JUST TESTING... INFO
+ Check Log Message ${kw[4, 3]} log_message: INFO \${assign} = JUST TESTING... WARN
+ Check Log Message ${kw[4, 4]} \${assign} = JUST TESTING... INFO
+ Check Log Message ${kw[4, 5]} end keyword INFO
+ Check Log Message ${kw[4, 6]} end keyword WARN
+ Check Log Message ${kw[5, 0]} start var INFO
+ Check Log Message ${kw[5, 1]} start var WARN
+ Check Log Message ${kw[5, 2]} log_message: INFO \${expected} = JUST TESTING... INFO
+ Check Log Message ${kw[5, 3]} log_message: INFO \${expected} = JUST TESTING... WARN
+ Check Log Message ${kw[5, 4]} \${expected} = JUST TESTING... INFO
+ Check Log Message ${kw[5, 5]} end var INFO
+ Check Log Message ${kw[5, 6]} end var WARN
+ Check Log Message ${kw[6, 0]} start keyword INFO
+ Check Log Message ${kw[6, 1]} start keyword WARN
+ Check Log Message ${kw[6, 2]} end keyword INFO
+ Check Log Message ${kw[6, 3]} end keyword WARN
+ Check Log Message ${kw[7, 0]} start return INFO
+ Check Log Message ${kw[7, 1]} start return WARN
+ Check Log Message ${kw[7, 2]} end return INFO
+ Check Log Message ${kw[7, 3]} end return WARN
+ Check Log Message ${kw[8]} end ${type} INFO
+ Check Log Message ${kw[9]} end ${type} WARN
'Fail' has correct messages
[Arguments] ${kw}
- Check Log Message ${kw.body[0]} start keyword INFO
- Check Log Message ${kw.body[1]} start keyword WARN
- Check Log Message ${kw.body[2]} log_message: FAIL Expected failure INFO
- Check Log Message ${kw.body[3]} log_message: FAIL Expected failure WARN
- Check Log Message ${kw.body[4]} Expected failure FAIL
- Check Log Message ${kw.body[5]} end keyword INFO
- Check Log Message ${kw.body[6]} end keyword WARN
+ Check Log Message ${kw[0]} start keyword INFO
+ Check Log Message ${kw[1]} start keyword WARN
+ Check Log Message ${kw[2]} log_message: FAIL Expected failure INFO
+ Check Log Message ${kw[3]} log_message: FAIL Expected failure WARN
+ Check Log Message ${kw[4]} Expected failure FAIL
+ Check Log Message ${kw[5]} end keyword INFO
+ Check Log Message ${kw[6]} end keyword WARN
Correct messages should be logged to syslog
FOR ${msg} IN
... message: INFO Robot Framework
... start_suite
... end_suite
- ... start_test
- ... end_test
... output_file
... log_file
... report_file
diff --git a/atest/robot/output/listener_interface/listener_methods.robot b/atest/robot/output/listener_interface/listener_methods.robot
index f9ad98177f9..b97e6414441 100644
--- a/atest/robot/output/listener_interface/listener_methods.robot
+++ b/atest/robot/output/listener_interface/listener_methods.robot
@@ -47,8 +47,8 @@ Keyword Status
Executing Keywords from Listeners
Run Tests --listener listeners.KeywordExecutingListener misc/pass_and_fail.robot
${tc}= Get Test Case Pass
- Check Log Message ${tc.kws[0].msgs[0]} Start Pass
- Check Log Message ${tc.kws[2].msgs[0]} End Pass
+ Check Log Message ${tc[0, 0]} Start Pass
+ Check Log Message ${tc[4, 0]} End Pass
Test Template
${listener} = Normalize Path ${LISTENER DIR}/verify_template_listener.py
@@ -94,63 +94,74 @@ Check Listen All File
@{expected}= Create List Got settings on level: INFO
... SUITE START: Pass And Fail (s1) 'Some tests here' [ListenerMeta: Hello]
... SETUP START: My Keyword ['Suite Setup'] (line 3)
- ... KEYWORD START: BuiltIn.Log ['Hello says "\${who}"!', '\${LEVEL1}'] (line 27)
+ ... KEYWORD START: BuiltIn.Log ['Hello says "\${who}"!', '\${LEVEL1}'] (line 31)
... LOG MESSAGE: [INFO] Hello says "Suite Setup"!
... KEYWORD END: PASS
- ... KEYWORD START: BuiltIn.Log ['Debug message', '\${LEVEL2}'] (line 28)
+ ... KEYWORD START: BuiltIn.Log ['Debug message', '\${LEVEL2}'] (line 32)
... KEYWORD END: PASS
- ... KEYWORD START: \${assign} = String.Convert To Upper Case ['Just testing...'] (line 29)
+ ... KEYWORD START: \${assign} = String.Convert To Upper Case ['Just testing...'] (line 33)
... LOG MESSAGE: [INFO] \${assign} = JUST TESTING...
... KEYWORD END: PASS
- ... VAR START: \${expected}${SPACE*4}JUST TESTING... (line 30)
+ ... VAR START: \${expected}${SPACE*4}JUST TESTING... (line 34)
+ ... LOG MESSAGE: [INFO] \${expected} = JUST TESTING...
... VAR END: PASS
- ... KEYWORD START: BuiltIn.Should Be Equal ['\${assign}', '\${expected}'] (line 31)
+ ... KEYWORD START: BuiltIn.Should Be Equal ['\${assign}', '\${expected}'] (line 35)
... KEYWORD END: PASS
- ... RETURN START: (line 32)
+ ... RETURN START: (line 36)
... RETURN END: PASS
... SETUP END: PASS
- ... TEST START: Pass (s1-t1, line 12) '' ['force', 'pass']
- ... KEYWORD START: My Keyword ['Pass'] (line 15)
- ... KEYWORD START: BuiltIn.Log ['Hello says "\${who}"!', '\${LEVEL1}'] (line 27)
+ ... TEST START: Pass (s1-t1, line 14) '' ['force', 'pass']
+ ... KEYWORD START: My Keyword ['Pass'] (line 17)
+ ... KEYWORD START: BuiltIn.Log ['Hello says "\${who}"!', '\${LEVEL1}'] (line 31)
... LOG MESSAGE: [INFO] Hello says "Pass"!
... KEYWORD END: PASS
- ... KEYWORD START: BuiltIn.Log ['Debug message', '\${LEVEL2}'] (line 28)
+ ... KEYWORD START: BuiltIn.Log ['Debug message', '\${LEVEL2}'] (line 32)
... KEYWORD END: PASS
- ... KEYWORD START: \${assign} = String.Convert To Upper Case ['Just testing...'] (line 29)
+ ... KEYWORD START: \${assign} = String.Convert To Upper Case ['Just testing...'] (line 33)
... LOG MESSAGE: [INFO] \${assign} = JUST TESTING...
... KEYWORD END: PASS
- ... VAR START: \${expected}${SPACE*4}JUST TESTING... (line 30)
+ ... VAR START: \${expected}${SPACE*4}JUST TESTING... (line 34)
+ ... LOG MESSAGE: [INFO] \${expected} = JUST TESTING...
... VAR END: PASS
- ... KEYWORD START: BuiltIn.Should Be Equal ['\${assign}', '\${expected}'] (line 31)
+ ... KEYWORD START: BuiltIn.Should Be Equal ['\${assign}', '\${expected}'] (line 35)
... KEYWORD END: PASS
- ... RETURN START: (line 32)
+ ... RETURN START: (line 36)
... RETURN END: PASS
... KEYWORD END: PASS
+ ... KEYWORD START: example.Resource Keyword (line 18)
+ ... KEYWORD START: BuiltIn.Log ['Hello, resource!'] (line 3)
+ ... LOG MESSAGE: [INFO] Hello, resource!
+ ... KEYWORD END: PASS
+ ... KEYWORD END: PASS
+ ... KEYWORD START: BuiltIn.Should Be Equal ['\${VARIABLE}', 'From variables.py with arg 1'] (line 19)
+ ... KEYWORD END: PASS
... TEST END: PASS
- ... TEST START: Fail (s1-t2, line 17) 'FAIL Expected failure' ['fail', 'force']
- ... KEYWORD START: My Keyword ['Fail'] (line 20)
- ... KEYWORD START: BuiltIn.Log ['Hello says "\${who}"!', '\${LEVEL1}'] (line 27)
+ ... TEST START: Fail (s1-t2, line 21) 'FAIL Expected failure' ['fail', 'force']
+ ... KEYWORD START: My Keyword ['Fail'] (line 24)
+ ... KEYWORD START: BuiltIn.Log ['Hello says "\${who}"!', '\${LEVEL1}'] (line 31)
... LOG MESSAGE: [INFO] Hello says "Fail"!
... KEYWORD END: PASS
- ... KEYWORD START: BuiltIn.Log ['Debug message', '\${LEVEL2}'] (line 28)
+ ... KEYWORD START: BuiltIn.Log ['Debug message', '\${LEVEL2}'] (line 32)
... KEYWORD END: PASS
- ... KEYWORD START: \${assign} = String.Convert To Upper Case ['Just testing...'] (line 29)
+ ... KEYWORD START: \${assign} = String.Convert To Upper Case ['Just testing...'] (line 33)
... LOG MESSAGE: [INFO] \${assign} = JUST TESTING...
... KEYWORD END: PASS
- ... VAR START: \${expected}${SPACE*4}JUST TESTING... (line 30)
+ ... VAR START: \${expected}${SPACE*4}JUST TESTING... (line 34)
+ ... LOG MESSAGE: [INFO] \${expected} = JUST TESTING...
... VAR END: PASS
- ... KEYWORD START: BuiltIn.Should Be Equal ['\${assign}', '\${expected}'] (line 31)
+ ... KEYWORD START: BuiltIn.Should Be Equal ['\${assign}', '\${expected}'] (line 35)
... KEYWORD END: PASS
- ... RETURN START: (line 32)
+ ... RETURN START: (line 36)
... RETURN END: PASS
... KEYWORD END: PASS
- ... KEYWORD START: BuiltIn.Fail ['Expected failure'] (line 21)
+ ... KEYWORD START: BuiltIn.Fail ['Expected failure'] (line 25)
... LOG MESSAGE: [FAIL] Expected failure
... KEYWORD END: FAIL
... TEST END: FAIL Expected failure
... SUITE END: FAIL 2 tests, 1 passed, 1 failed
... Output: output.xml Closing...
Check Listener File ${filename} @{expected}
+ Stderr Should Be Empty
Calling listener failed
[Arguments] ${method} ${error}
diff --git a/atest/robot/output/listener_interface/listener_order.robot b/atest/robot/output/listener_interface/listener_order.robot
new file mode 100644
index 00000000000..162b4a50154
--- /dev/null
+++ b/atest/robot/output/listener_interface/listener_order.robot
@@ -0,0 +1,57 @@
+*** Settings ***
+Suite Setup Run Tests With Ordered Listeners
+Resource atest_resource.robot
+
+*** Variables ***
+${LISTENER} ${DATADIR}/output/listener_interface/ListenerOrder.py
+
+*** Test Cases ***
+Validate normal order
+ VAR ${expected}
+ ... LIB 3 (999.9): start_suite
+ ... CLI 2 (3.14): start_suite
+ ... CLI 3 (None): start_suite
+ ... LIB 1 (0): start_suite
+ ... LIB 2 (None): start_suite
+ ... CLI 1 (-1): start_suite
+ ... LIB 3 (999.9): log_message
+ ... CLI 2 (3.14): log_message
+ ... CLI 3 (None): log_message
+ ... LIB 1 (0): log_message
+ ... LIB 2 (None): log_message
+ ... CLI 1 (-1): log_message
+ ... LIB 3 (999.9): end_test
+ ... CLI 2 (3.14): end_test
+ ... CLI 3 (None): end_test
+ ... LIB 1 (0): end_test
+ ... LIB 2 (None): end_test
+ ... CLI 1 (-1): end_test
+ ... separator=\n
+ File Should Be Equal To %{TEMPDIR}/listener_order.log ${expected}\n
+
+Validate close order
+ [Documentation] Library listeners are closed when libraries go out of scope.
+ VAR ${expected}
+ ... LIB 1 (0): close
+ ... LIB 2 (None): close
+ ... LIB 3 (999.9): close
+ ... CLI 2 (3.14): close
+ ... CLI 3 (None): close
+ ... CLI 1 (-1): close
+ ... separator=\n
+ File Should Be Equal To %{TEMPDIR}/listener_close_order.log ${expected}\n
+
+Invalid priority
+ ${listener} = Normalize Path ${LISTENER}
+ Check Log Message ${ERRORS}[0] Taking listener '${listener}:NOT USED:invalid' into use failed: Invalid listener priority 'invalid'. ERROR
+ Check Log Message ${ERRORS}[1] Error in library 'BAD': Registering listeners failed: Taking listener 'SELF' into use failed: Invalid listener priority 'bad'. ERROR
+
+*** Keywords ***
+Run Tests With Ordered Listeners
+ ${listener} = Normalize Path ${LISTENER}
+ VAR ${options}
+ ... --listener "${listener}:CLI 1:-1"
+ ... --listener "${listener}:CLI 2:3.14"
+ ... --listener "${listener}:NOT USED:invalid"
+ ... --listener "${listener}:CLI 3"
+ Run Tests ${options} output/listener_interface/listener_order.robot
diff --git a/atest/robot/output/listener_interface/listener_v3.robot b/atest/robot/output/listener_interface/listener_v3.robot
index b736343b180..031dd246aaa 100644
--- a/atest/robot/output/listener_interface/listener_v3.robot
+++ b/atest/robot/output/listener_interface/listener_v3.robot
@@ -1,5 +1,5 @@
*** Settings ***
-Suite Setup Run Tests --listener ${LISTENER DIR}/v3.py -l l -r r -b d -x x misc/pass_and_fail.robot
+Suite Setup Run Tests --listener ${LISTENER DIR}/v3.py -l l -r r -b d -x x -L trace misc/pass_and_fail.robot
Resource listener_resource.robot
*** Variables ***
@@ -8,11 +8,11 @@ ${SEPARATOR} ${EMPTY + '-' * 78}
*** Test Cases ***
New tests and keywords can be added
${tc} = Check test case Added by start_suite [start suite] FAIL [start] [end]
- Check keyword data ${tc.kws[0]} BuiltIn.No Operation
+ Check keyword data ${tc[0]} BuiltIn.No Operation
${tc} = Check test case Added by startTest PASS Dynamically added! [end]
- Check keyword data ${tc.kws[0]} BuiltIn.Fail args=Dynamically added! status=FAIL
+ Check keyword data ${tc[0]} BuiltIn.Fail args=Dynamically added! status=FAIL
${tc} = Check test case Added by end_Test FAIL [start] [end]
- Check keyword data ${tc.kws[0]} BuiltIn.Log args=Dynamically added!, INFO
+ Check keyword data ${tc[0]} BuiltIn.Log args=Dynamically added!, INFO
Stdout Should Contain SEPARATOR=\n
... Added by start_suite [start suite] :: [start suite] ${SPACE*17} | FAIL |
... [start] [end]
@@ -63,13 +63,35 @@ Changing current element docs does not change console output, but does change ou
Check Test Doc Pass [start suite] [start suite] [start test] [end test]
Log messages and timestamps can be changed
- ${tc} = Get test case Pass [start suite]
- Check log message ${tc.kws[0].kws[0].msgs[0]} HELLO SAYS "PASS"!
- Should be equal ${tc.kws[0].kws[0].msgs[0].timestamp} ${datetime(2015, 12, 16, 15, 51, 20, 141000)}
+ ${tc} = Get Test Case Pass [start suite]
+ Check Keyword Data ${tc[0, 0]} BuiltIn.Log args=Hello says "\${who}"!, \${LEVEL1}
+ Check Log Message ${tc[0, 0, 0]} HELLO SAYS "PASS"!
+ Should Be Equal ${tc[0, 0, 0].timestamp} ${datetime(2015, 12, 16, 15, 51, 20, 141000)}
+
+Log message can be removed by setting message to `None`
+ ${tc} = Get Test Case Fail [start suite]
+ Check Keyword Data ${tc[0, 0]} BuiltIn.Log args=Hello says "\${who}"!, \${LEVEL1}
+ Should Be Empty ${tc[0, 0].body}
+ File Should Not Contain ${OUTDIR}/d.txt HELLO SAYS "FAIL"!
+ File Should Not Contain ${OUTDIR}/d.txt None
Syslog messages can be changed
Syslog Should Contain Match 2015-12-16 15:51:20.141000 | INFO \ | TESTS EXECUTION ENDED. STATISTICS:
+Library import
+ Stdout Should Contain Imported library 'BuiltIn' with 107 keywords.
+ Stdout Should Contain Imported library 'String' with 32 keywords.
+ ${tc} = Get Test Case Pass [start suite]
+ Check Keyword Data ${tc[0, 0]} BuiltIn.Log doc=Changed! args=Hello says "\${who}"!, \${LEVEL1}
+
+Resource import
+ Stdout Should Contain Imported resource 'example' with 2 keywords.
+ ${tc} = Get Test Case Pass [start suite]
+ Check Keyword Data ${tc[1, 1]} example.New! doc=Dynamically created.
+
+Variables import
+ Stdout Should Contain Imported variables 'variables.py' without much info.
+
File methods and close are called
Stderr Should Be Equal To SEPARATOR=\n
... Debug: d.txt
@@ -78,3 +100,9 @@ File methods and close are called
... Log: l.html
... Report: r.html
... Close\n
+
+File methods when files are disabled
+ Run Tests Without Processing Output --listener ${LISTENER DIR}/v3.py -o NONE -r NONE -l NONE misc/pass_and_fail.robot
+ Stderr Should Be Equal To SEPARATOR=\n
+ ... Output: None
+ ... Close\n
diff --git a/atest/robot/output/listener_interface/log_levels.robot b/atest/robot/output/listener_interface/log_levels.robot
index 56c3a12f050..3bf2727bb0e 100644
--- a/atest/robot/output/listener_interface/log_levels.robot
+++ b/atest/robot/output/listener_interface/log_levels.robot
@@ -11,10 +11,14 @@ Log messages are collected on INFO level by default
Logged messages should be
... INFO: Hello says "Suite Setup"!
... INFO: \${assign} = JUST TESTING...
+ ... INFO: \${expected} = JUST TESTING...
... INFO: Hello says "Pass"!
... INFO: \${assign} = JUST TESTING...
+ ... INFO: \${expected} = JUST TESTING...
+ ... INFO: Hello, resource!
... INFO: Hello says "Fail"!
... INFO: \${assign} = JUST TESTING...
+ ... INFO: \${expected} = JUST TESTING...
... FAIL: Expected failure
Log messages are collected on specified level
@@ -23,18 +27,25 @@ Log messages are collected on specified level
... INFO: Hello says "Suite Setup"!
... DEBUG: Debug message
... INFO: \${assign} = JUST TESTING...
+ ... INFO: \${expected} = JUST TESTING...
... DEBUG: Argument types are:
...
...
... INFO: Hello says "Pass"!
... DEBUG: Debug message
... INFO: \${assign} = JUST TESTING...
+ ... INFO: \${expected} = JUST TESTING...
+ ... DEBUG: Argument types are:
+ ...
+ ...
+ ... INFO: Hello, resource!
... DEBUG: Argument types are:
...
...
... INFO: Hello says "Fail"!
... DEBUG: Debug message
... INFO: \${assign} = JUST TESTING...
+ ... INFO: \${expected} = JUST TESTING...
... DEBUG: Argument types are:
...
...
diff --git a/atest/robot/output/listener_interface/output_files.robot b/atest/robot/output/listener_interface/output_files.robot
index c03b1afa115..f75323b1188 100644
--- a/atest/robot/output/listener_interface/output_files.robot
+++ b/atest/robot/output/listener_interface/output_files.robot
@@ -1,7 +1,6 @@
*** Settings ***
Documentation Testing that listener gets information about different output files.
... Tests also that the listener can be taken into use with path.
-Suite Setup Run Some Tests
Suite Teardown Remove Listener Files
Resource listener_resource.robot
@@ -9,23 +8,38 @@ Resource listener_resource.robot
${LISTENERS} ${CURDIR}${/}..${/}..${/}..${/}testresources${/}listeners
*** Test Cases ***
-Output Files
- ${file} = Get Listener File ${ALL_FILE}
- ${expected} = Catenate SEPARATOR=\n
+Output files
+ ${options} = Catenate
+ ... --listener "${LISTENERS}${/}ListenAll.py"
+ ... --output myout.xml
+ ... --report myrep.html
+ ... --log mylog.html
+ ... --xunit myxun.xml
+ ... --debugfile mydeb.txt
+ Run Tests ${options} misc/pass_and_fail.robot output=${OUTDIR}/myout.xml
+ Validate result files
... Debug: mydeb.txt
... Output: myout.xml
+ ... Xunit: myxun.xml
... Log: mylog.html
... Report: myrep.html
- ... Closing...\n
- Should End With ${file} ${expected}
-*** Keywords ***
-Run Some Tests
+Output files disabled
${options} = Catenate
- ... --listener "${LISTENERS}${/}ListenAll.py"
- ... --log mylog.html
- ... --report myrep.html
- ... --output myout.xml
- ... --debugfile mydeb.txt
- Run Tests ${options} misc/pass_and_fail.robot output=${OUTDIR}/myout.xml
- Should Be Equal ${SUITE.name} Pass And Fail
+ ... --listener "${LISTENERS}${/}ListenAll.py:output_file_disabled=True"
+ ... --log NONE
+ ... --report NONE
+ ... --output NONE
+ Run Tests Without Processing Output ${options} misc/pass_and_fail.robot
+ Validate result files
+ ... Output: None
+
+*** Keywords ***
+Validate result files
+ [Arguments] @{files}
+ ${file} = Get Listener File ${ALL_FILE}
+ ${expected} = Catenate SEPARATOR=\n
+ ... @{files}
+ ... Closing...\n
+ Should End With ${file} ${expected}
+ Stderr Should Be Empty
diff --git a/atest/robot/output/listener_interface/recursion.robot b/atest/robot/output/listener_interface/recursion.robot
new file mode 100644
index 00000000000..2b951649ca0
--- /dev/null
+++ b/atest/robot/output/listener_interface/recursion.robot
@@ -0,0 +1,41 @@
+*** Settings ***
+Suite Setup Run Tests --listener ${LISTENER DIR}/Recursion.py ${LISTENER DIR}/recursion.robot
+Resource listener_resource.robot
+
+*** Test Cases ***
+Limited recursion in start_keyword, end_keyword and log_message
+ ${tc} = Check Test Case Limited recursion
+ Length Should Be ${tc.body} 1
+ VAR ${kw} ${tc[0]}
+ Check Keyword Data ${kw} BuiltIn.Log args=Limited 3 children=5
+ Check Keyword Data ${kw[0]} BuiltIn.Log args=Limited 2 (by start_keyword) children=4
+ Check Keyword Data ${kw[0, 0]} BuiltIn.Log args=Limited 1 (by start_keyword) children=1
+ Check Log Message ${kw[0, 0, 0]} Limited 1 (by start_keyword)
+ Check Log Message ${kw[0, 1]} Limited 1 (by log_message)
+ Check Log Message ${kw[0, 2]} Limited 2 (by start_keyword)
+ Check Keyword Data ${kw[0, 3]} BuiltIn.Log args=Limited 1 (by end_keyword) children=1
+ Check Log Message ${kw[0, 3, 0]} Limited 1 (by end_keyword)
+ Check Log Message ${kw[1]} Limited 1 (by log_message)
+ Check Log Message ${kw[2]} Limited 2 (by log_message)
+ Check Log Message ${kw[3]} Limited 3
+ Check Keyword Data ${kw[4]} BuiltIn.Log args=Limited 2 (by end_keyword) children=4
+ Check Keyword Data ${kw[4, 0]} BuiltIn.Log args=Limited 1 (by start_keyword) children=1
+ Check Log Message ${kw[4, 0, 0]} Limited 1 (by start_keyword)
+ Check Log Message ${kw[4, 1]} Limited 1 (by log_message)
+ Check Log Message ${kw[4, 2]} Limited 2 (by end_keyword)
+ Check Keyword Data ${kw[4, 3]} BuiltIn.Log args=Limited 1 (by end_keyword) children=1
+ Check Log Message ${kw[4, 3, 0]} Limited 1 (by end_keyword)
+
+Unlimited recursion in start_keyword, end_keyword and log_message
+ Check Test Case Unlimited recursion
+ Check Recursion Error ${ERRORS[0]} start_keyword Recursive execution stopped.
+ Check Recursion Error ${ERRORS[1]} end_keyword Recursive execution stopped.
+ Check Recursion Error ${ERRORS[2]} log_message RecursionError: *
+
+*** Keywords ***
+Check Recursion Error
+ [Arguments] ${msg} ${method} ${error}
+ ${listener} = Normalize Path ${LISTENER DIR}/Recursion.py
+ Check Log Message ${msg}
+ ... Calling method '${method}' of listener '${listener}' failed: ${error}
+ ... ERROR pattern=True
diff --git a/atest/robot/output/listener_interface/result_model.robot b/atest/robot/output/listener_interface/result_model.robot
new file mode 100644
index 00000000000..3f56c5c0472
--- /dev/null
+++ b/atest/robot/output/listener_interface/result_model.robot
@@ -0,0 +1,29 @@
+*** Settings ***
+Suite Setup Run Tests --listener "${LISTENER DIR}/ResultModel.py;${MODEL FILE}" --loglevel DEBUG ${LISTENER DIR}/result_model.robot
+Resource listener_resource.robot
+
+*** Variables ***
+${MODEL FILE} %{TEMPDIR}/listener_result_model.json
+
+*** Test Cases ***
+Result model is consistent with information sent to listeners
+ Should Be Empty ${ERRORS}
+
+Result model build during execution is same as saved to output.xml
+ ${expected} = Check Test Case Test
+ ${actual} = Evaluate robot.result.TestCase.from_json($MODEL_FILE)
+ ${suite} = Evaluate robot.result.TestSuite.from_dict({'tests': [$actual]}) # Required to get correct id.
+ Dictionaries Should Be Equal ${actual.to_dict()} ${expected.to_dict()}
+
+Messages below log level and messages explicitly removed are not included
+ ${tc} = Check Test Case Test
+ Check Keyword Data ${tc[2, 1]} BuiltIn.Log args=User keyword, DEBUG children=3
+ Check Log Message ${tc[2, 1, 0]} Starting KEYWORD
+ Check Log Message ${tc[2, 1, 1]} User keyword DEBUG
+ Check Log Message ${tc[2, 1, 2]} Ending KEYWORD
+ Check Keyword Data ${tc[2, 2]} BuiltIn.Log args=Not logged, TRACE children=2
+ Check Log Message ${tc[2, 2, 0]} Starting KEYWORD
+ Check Log Message ${tc[2, 2, 1]} Ending KEYWORD
+ Check Keyword Data ${tc[2, 3]} BuiltIn.Log args=Remove me! children=2
+ Check Log Message ${tc[2, 3, 0]} Starting KEYWORD
+ Check Log Message ${tc[2, 3, 1]} Ending KEYWORD
diff --git a/atest/robot/output/listener_interface/using_run_keyword.robot b/atest/robot/output/listener_interface/using_run_keyword.robot
index 59e78a46744..be7635fe20a 100644
--- a/atest/robot/output/listener_interface/using_run_keyword.robot
+++ b/atest/robot/output/listener_interface/using_run_keyword.robot
@@ -4,179 +4,289 @@ Resource listener_resource.robot
*** Test Cases ***
In start_suite when suite has no setup
- Should Be Equal ${SUITE.setup.full_name} Implicit setup
- Should Be Equal ${SUITE.setup.body[0].full_name} BuiltIn.Log
- Check Log Message ${SUITE.setup.body[0].body[0]} start_suite
- Length Should Be ${SUITE.setup.body} 1
+ Check Keyword Data ${SUITE.setup} Implicit setup type=SETUP children=1
+ Validate Log ${SUITE.setup[0]} start_suite
In end_suite when suite has no teardown
- Should Be Equal ${SUITE.teardown.full_name} Implicit teardown
- Should Be Equal ${SUITE.teardown.body[0].full_name} BuiltIn.Log
- Check Log Message ${SUITE.teardown.body[0].body[0]} end_suite
- Length Should Be ${SUITE.teardown.body} 1
+ Check Keyword Data ${SUITE.teardown} Implicit teardown type=TEARDOWN children=1
+ Validate Log ${SUITE.teardown[0]} end_suite
In start_suite when suite has setup
- ${suite} = Set Variable ${SUITE.suites[1]}
- Should Be Equal ${suite.setup.full_name} Suite Setup
- Should Be Equal ${suite.setup.body[0].full_name} BuiltIn.Log
- Check Log Message ${suite.setup.body[0].body[0]} start_suite
- Length Should Be ${suite.setup.body} 5
+ VAR ${kw} ${SUITE.suites[1].setup}
+ Check Keyword Data ${kw} Suite Setup type=SETUP children=5
+ Validate Log ${kw[0]} start_suite
+ Check Keyword Data ${kw[1]} BuiltIn.Log args=start_keyword children=1
+ Check Log Message ${kw[1, 0]} start_keyword
+ Validate Log ${kw[2]} Keyword
+ Check Keyword Data ${kw[3]} Keyword children=3
+ Check Keyword Data ${kw[3, 0]} BuiltIn.Log args=start_keyword children=1
+ Check Log Message ${kw[3, 0, 0]} start_keyword
+ Check Keyword Data ${kw[3, 1]} BuiltIn.Log args=Keyword children=3
+ Check Keyword Data ${kw[3, 2]} BuiltIn.Log args=end_keyword children=1
+ Check Log Message ${kw[3, 2, 0]} end_keyword
+ Check Keyword Data ${kw[4]} BuiltIn.Log args=end_keyword children=1
+ Check Log Message ${kw[4, 0]} end_keyword
In end_suite when suite has teardown
- ${suite} = Set Variable ${SUITE.suites[1]}
- Should Be Equal ${suite.teardown.full_name} Suite Teardown
- Should Be Equal ${suite.teardown.body[-1].full_name} BuiltIn.Log
- Check Log Message ${suite.teardown.body[-1].body[0]} end_suite
- Length Should Be ${suite.teardown.body} 5
+ VAR ${kw} ${SUITE.suites[1].teardown}
+ Check Keyword Data ${kw} Suite Teardown type=TEARDOWN children=5
+ Check Keyword Data ${kw[0]} BuiltIn.Log args=start_keyword children=1
+ Check Log Message ${kw[0, 0]} start_keyword
+ Validate Log ${kw[1]} Keyword
+ Check Keyword Data ${kw[2]} Keyword children=3
+ Check Keyword Data ${kw[2, 0]} BuiltIn.Log args=start_keyword children=1
+ Check Log Message ${kw[2, 0, 0]} start_keyword
+ Check Keyword Data ${kw[2, 1]} BuiltIn.Log args=Keyword children=3
+ Check Keyword Data ${kw[2, 2]} BuiltIn.Log args=end_keyword children=1
+ Check Log Message ${kw[2, 2, 0]} end_keyword
+ Check Keyword Data ${kw[3]} BuiltIn.Log args=end_keyword children=1
+ Check Log Message ${kw[3, 0]} end_keyword
+ Validate Log ${kw[4]} end_suite
In start_test and end_test when test has no setup or teardown
- ${tc} = Check Test Case First One
- Should Be Equal ${tc.body[0].full_name} BuiltIn.Log
- Check Log Message ${tc.body[0].body[0]} start_test
- Should Be Equal ${tc.body[-1].full_name} BuiltIn.Log
- Check Log Message ${tc.body[-1].body[0]} end_test
- Length Should Be ${tc.body} 5
+ ${tc} = Check Test Case First One
+ Length Should Be ${tc.body} 5
Should Not Be True ${tc.setup}
Should Not Be True ${tc.teardown}
+ Validate Log ${tc[0]} start_test
+ Validate Log ${tc[1]} Test 1
+ Validate Log ${tc[2]} Logging with debug level DEBUG
+ Check Keyword Data ${tc[3]} logs on trace tags=kw, tags children=3
+ Check Keyword Data ${tc[3, 0]} BuiltIn.Log args=start_keyword children=1
+ Check Keyword Data ${tc[3, 1]} BuiltIn.Log args=Log on \${TEST NAME}, TRACE children=3
+ Check Keyword Data ${tc[3, 2]} BuiltIn.Log args=end_keyword children=1
+ Validate Log ${tc[4]} end_test
In start_test and end_test when test has setup and teardown
- ${tc} = Check Test Case Test with setup and teardown
- Should Be Equal ${tc.body[0].full_name} BuiltIn.Log
- Check Log Message ${tc.body[0].body[0]} start_test
- Should Be Equal ${tc.body[-1].full_name} BuiltIn.Log
- Check Log Message ${tc.body[-1].body[0]} end_test
- Length Should Be ${tc.body} 3
- Should Be Equal ${tc.setup.full_name} Test Setup
- Should Be Equal ${tc.teardown.full_name} Test Teardown
+ ${tc} = Check Test Case Test with setup and teardown
+ Length Should Be ${tc.body} 3
+ Check Keyword Data ${tc.setup} Test Setup type=SETUP children=4
+ Check Keyword Data ${tc.teardown} Test Teardown type=TEARDOWN children=4
+ Validate Log ${tc[0]} start_test
+ Check Keyword Data ${tc[1]} Keyword children=3
+ Check Keyword Data ${tc[1, 0]} BuiltIn.Log args=start_keyword children=1
+ Check Log Message ${tc[1, 0, 0]} start_keyword
+ Check Keyword Data ${tc[1, 1]} BuiltIn.Log args=Keyword children=3
+ Check Keyword Data ${tc[1, 2]} BuiltIn.Log args=end_keyword children=1
+ Check Log Message ${tc[1, 2, 0]} end_keyword
+ Validate Log ${tc[2]} end_test
In start_keyword and end_keyword with library keyword
- ${tc} = Check Test Case First One
- Should Be Equal ${tc.body[1].full_name} BuiltIn.Log
- Should Be Equal ${tc.body[1].body[0].full_name} BuiltIn.Log
- Check Log Message ${tc.body[1].body[0].body[0]} start_keyword
- Check Log Message ${tc.body[1].body[1]} Test 1
- Should Be Equal ${tc.body[1].body[2].full_name} BuiltIn.Log
- Check Log Message ${tc.body[1].body[2].body[0]} end_keyword
- Length Should Be ${tc.body[1].body} 3
+ ${tc} = Check Test Case First One
+ Should Be Equal ${tc[1].full_name} BuiltIn.Log
+ Should Be Equal ${tc[1, 0].full_name} BuiltIn.Log
+ Check Log Message ${tc[1, 0, 0]} start_keyword
+ Check Log Message ${tc[1, 1]} Test 1
+ Should Be Equal ${tc[1, 2].full_name} BuiltIn.Log
+ Check Log Message ${tc[1, 2, 0]} end_keyword
+ Length Should Be ${tc[1].body} 3
In start_keyword and end_keyword with user keyword
- ${tc} = Check Test Case First One
- Should Be Equal ${tc.body[3].full_name} logs on trace
- Should Be Equal ${tc.body[3].body[0].full_name} BuiltIn.Log
- Check Log Message ${tc.body[3].body[0].body[0]} start_keyword
- Should Be Equal ${tc.body[3].body[1].full_name} BuiltIn.Log
- Should Be Equal ${tc.body[3].body[1].body[0].full_name} BuiltIn.Log
- Check Log Message ${tc.body[3].body[1].body[0].body[0]} start_keyword
- Should Be Equal ${tc.body[3].body[1].body[1].full_name} BuiltIn.Log
- Check Log Message ${tc.body[3].body[1].body[1].body[0]} end_keyword
- Length Should Be ${tc.body[3].body[1].body} 2
- Should Be Equal ${tc.body[3].body[2].full_name} BuiltIn.Log
- Check Log Message ${tc.body[3].body[2].body[0]} end_keyword
- Length Should Be ${tc.body[3].body} 3
+ ${tc} = Check Test Case First One
+ Should Be Equal ${tc[3].full_name} logs on trace
+ Should Be Equal ${tc[3, 0].full_name} BuiltIn.Log
+ Check Log Message ${tc[3, 0, 0]} start_keyword
+ Should Be Equal ${tc[3, 1].full_name} BuiltIn.Log
+ Should Be Equal ${tc[3, 1, 0].full_name} BuiltIn.Log
+ Check Log Message ${tc[3, 1, 0, 1]} start_keyword
+ Should Be Equal ${tc[3, 1, 2].full_name} BuiltIn.Log
+ Check Log Message ${tc[3, 1, 2, 1]} end_keyword
+ Length Should Be ${tc[3, 1].body} 3
+ Should Be Equal ${tc[3, 2].full_name} BuiltIn.Log
+ Check Log Message ${tc[3, 2, 0]} end_keyword
+ Length Should Be ${tc[3].body} 3
In start_keyword and end_keyword with FOR loop
- ${tc} = Check Test Case FOR
- ${for} = Set Variable ${tc.body[1]}
- Should Be Equal ${for.type} FOR
- Length Should Be ${for.body} 5
- Length Should Be ${for.body.filter(keywords=True)} 2
- Should Be Equal ${for.body[0].full_name} BuiltIn.Log
- Check Log Message ${for.body[0].body[0]} start_keyword
- Should Be Equal ${for.body[-1].full_name} BuiltIn.Log
- Check Log Message ${for.body[-1].body[0]} end_keyword
+ ${tc} = Check Test Case FOR
+ ${for} = Set Variable ${tc[1]}
+ Should Be Equal ${for.type} FOR
+ Length Should Be ${for.body} 5
+ Length Should Be ${for.keywords} 2
+ Should Be Equal ${for[0].full_name} BuiltIn.Log
+ Check Log Message ${for[0, 0]} start_keyword
+ Should Be Equal ${for[-1].full_name} BuiltIn.Log
+ Check Log Message ${for[-1,0]} end_keyword
In start_keyword and end_keyword with WHILE
- ${tc} = Check Test Case While loop executed multiple times
- ${while} = Set Variable ${tc.body[2]}
- Should Be Equal ${while.type} WHILE
- Length Should Be ${while.body} 7
- Length Should Be ${while.body.filter(keywords=True)} 2
- Should Be Equal ${while.body[0].full_name} BuiltIn.Log
- Check Log Message ${while.body[0].body[0]} start_keyword
- Should Be Equal ${while.body[-1].full_name} BuiltIn.Log
- Check Log Message ${while.body[-1].body[0]} end_keyword
-
- In start_keyword and end_keyword with IF/ELSE
- ${tc} = Check Test Case IF structure
- Should Be Equal ${tc.body[1].type} VAR
- Should Be Equal ${tc.body[2].type} IF/ELSE ROOT
- Length Should Be ${tc.body[2].body} 3 # Listener is not called with root
- Validate IF branch ${tc.body[2].body[0]} IF NOT RUN # but is called with unexecuted branches.
- Validate IF branch ${tc.body[2].body[1]} ELSE IF PASS
- Validate IF branch ${tc.body[2].body[2]} ELSE NOT RUN
+ ${tc} = Check Test Case While loop executed multiple times
+ ${while} = Set Variable ${tc[2]}
+ Should Be Equal ${while.type} WHILE
+ Length Should Be ${while.body} 7
+ Length Should Be ${while.keywords} 2
+ Should Be Equal ${while[0].full_name} BuiltIn.Log
+ Check Log Message ${while[0, 0]} start_keyword
+ Should Be Equal ${while[-1].full_name} BuiltIn.Log
+ Check Log Message ${while[-1,0]} end_keyword
+
+In start_keyword and end_keyword with IF/ELSE
+ ${tc} = Check Test Case IF structure
+ Should Be Equal ${tc[1].type} VAR
+ Should Be Equal ${tc[2].type} IF/ELSE ROOT
+ Length Should Be ${tc[2].body} 3 # Listener is not called with root
+ Validate IF branch ${tc[2, 0]} IF NOT RUN # but is called with unexecuted branches.
+ Validate IF branch ${tc[2, 1]} ELSE IF PASS
+ Validate IF branch ${tc[2, 2]} ELSE NOT RUN
In start_keyword and end_keyword with TRY/EXCEPT
- ${tc} = Check Test Case Everything
- Should Be Equal ${tc.body[1].type} TRY/EXCEPT ROOT
- Length Should Be ${tc.body[1].body} 5 # Listener is not called with root
- Validate FOR branch ${tc.body[1].body[0]} TRY FAIL
- Validate FOR branch ${tc.body[1].body[1]} EXCEPT NOT RUN # but is called with unexecuted branches.
- Validate FOR branch ${tc.body[1].body[2]} EXCEPT PASS
- Validate FOR branch ${tc.body[1].body[3]} ELSE NOT RUN
- Validate FOR branch ${tc.body[1].body[4]} FINALLY PASS
+ ${tc} = Check Test Case Everything
+ Should Be Equal ${tc[1].type} TRY/EXCEPT ROOT
+ Length Should Be ${tc[1].body} 5 # Listener is not called with root
+ Validate FOR branch ${tc[1, 0]} TRY FAIL
+ Validate FOR branch ${tc[1, 1]} EXCEPT NOT RUN # but is called with unexecuted branches.
+ Validate FOR branch ${tc[1, 2]} EXCEPT PASS
+ Validate FOR branch ${tc[1, 3]} ELSE NOT RUN
+ Validate FOR branch ${tc[1, 4]} FINALLY PASS
In start_keyword and end_keyword with BREAK and CONTINUE
- ${tc} = Check Test Case WHILE loop in keyword
- FOR ${iter} IN @{tc.body[1].body[2].body[1:-1]}
- Should Be Equal ${iter.body[3].body[0].body[1].type} CONTINUE
- Should Be Equal ${iter.body[3].body[0].body[1].body[0].full_name} BuiltIn.Log
- Check Log Message ${iter.body[3].body[0].body[1].body[0].body[0]} start_keyword
- Should Be Equal ${iter.body[3].body[0].body[1].body[1].full_name} BuiltIn.Log
- Check Log Message ${iter.body[3].body[0].body[1].body[1].body[0]} end_keyword
- Should Be Equal ${iter.body[4].body[0].body[1].type} BREAK
- Should Be Equal ${iter.body[4].body[0].body[1].body[0].full_name} BuiltIn.Log
- Check Log Message ${iter.body[4].body[0].body[1].body[0].body[0]} start_keyword
- Should Be Equal ${iter.body[4].body[0].body[1].body[1].full_name} BuiltIn.Log
- Check Log Message ${iter.body[4].body[0].body[1].body[1].body[0]} end_keyword
+ ${tc} = Check Test Case WHILE loop in keyword
+ FOR ${iter} IN @{tc[1, 2][1:-1]}
+ Should Be Equal ${iter[3, 0, 1].type} CONTINUE
+ Should Be Equal ${iter[3, 0, 1, 0].full_name} BuiltIn.Log
+ Check Log Message ${iter[3, 0, 1, 0, 0]} start_keyword
+ Should Be Equal ${iter[3, 0, 1, 1].full_name} BuiltIn.Log
+ Check Log Message ${iter[3, 0, 1, 1, 0]} end_keyword
+ Should Be Equal ${iter[4, 0, 1].type} BREAK
+ Should Be Equal ${iter[4, 0, 1, 0].full_name} BuiltIn.Log
+ Check Log Message ${iter[4, 0, 1, 0, 0]} start_keyword
+ Should Be Equal ${iter[4, 0, 1, 1].full_name} BuiltIn.Log
+ Check Log Message ${iter[4, 0, 1, 1, 0]} end_keyword
END
In start_keyword and end_keyword with RETURN
- ${tc} = Check Test Case Second One
- Should Be Equal ${tc.body[3].body[1].body[1].body[2].type} RETURN
- Should Be Equal ${tc.body[3].body[1].body[1].body[2].body[0].full_name} BuiltIn.Log
- Check Log Message ${tc.body[3].body[1].body[1].body[2].body[0].body[0]} start_keyword
- Should Be Equal ${tc.body[3].body[1].body[1].body[2].body[1].full_name} BuiltIn.Log
- Check Log Message ${tc.body[3].body[1].body[1].body[2].body[1].body[0]} end_keyword
+ ${tc} = Check Test Case Second One
+ Should Be Equal ${tc[3, 1, 1, 2].type} RETURN
+ Should Be Equal ${tc[3, 1, 1, 2, 0].full_name} BuiltIn.Log
+ Check Log Message ${tc[3, 1, 1, 2, 0, 1]} start_keyword
+ Should Be Equal ${tc[3, 1, 1, 2, 1].full_name} BuiltIn.Log
+ Check Log Message ${tc[3, 1, 1, 2, 1, 1]} end_keyword
+
+With JSON output
+ [Documentation] Mainly test that executed keywords don't cause problems.
+ ...
+ ... Some data, such as keywords and messages on suite level,
+ ... are discarded and thus the exact output isn't the same as
+ ... with XML.
+ ...
+ ... Cannot validate output, because it doesn't match the schema.
+ Run Tests With Keyword Running Listener format=json validate=False
+ Should Contain Tests ${SUITE}
+ ... First One
+ ... Second One
+ ... Test with setup and teardown
+ ... Test with failing setup
+ ... Test with failing teardown
+ ... Failing test with failing teardown
+ ... FOR
+ ... FOR IN RANGE
+ ... FOR IN ENUMERATE
+ ... FOR IN ZIP
+ ... WHILE loop executed multiple times
+ ... WHILE loop in keyword
+ ... IF structure
+ ... Everything
+ ... Library keyword
+ ... User keyword and RETURN
+ ... Test documentation, tags and timeout
+ ... Test setup and teardown
+ ... Keyword Keyword documentation, tags and timeout
+ ... Keyword setup and teardown
+ ... Failure
+ ... VAR
+ ... IF
+ ... TRY
+ ... FOR and CONTINUE
+ ... WHILE and BREAK
+ ... GROUP
+ ... Syntax error
+
+In dry-run
+ Run Tests With Keyword Running Listener --dry-run
+ Should Contain Tests ${SUITE}
+ ... First One
+ ... Test with setup and teardown
+ ... FOR
+ ... FOR IN ENUMERATE
+ ... FOR IN ZIP
+ ... WHILE loop executed multiple times
+ ... WHILE loop in keyword
+ ... IF structure
+ ... Everything
+ ... Library keyword
+ ... User keyword and RETURN
+ ... Test documentation, tags and timeout
+ ... Test setup and teardown
+ ... Keyword Keyword documentation, tags and timeout
+ ... Keyword setup and teardown
+ ... VAR
+ ... IF
+ ... TRY
+ ... FOR and CONTINUE
+ ... WHILE and BREAK
+ ... GROUP
+ ... Second One=FAIL:Several failures occurred:\n\n1) No keyword with name 'Not executed' found.\n\n2) No keyword with name 'Not executed' found.
+ ... Test with failing setup=PASS
+ ... Test with failing teardown=PASS
+ ... Failing test with failing teardown=PASS
+ ... FOR IN RANGE=FAIL:No keyword with name 'Not executed!' found.
+ ... Failure=PASS
+ ... Syntax error=FAIL:Several failures occurred:\n\n1) Non-existing setting 'Bad'.\n\n2) Non-existing setting 'Ooops'.
*** Keywords ***
Run Tests With Keyword Running Listener
- ${path} = Normalize Path ${LISTENER DIR}/keyword_running_listener.py
- ${files} = Catenate
+ [Arguments] ${options}= ${format}=xml ${validate}=True
+ VAR ${listener} ${LISTENER DIR}/keyword_running_listener.py
+ VAR ${output} ${OUTDIR}/output.${format}
+ VAR ${files}
... misc/normal.robot
... misc/setups_and_teardowns.robot
... misc/for_loops.robot
... misc/while.robot
... misc/if_else.robot
... misc/try_except.robot
- Run Tests --listener ${path} ${files} validate output=True
- Should Be Empty ${ERRORS}
+ ... misc/everything.robot
+ Run Tests --listener ${listener} ${options} -L debug -o ${output} ${files} output=${output} validate output=${validate}
+ Length Should Be ${ERRORS} 1
+
+Validate Log
+ [Arguments] ${kw} ${message} ${level}=INFO
+ IF $level == 'INFO'
+ VAR ${args} ${message}
+ ELSE
+ VAR ${args} ${message}, ${level}
+ END
+ Check Keyword Data ${kw} BuiltIn.Log args=${args} children=3
+ Check Keyword Data ${kw[0]} BuiltIn.Log args=start_keyword children=1
+ Check Log Message ${kw[0, 0]} start_keyword
+ Check Log Message ${kw[1]} ${message} ${level}
+ Check Keyword Data ${kw[2]} BuiltIn.Log args=end_keyword children=1
+ Check Log Message ${kw[2, 0]} end_keyword
Validate IF branch
[Arguments] ${branch} ${type} ${status}
- Should Be Equal ${branch.type} ${type}
- Should Be Equal ${branch.status} ${status}
- Length Should Be ${branch.body} 3
- Should Be Equal ${branch.body[0].full_name} BuiltIn.Log
- Check Log Message ${branch.body[0].body[0]} start_keyword
+ Should Be Equal ${branch.type} ${type}
+ Should Be Equal ${branch.status} ${status}
+ Length Should Be ${branch.body} 3
+ Should Be Equal ${branch[0].full_name} BuiltIn.Log
+ Check Log Message ${branch[0, 0]} start_keyword
IF $status == 'PASS'
- Should Be Equal ${branch.body[1].full_name} BuiltIn.Log
- Should Be Equal ${branch.body[1].body[0].full_name} BuiltIn.Log
- Check Log Message ${branch.body[1].body[0].body[0]} start_keyword
- Check Log Message ${branch.body[1].body[1]} else if branch
- Should Be Equal ${branch.body[1].body[2].full_name} BuiltIn.Log
- Check Log Message ${branch.body[1].body[2].body[0]} end_keyword
+ Should Be Equal ${branch[1].full_name} BuiltIn.Log
+ Should Be Equal ${branch[1, 0].full_name} BuiltIn.Log
+ Check Log Message ${branch[1, 0, 0]} start_keyword
+ Check Log Message ${branch[1, 1]} else if branch
+ Should Be Equal ${branch[1, 2].full_name} BuiltIn.Log
+ Check Log Message ${branch[1, 2, 0]} end_keyword
ELSE
- Should Be Equal ${branch.body[1].full_name} BuiltIn.Fail
- Should Be Equal ${branch.body[1].status} NOT RUN
+ Should Be Equal ${branch[1].full_name} BuiltIn.Fail
+ Should Be Equal ${branch[1].status} NOT RUN
END
- Should Be Equal ${branch.body[-1].full_name} BuiltIn.Log
- Check Log Message ${branch.body[-1].body[0]} end_keyword
+ Should Be Equal ${branch[-1].full_name} BuiltIn.Log
+ Check Log Message ${branch[-1,0]} end_keyword
Validate FOR branch
[Arguments] ${branch} ${type} ${status}
- Should Be Equal ${branch.type} ${type}
- Should Be Equal ${branch.status} ${status}
- Should Be Equal ${branch.body[0].full_name} BuiltIn.Log
- Check Log Message ${branch.body[0].body[0]} start_keyword
- Should Be Equal ${branch.body[-1].full_name} BuiltIn.Log
- Check Log Message ${branch.body[-1].body[0]} end_keyword
+ Should Be Equal ${branch.type} ${type}
+ Should Be Equal ${branch.status} ${status}
+ Should Be Equal ${branch[0].full_name} BuiltIn.Log
+ Check Log Message ${branch[0, 0]} start_keyword
+ Should Be Equal ${branch[-1].full_name} BuiltIn.Log
+ Check Log Message ${branch[-1,0]} end_keyword
diff --git a/atest/robot/output/names_needing_escaping.robot b/atest/robot/output/names_needing_escaping.robot
index b7942b154c8..50006670bf3 100644
--- a/atest/robot/output/names_needing_escaping.robot
+++ b/atest/robot/output/names_needing_escaping.robot
@@ -34,4 +34,4 @@ Check TC And UK Name
[Arguments] ${name}
${tc} = Check Test Case ${name}
Should Be Equal ${tc.name} ${name}
- Should Be Equal ${tc.kws[0].name} ${name}
+ Should Be Equal ${tc[0].name} ${name}
diff --git a/atest/robot/output/xunit.robot b/atest/robot/output/xunit.robot
index e0e19be7099..25843cde935 100644
--- a/atest/robot/output/xunit.robot
+++ b/atest/robot/output/xunit.robot
@@ -29,7 +29,7 @@ File Structure Is Correct
${skips} = Get XUnit Nodes testcase/skipped
Length Should Be ${skips} 1
Element Attribute Should Be ${skips}[0] message
- ... Test failed but skip-on-failure mode was active and it was marked skipped.\n\nOriginal failure:\n${MESSAGES}
+ ... Failed test skipped using 'täg' tag.\n\nOriginal failure:\n${MESSAGES}
Element Attribute Should Be ${skips}[0] type SkipExecution
Element Should Not Exist ${root} testsuite/properties
diff --git a/atest/robot/parsing/caching_libs_and_resources.robot b/atest/robot/parsing/caching_libs_and_resources.robot
index eed9f7c46de..4a543f8a3d0 100644
--- a/atest/robot/parsing/caching_libs_and_resources.robot
+++ b/atest/robot/parsing/caching_libs_and_resources.robot
@@ -18,16 +18,16 @@ Process Resource Files Only Once
[Setup] Run Tests And Set $SYSLOG parsing/resource_parsing
# Check that tests are run ok
${tc} = Check Test Case Test 1.1
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} variable value from 02 resource
- Check Log Message ${tc.kws[1].msgs[0]} variable value from 02 resource
+ Check Log Message ${tc[0, 0, 0]} variable value from 02 resource
+ Check Log Message ${tc[1, 0]} variable value from 02 resource
${tc} = Check Test Case Test 4.1
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} variable value from 02 resource
- Check Log Message ${tc.kws[1].msgs[0]} variable value from 02 resource
+ Check Log Message ${tc[0, 0, 0]} variable value from 02 resource
+ Check Log Message ${tc[1, 0]} variable value from 02 resource
${tc} = Check Test Case Test 4.2
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} variable value from 03 resource
- Check Log Message ${tc.kws[0].kws[1].msgs[0]} variable value from 02 resource
- Check Log Message ${tc.kws[0].kws[2].kws[0].msgs[0]} variable value from 02 resource
- Check Log Message ${tc.kws[1].msgs[0]} variable value from 03 resource
+ Check Log Message ${tc[0, 0, 0]} variable value from 03 resource
+ Check Log Message ${tc[0, 1, 0]} variable value from 02 resource
+ Check Log Message ${tc[0, 2, 0, 0]} variable value from 02 resource
+ Check Log Message ${tc[1, 0]} variable value from 03 resource
${dir} = Normalize Path ${DATADIR}/parsing/resource_parsing
Should Contain X Times ${SYSLOG} Parsing file '${dir}${/}02_resource.robot' 1
Should Contain X Times ${SYSLOG} Parsing resource file '${dir}${/}02_resource.robot' 1
diff --git a/atest/robot/parsing/custom_parsers.robot b/atest/robot/parsing/custom_parsers.robot
index cc8bccad2ae..9a6b59c3ec0 100644
--- a/atest/robot/parsing/custom_parsers.robot
+++ b/atest/robot/parsing/custom_parsers.robot
@@ -111,8 +111,8 @@ Validate Directory Suite
Should Contain Tags ${test} tag from init
Should Be Equal ${test.timeout} 42 seconds
IF '${test.name}' != 'Empty'
- Check Log Message ${test.setup.msgs[0]} setup from init
- Check Log Message ${test.teardown.msgs[0]} teardown from init
+ Check Log Message ${test.setup[0]} setup from init
+ Check Log Message ${test.teardown[0]} teardown from init
END
ELSE
Should Not Be True ${test.tags}
diff --git a/atest/robot/parsing/data_formats/formats_resource.robot b/atest/robot/parsing/data_formats/formats_resource.robot
index 10463f0ca6e..b1e12ed467d 100644
--- a/atest/robot/parsing/data_formats/formats_resource.robot
+++ b/atest/robot/parsing/data_formats/formats_resource.robot
@@ -33,7 +33,7 @@ Run Sample File And Check Tests
${test} = Check Test Case Test Timeout
Should Be Equal ${test.timeout} 10 milliseconds
${test} = Check Test Case Keyword Timeout
- Should Be Equal ${test.kws[0].timeout} 2 milliseconds
+ Should Be Equal ${test[0].timeout} 2 milliseconds
Check Test Doc Document Testing the metadata parsing.
${test} = Check Test Case Default Fixture
Setup Should Not Be Defined ${test}
@@ -62,7 +62,7 @@ Check Suite With Init
[Arguments] ${suite}
Should Be Equal ${suite.name} With Init
Should Be Equal ${suite.doc} Testing suite init file
- Check Log Message ${suite.setup.kws[0].messages[0]} Running suite setup
+ Check Log Message ${suite.setup[0].messages[0]} Running suite setup
Teardown Should Not Be Defined ${suite}
Should Contain Suites ${suite} Sub Suite1 Sub Suite2
Should Contain Tests ${suite} @{SUBSUITE_TESTS}
diff --git a/atest/robot/parsing/data_formats/resource_extensions.robot b/atest/robot/parsing/data_formats/resource_extensions.robot
index dcc66e3e9f4..e168ea65964 100644
--- a/atest/robot/parsing/data_formats/resource_extensions.robot
+++ b/atest/robot/parsing/data_formats/resource_extensions.robot
@@ -5,11 +5,11 @@ Resource atest_resource.robot
*** Test Cases ***
Resource with '*.resource' extension
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].kws[1].msgs[0]} nested.resource
- Check Log Message ${tc.kws[0].kws[3].msgs[0]} resource.resource
- Check Log Message ${tc.kws[1].kws[1].msgs[0]} nested.resource
- Check Log Message ${tc.kws[4].msgs[0]} resource.resource
- Check Log Message ${tc.kws[5].msgs[0]} nested.resource
+ Check Log Message ${tc[0, 0, 1, 0]} nested.resource
+ Check Log Message ${tc[0, 3, 0]} resource.resource
+ Check Log Message ${tc[1, 1, 0]} nested.resource
+ Check Log Message ${tc[4, 0]} resource.resource
+ Check Log Message ${tc[5, 0]} nested.resource
'*.resource' files are not parsed for tests
Should Contain Suites ${SUITE} Tests
diff --git a/atest/robot/parsing/ignore_bom.robot b/atest/robot/parsing/ignore_bom.robot
index c8bb2b799a6..6897f32c885 100644
--- a/atest/robot/parsing/ignore_bom.robot
+++ b/atest/robot/parsing/ignore_bom.robot
@@ -7,12 +7,12 @@ Resource atest_resource.robot
Byte order mark in plain text file
[Setup] File Should Have Bom parsing/bom.robot
${tc} = Check test case ${TESTNAME}
- Check log message ${tc.kws[0].msgs[0]} Hyvää päivää €åppa!
+ Check log message ${tc[0, 0]} Hyvää päivää €åppa!
Byte order mark in TSV file
[Setup] File Should Have Bom parsing/bom.robot
${tc} = Check test case ${TESTNAME}
- Check log message ${tc.kws[0].msgs[0]} Hyvää päivää €åppa!
+ Check log message ${tc[0, 0]} Hyvää päivää €åppa!
*** Keywords ***
File Should Have Bom
diff --git a/atest/robot/parsing/line_continuation.robot b/atest/robot/parsing/line_continuation.robot
index 5ced4ba04b5..59b13411de2 100644
--- a/atest/robot/parsing/line_continuation.robot
+++ b/atest/robot/parsing/line_continuation.robot
@@ -10,11 +10,11 @@ Multiline suite documentation and metadata
Multiline suite level settings
Should Contain Tags ${SUITE.tests[0]}
... ... t1 t2 t3 t4 t5 t6 t7 t8 t9
- Check Log Message ${SUITE.tests[0].teardown.msgs[0]} 1st
- Check Log Message ${SUITE.tests[0].teardown.msgs[1]} ${EMPTY}
- Check Log Message ${SUITE.tests[0].teardown.msgs[2]} 2nd last
- Check Log Message ${SUITE.tests[0].teardown.msgs[3]} ${EMPTY}
- Length Should Be ${SUITE.tests[0].teardown.msgs} 4
+ Check Log Message ${SUITE.tests[0].teardown[0]} 1st
+ Check Log Message ${SUITE.tests[0].teardown[1]} ${EMPTY}
+ Check Log Message ${SUITE.tests[0].teardown[2]} 2nd last
+ Check Log Message ${SUITE.tests[0].teardown[3]} ${EMPTY}
+ Length Should Be ${SUITE.tests[0].teardown.body} 4
Multiline import
Check Test Case ${TEST NAME}
@@ -24,21 +24,21 @@ Multiline variables
Multiline arguments with library keyword
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} one
- Check Log Message ${tc.kws[0].msgs[1]} two
- Check Log Message ${tc.kws[0].msgs[2]} three
- Check Log Message ${tc.kws[0].msgs[3]} ${EMPTY}
- Check Log Message ${tc.kws[0].msgs[4]} four
- Check Log Message ${tc.kws[0].msgs[5]} five
+ Check Log Message ${tc[0, 0]} one
+ Check Log Message ${tc[0, 1]} two
+ Check Log Message ${tc[0, 2]} three
+ Check Log Message ${tc[0, 3]} ${EMPTY}
+ Check Log Message ${tc[0, 4]} four
+ Check Log Message ${tc[0, 5]} five
Multiline arguments with user keyword
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} 1
- Check Log Message ${tc.kws[0].kws[0].msgs[1]} ${EMPTY}
- Check Log Message ${tc.kws[0].kws[0].msgs[2]} 2
- Check Log Message ${tc.kws[0].kws[0].msgs[3]} 3
- Check Log Message ${tc.kws[0].kws[0].msgs[4]} 4
- Check Log Message ${tc.kws[0].kws[0].msgs[5]} 5
+ Check Log Message ${tc[0, 0, 0]} 1
+ Check Log Message ${tc[0, 0, 1]} ${EMPTY}
+ Check Log Message ${tc[0, 0, 2]} 2
+ Check Log Message ${tc[0, 0, 3]} 3
+ Check Log Message ${tc[0, 0, 4]} 4
+ Check Log Message ${tc[0, 0, 5]} 5
Multiline assignment
Check Test Case ${TEST NAME}
@@ -51,15 +51,15 @@ Multiline test settings
@{expected} = Evaluate ['my'+str(i) for i in range(1,6)]
Should Contain Tags ${tc} @{expected}
Should Be Equal ${tc.doc} One.\nTwo.\nThree.\n\n${SPACE*32}Second paragraph.
- Check Log Message ${tc.setup.msgs[0]} first
- Check Log Message ${tc.setup.msgs[1]} ${EMPTY}
- Check Log Message ${tc.setup.msgs[2]} last
+ Check Log Message ${tc.setup[0]} first
+ Check Log Message ${tc.setup[1]} ${EMPTY}
+ Check Log Message ${tc.setup[2]} last
Multiline user keyword settings and control structures
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0]} Multiline user keyword settings and control structures
+ Check Keyword Data ${tc[0]} Multiline user keyword settings and control structures
... \${x} 1, 2 tags=keyword, tags
- Check Log Message ${tc.kws[0].teardown.msgs[0]} Bye!
+ Check Log Message ${tc[0].teardown[0]} Bye!
Multiline FOR Loop declaration
Check Test Case ${TEST NAME}
diff --git a/atest/robot/parsing/non_ascii_spaces.robot b/atest/robot/parsing/non_ascii_spaces.robot
index c077abe9767..3a7743ec85d 100644
--- a/atest/robot/parsing/non_ascii_spaces.robot
+++ b/atest/robot/parsing/non_ascii_spaces.robot
@@ -5,19 +5,19 @@ Resource atest_resource.robot
*** Test Cases ***
In suite settings
${tc} = Check Test Case In test and keywords
- Check Log Message ${tc.setup.kws[0].msgs[0]} ':\\xa0:'
- Check Log Message ${tc.setup.kws[1].msgs[0]} : :
- Check Log Message ${tc.teardown.kws[0].msgs[0]} ':\\u1680:'
- Check Log Message ${tc.teardown.kws[1].msgs[0]} : :
+ Check Log Message ${tc.setup[0, 0]} ':\\xa0:'
+ Check Log Message ${tc.setup[1, 0]} : :
+ Check Log Message ${tc.teardown[0, 0]} ':\\u1680:'
+ Check Log Message ${tc.teardown[1, 0]} : :
In test and keywords
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} ':\\xa0:'
- Check Log Message ${tc.kws[0].kws[1].msgs[0]} : :
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} ':\\u1680:'
- Check Log Message ${tc.kws[1].kws[1].msgs[0]} : :
- Check Log Message ${tc.kws[2].kws[0].msgs[0]} ':\\u3000:'
- Check Log Message ${tc.kws[2].kws[1].msgs[0]} : :
+ Check Log Message ${tc[0, 0, 0]} ':\\xa0:'
+ Check Log Message ${tc[0, 1, 0]} : :
+ Check Log Message ${tc[1, 0, 0]} ':\\u1680:'
+ Check Log Message ${tc[1, 1, 0]} : :
+ Check Log Message ${tc[2, 0, 0]} ':\\u3000:'
+ Check Log Message ${tc[2, 1, 0]} : :
As separator
Check Test Case ${TESTNAME}
@@ -39,7 +39,10 @@ In FOR separator
In ELSE IF
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].body[3].body[0].msgs[0]} Should be executed
+ Check Log Message ${tc[0, 3, 0, 0]} Should be executed
In inline ELSE IF
Check Test Case ${TESTNAME}
+
+With embedded arguments and BDD prefixes
+ Check Test Case ${TESTNAME}
diff --git a/atest/robot/parsing/same_setting_multiple_times.robot b/atest/robot/parsing/same_setting_multiple_times.robot
index a6fbacd1043..82854d277c9 100644
--- a/atest/robot/parsing/same_setting_multiple_times.robot
+++ b/atest/robot/parsing/same_setting_multiple_times.robot
@@ -28,7 +28,7 @@ Test Teardown
Test Template
${tc} = Check Test Case Use Defaults
- Check Keyword Data ${tc.kws[0]} BuiltIn.Log Many args=Sleep, 0.1s
+ Check Keyword Data ${tc[0]} BuiltIn.Log Many args=Sleep, 0.1s
Test Timeout
${tc} = Check Test Case Use Defaults
@@ -36,9 +36,9 @@ Test Timeout
Test [Documentation]
${tc} = Check Test Case Test Settings
- Should Be Equal ${tc.kws[0].type} ERROR
- Should Be Equal ${tc.kws[0].status} FAIL
- Should Be Equal ${tc.kws[0].values[0]} [Documentation]
+ Should Be Equal ${tc[0].type} ERROR
+ Should Be Equal ${tc[0].status} FAIL
+ Should Be Equal ${tc[0].values[0]} [Documentation]
Test [Tags]
Check Test Tags Test Settings
@@ -53,7 +53,7 @@ Test [Teardown]
Test [Template]
${tc} = Check Test Case Test Settings
- Check Keyword Data ${tc.kws[7]} BuiltIn.Log args=No Operation
+ Check Keyword Data ${tc[7]} BuiltIn.Log args=No Operation
Test [Timeout]
${tc} = Check Test Case Test Settings
@@ -61,20 +61,20 @@ Test [Timeout]
Keyword [Arguments]
${tc} = Check Test Case Keyword Settings
- Check Keyword Data ${tc.kws[0]} Keyword Settings assign=\${ret} args=1, 2, 3 tags=K1 status=FAIL
- Check Log Message ${tc.kws[0].msgs[0]} Arguments: [ \${a1}='1' | \${a2}='2' | \${a3}='3' ] TRACE
+ Check Keyword Data ${tc[0]} Keyword Settings assign=\${ret} args=1, 2, 3 tags=K1 status=FAIL
+ Check Log Message ${tc[0, 0]} Arguments: [ \${a1}='1' | \${a2}='2' | \${a3}='3' ] TRACE
Keyword [Documentation]
${tc} = Check Test Case Keyword Settings
- Should Be Equal ${tc.kws[0].doc} ${EMPTY}
+ Should Be Equal ${tc[0].doc} ${EMPTY}
Keyword [Tags]
${tc} = Check Test Case Keyword Settings
- Should Be True list($tc.kws[0].tags) == ['K1']
+ Should Be True list($tc[0].tags) == ['K1']
Keyword [Timeout]
${tc} = Check Test Case Keyword Settings
- Should Be Equal ${tc.kws[0].timeout} ${NONE}
+ Should Be Equal ${tc[0].timeout} ${NONE}
Keyword [Return]
Check Test Case Keyword Settings
diff --git a/atest/robot/parsing/spaces_and_tabs.robot b/atest/robot/parsing/spaces_and_tabs.robot
index 1d514e1903a..f517f7239ae 100644
--- a/atest/robot/parsing/spaces_and_tabs.robot
+++ b/atest/robot/parsing/spaces_and_tabs.robot
@@ -14,16 +14,16 @@ Lot of spaces
Trailing spaces
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} No spaces at end
- Check Log Message ${tc.kws[1].msgs[0]} One space at end
- Check Log Message ${tc.kws[2].msgs[0]} Two spaces at end
- Check Log Message ${tc.kws[3].msgs[0]} Ten spaces at end
- Check Log Message ${tc.kws[4].msgs[0]} Tab at end
+ Check Log Message ${tc[0, 0]} No spaces at end
+ Check Log Message ${tc[1, 0]} One space at end
+ Check Log Message ${tc[2, 0]} Two spaces at end
+ Check Log Message ${tc[3, 0]} Ten spaces at end
+ Check Log Message ${tc[4, 0]} Tab at end
Tabs
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} I ignore tabs DEBUG
+ Check Log Message ${tc[0, 0]} I ignore tabs DEBUG
Tabs and spaces
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} I ignore tabs (and spaces) DEBUG
+ Check Log Message ${tc[0, 0]} I ignore tabs (and spaces) DEBUG
diff --git a/atest/robot/parsing/table_names.robot b/atest/robot/parsing/table_names.robot
index fcab2d919a1..21d8109333e 100644
--- a/atest/robot/parsing/table_names.robot
+++ b/atest/robot/parsing/table_names.robot
@@ -17,7 +17,7 @@ Test Cases section
Keywords section
${tc} = Check Test Case Test Case
- Check Log Message ${tc.kws[1].kws[0].kws[0].msgs[0]} "Keywords" was executed
+ Check Log Message ${tc[1, 0, 0, 0]} "Keywords" was executed
Comments section
Check Test Case Comment section exist
@@ -40,7 +40,7 @@ Invalid sections
[Setup] Run Tests ${EMPTY} parsing/invalid_table_names.robot
${tc} = Check Test Case Test in valid table
${path} = Normalize Path ${DATADIR}/parsing/invalid_tables_resource.robot
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} Keyword in valid table
+ Check Log Message ${tc[0, 0, 0]} Keyword in valid table
Length Should Be ${ERRORS} 4
Invalid Section Error 0 invalid_table_names.robot 1 *** Error ***
Invalid Section Error 1 invalid_table_names.robot 8 *** ***
@@ -51,7 +51,7 @@ Invalid sections
Check First Log Entry
[Arguments] ${test case name} ${expected}
${tc} = Check Test Case ${test case name}
- Check Log Message ${tc.kws[0].msgs[0]} ${expected}
+ Check Log Message ${tc[0, 0]} ${expected}
Invalid Section Error
[Arguments] ${index} ${file} ${lineno} ${header} ${test and task}=, 'Test Cases', 'Tasks'
diff --git a/atest/robot/parsing/test_case_settings.robot b/atest/robot/parsing/test_case_settings.robot
index 2991e73a3b8..b321b6df9ea 100644
--- a/atest/robot/parsing/test_case_settings.robot
+++ b/atest/robot/parsing/test_case_settings.robot
@@ -145,8 +145,8 @@ Setup and teardown with escaping
Template
[Documentation] Mainly tested elsewhere
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Hello, world!
- Check Log Message ${tc.kws[1].msgs[0]} Hi, tellus!
+ Check Log Message ${tc[0, 0]} Hello, world!
+ Check Log Message ${tc[1, 0]} Hi, tellus!
Timeout
Verify Timeout 1 day
@@ -198,13 +198,13 @@ Verify Setup
[Arguments] ${message}
${tc} = Check Test Case ${TEST NAME}
Should Be Equal ${tc.setup.full_name} BuiltIn.Log
- Check Log Message ${tc.setup.msgs[0]} ${message}
+ Check Log Message ${tc.setup[0]} ${message}
Verify Teardown
[Arguments] ${message}
${tc} = Check Test Case ${TEST NAME}
Should Be Equal ${tc.teardown.full_name} BuiltIn.Log
- Check Log Message ${tc.teardown.msgs[0]} ${message}
+ Check Log Message ${tc.teardown[0]} ${message}
Verify Timeout
[Arguments] ${timeout}
diff --git a/atest/robot/parsing/translations.robot b/atest/robot/parsing/translations.robot
index dd171f36b9f..ebf6386d6e0 100644
--- a/atest/robot/parsing/translations.robot
+++ b/atest/robot/parsing/translations.robot
@@ -48,10 +48,12 @@ Per file configuration with multiple languages
Should Be Equal ${tc.doc} приклад
Invalid per file configuration
- Run Tests ${EMPTY} parsing/translations/per_file_config/many.robot
Error in file 0 parsing/translations/per_file_config/many.robot 4
... Invalid language configuration:
... Language 'invalid' not found nor importable as a language module.
+ Error in file 1 parsing/translations/per_file_config/many.robot 5
+ ... Invalid language configuration:
+ ... Language 'another invalid value' not found nor importable as a language module.
Per file configuration bleeds to other files
[Documentation] This is a technical limitation and will hopefully change!
@@ -74,20 +76,20 @@ Validate Translations
Should Be Equal ${tc.timeout} 1 minute
Should Be Equal ${tc.setup.full_name} Test Setup
Should Be Equal ${tc.teardown.full_name} Test Teardown
- Should Be Equal ${tc.body[0].full_name} Test Template
- Should Be Equal ${tc.body[0].tags} ${{['keyword', 'tags']}}
+ Should Be Equal ${tc[0].full_name} Test Template
+ Should Be Equal ${tc[0].tags} ${{['keyword', 'tags']}}
${tc} = Check Test Case Test with settings
Should Be Equal ${tc.doc} Test documentation.
Should Be Equal ${tc.tags} ${{['test', 'tags', 'own tag']}}
Should Be Equal ${tc.timeout} ${NONE}
Should Be Equal ${tc.setup.full_name} ${NONE}
Should Be Equal ${tc.teardown.full_name} ${NONE}
- Should Be Equal ${tc.body[0].full_name} Keyword
- Should Be Equal ${tc.body[0].doc} Keyword documentation.
- Should Be Equal ${tc.body[0].tags} ${{['keyword', 'tags', 'own tag']}}
- Should Be Equal ${tc.body[0].timeout} 1 hour
- Should Be Equal ${tc.body[0].setup.full_name} BuiltIn.Log
- Should Be Equal ${tc.body[0].teardown.full_name} BuiltIn.No Operation
+ Should Be Equal ${tc[0].full_name} Keyword
+ Should Be Equal ${tc[0].doc} Keyword documentation.
+ Should Be Equal ${tc[0].tags} ${{['keyword', 'tags', 'own tag']}}
+ Should Be Equal ${tc[0].timeout} 1 hour
+ Should Be Equal ${tc[0].setup.full_name} BuiltIn.Log
+ Should Be Equal ${tc[0].teardown.full_name} BuiltIn.No Operation
Validate Task Translations
${tc} = Check Test Case Task without settings
@@ -96,11 +98,11 @@ Validate Task Translations
Should Be Equal ${tc.timeout} 1 minute
Should Be Equal ${tc.setup.full_name} Task Setup
Should Be Equal ${tc.teardown.full_name} Task Teardown
- Should Be Equal ${tc.body[0].full_name} Task Template
+ Should Be Equal ${tc[0].full_name} Task Template
${tc} = Check Test Case Task with settings
Should Be Equal ${tc.doc} Task documentation.
Should Be Equal ${tc.tags} ${{['task', 'tags', 'own tag']}}
Should Be Equal ${tc.timeout} ${NONE}
Should Be Equal ${tc.setup.full_name} ${NONE}
Should Be Equal ${tc.teardown.full_name} ${NONE}
- Should Be Equal ${tc.body[0].full_name} BuiltIn.Log
+ Should Be Equal ${tc[0].full_name} BuiltIn.Log
diff --git a/atest/robot/parsing/user_keyword_settings.robot b/atest/robot/parsing/user_keyword_settings.robot
index 5fb87406836..8ab9eaec0ea 100644
--- a/atest/robot/parsing/user_keyword_settings.robot
+++ b/atest/robot/parsing/user_keyword_settings.robot
@@ -5,11 +5,11 @@ Resource atest_resource.robot
*** Test Cases ***
Name
${tc} = Check Test Case Normal name
- Should Be Equal ${tc.kws[0].full_name} Normal name
+ Should Be Equal ${tc[0].full_name} Normal name
Names are not formatted
${tc} = Check Test Case Names are not formatted
- FOR ${kw} IN @{tc.kws}
+ FOR ${kw} IN @{tc.body}
Should Be Equal ${kw.full_name} user_keyword nameS _are_not_ FORmatted
END
@@ -43,19 +43,19 @@ Documentation with escaping
Arguments
[Documentation] Tested more thoroughly elsewhere.
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} mandatory
- Check Log Message ${tc.kws[0].kws[0].msgs[1]} default
- Should Be True ${tc.kws[0].args} == ('mandatory',)
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} 1
- Check Log Message ${tc.kws[1].kws[0].msgs[1]} 2
- Should Be True ${tc.kws[1].args} == ('1', '2')
- Check Log Message ${tc.kws[2].kws[0].msgs[0]} 1
- Check Log Message ${tc.kws[2].kws[0].msgs[1]} 2
- Check Log Message ${tc.kws[2].kws[0].msgs[2]} 3
- Check Log Message ${tc.kws[2].kws[0].msgs[3]} 4
- Check Log Message ${tc.kws[2].kws[0].msgs[4]} 5
- Check Log Message ${tc.kws[2].kws[0].msgs[5]} key=6
- Should Be True ${tc.kws[2].args} == ('\${1}', '\${2}', '\${3}', '\${4}', '\${5}', 'key=\${6}')
+ Check Log Message ${tc[0, 0, 0]} mandatory
+ Check Log Message ${tc[0, 0, 1]} default
+ Should Be True ${tc[0].args} == ('mandatory',)
+ Check Log Message ${tc[1, 0, 0]} 1
+ Check Log Message ${tc[1, 0, 1]} 2
+ Should Be True ${tc[1].args} == ('1', '2')
+ Check Log Message ${tc[2, 0, 0]} 1
+ Check Log Message ${tc[2, 0, 1]} 2
+ Check Log Message ${tc[2, 0, 2]} 3
+ Check Log Message ${tc[2, 0, 3]} 4
+ Check Log Message ${tc[2, 0, 4]} 5
+ Check Log Message ${tc[2, 0, 5]} key=6
+ Should Be True ${tc[2].args} == ('\${1}', '\${2}', '\${3}', '\${4}', '\${5}', 'key=\${6}')
Teardown
Verify Teardown Keyword teardown
@@ -69,29 +69,29 @@ Teardown with escaping
Return
[Documentation] [Return] is deprecated. In parsing it is transformed to RETURN.
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.body[0].body[0].type} RETURN
- Should Be Equal ${tc.body[0].body[0].values} ${{('Return value',)}}
+ Should Be Equal ${tc[0, 0].type} RETURN
+ Should Be Equal ${tc[0, 0].values} ${{('Return value',)}}
Error in File 0 parsing/user_keyword_settings.robot 167
... The '[[]Return]' setting is deprecated. Use the 'RETURN' statement instead. level=WARN
Return using variables
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.body[0].body[1].type} RETURN
- Should Be Equal ${tc.body[0].body[1].values} ${{('\${ret}',)}}
+ Should Be Equal ${tc[0, 1].type} RETURN
+ Should Be Equal ${tc[0, 1].values} ${{('\${ret}',)}}
Error in File 1 parsing/user_keyword_settings.robot 171
... The '[[]Return]' setting is deprecated. Use the 'RETURN' statement instead. level=WARN
Return multiple
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.body[0].body[1].type} RETURN
- Should Be Equal ${tc.body[0].body[1].values} ${{('\${arg1}', '+', '\${arg2}', '=', '\${result}')}}
+ Should Be Equal ${tc[0, 1].type} RETURN
+ Should Be Equal ${tc[0, 1].values} ${{('\${arg1}', '+', '\${arg2}', '=', '\${result}')}}
Error in File 2 parsing/user_keyword_settings.robot 176
... The '[[]Return]' setting is deprecated. Use the 'RETURN' statement instead. level=WARN
Return with escaping
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.body[0].body[0].type} RETURN
- Should Be Equal ${tc.body[0].body[0].values} ${{('\\\${XXX}', 'c:\\\\temp', '\\', '\\\\')}}
+ Should Be Equal ${tc[0, 0].type} RETURN
+ Should Be Equal ${tc[0, 0].values} ${{('\\\${XXX}', 'c:\\\\temp', '\\', '\\\\')}}
Error in File 3 parsing/user_keyword_settings.robot 179
... The '[[]Return]' setting is deprecated. Use the 'RETURN' statement instead. level=WARN
@@ -106,8 +106,8 @@ Invalid timeout
Multiple settings
Verify Documentation Documentation for a user keyword
- Verify Teardown Teardown World
- Verify Timeout 6 minutes
+ Verify Teardown Teardown World
+ Verify Timeout 6 minutes
Invalid setting
Check Test Case ${TEST NAME}
@@ -127,15 +127,15 @@ Invalid empty line continuation in arguments should throw an error
Verify Documentation
[Arguments] ${doc} ${test}=${TEST NAME}
${tc} = Check Test Case ${test}
- Should Be Equal ${tc.kws[0].doc} ${doc}
+ Should Be Equal ${tc[0].doc} ${doc}
Verify Teardown
[Arguments] ${message}
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].teardown.full_name} BuiltIn.Log
- Check Log Message ${tc.kws[0].teardown.msgs[0]} ${message}
+ Should Be Equal ${tc[0].teardown.full_name} BuiltIn.Log
+ Check Log Message ${tc[0].teardown[0]} ${message}
Verify Timeout
[Arguments] ${timeout}
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].timeout} ${timeout}
+ Should Be Equal ${tc[0].timeout} ${timeout}
diff --git a/atest/robot/parsing/utf8_data/utf8_in_tsv.robot b/atest/robot/parsing/utf8_data/utf8_in_tsv.robot
index 5cf83c7bd4a..8b63e3cd8cf 100644
--- a/atest/robot/parsing/utf8_data/utf8_in_tsv.robot
+++ b/atest/robot/parsing/utf8_data/utf8_in_tsv.robot
@@ -1,25 +1,25 @@
*** Settings ***
-Suite Setup Run Tests ${EMPTY} parsing/utf8_data.tsv
-Resource atest_resource.robot
+Suite Setup Run Tests ${EMPTY} parsing/utf8_data.tsv
+Resource atest_resource.robot
*** Test Cases ***
UTF-8 In Metadata
- Should Be Equal ${SUITE.doc} Testing that reading and writing of Unicode (äöå §½€ etc.) works properly.
- Should Be Equal as Strings ${SUITE.metadata} {Ä: §}
- Check Test Tags UTF-8 tag-§ tag-€
- Check Test Doc UTF-8 äöå §½€
+ Should Be Equal ${SUITE.doc} Testing that reading and writing of Unicode (äöå §½€ etc.) works properly.
+ Should Be Equal As Strings ${SUITE.metadata} {Ä: §}
+ Check Test Tags UTF-8 tag-§ tag-€
+ Check Test Doc UTF-8 äöå §½€
UTF-8 In Keyword Arguments
- ${tc} = Check Test Case UTF-8
- Check Log Message ${tc.setup.msgs[0]} äöå
- Check Log Message ${tc.kws[0].msgs[0]} §½€
- Check Log Message ${tc.kws[1].msgs[0]} äöå §½€
- Check Log Message ${tc.kws[2].kws[0].msgs[0]} äöå
- Check Log Message ${tc.kws[2].kws[1].msgs[0]} äöå §½€
- Check Log Message ${tc.kws[2].kws[2].msgs[0]} §½€
+ ${tc} = Check Test Case UTF-8
+ Check Log Message ${tc.setup[0]} äöå
+ Check Log Message ${tc[0, 0]} §½€
+ Check Log Message ${tc[1, 0]} äöå §½€
+ Check Log Message ${tc[2, 0, 0]} äöå
+ Check Log Message ${tc[2, 1, 0]} äöå §½€
+ Check Log Message ${tc[2, 2, 0]} §½€
UTF-8 In Test Case And UK Names
- ${tc} = Check Test Case UTF-8 Name Äöå §½€"
- Check Keyword Data ${tc.kws[0]} Äöå §½€ \${ret}
- Check Log Message ${tc.kws[1].msgs[0]} äöå §½€
- Check Log Message ${tc.kws[3].msgs[0]} value
+ ${tc} = Check Test Case UTF-8 Name Äöå §½€"
+ Check Keyword Data ${tc[0]} Äöå §½€ \${ret}
+ Check Log Message ${tc[1, 0]} äöå §½€
+ Check Log Message ${tc[3, 0]} value
diff --git a/atest/robot/parsing/utf8_data/utf8_in_txt.robot b/atest/robot/parsing/utf8_data/utf8_in_txt.robot
index fca9e1856d3..c22049aa238 100644
--- a/atest/robot/parsing/utf8_data/utf8_in_txt.robot
+++ b/atest/robot/parsing/utf8_data/utf8_in_txt.robot
@@ -1,25 +1,25 @@
*** Settings ***
-Suite Setup Run Tests ${EMPTY} parsing/utf8_data.robot
-Resource atest_resource.robot
+Suite Setup Run Tests ${EMPTY} parsing/utf8_data.robot
+Resource atest_resource.robot
*** Test Cases ***
UTF-8 In Metadata
- Should Be Equal ${SUITE.doc} Testing that reading and writing of Unicode (äöå §½€ etc.) works properly.
- Should Be Equal as Strings ${SUITE.metadata} {Ä: §}
- Check Test Tags UTF-8 tag-§ tag-€
- Check Test Doc UTF-8 äöå §½€
+ Should Be Equal ${SUITE.doc} Testing that reading and writing of Unicode (äöå §½€ etc.) works properly.
+ Should Be Equal As Strings ${SUITE.metadata} {Ä: §}
+ Check Test Tags UTF-8 tag-§ tag-€
+ Check Test Doc UTF-8 äöå §½€
UTF-8 In Keyword Arguments
- ${tc} = Check Test Case UTF-8
- Check Log Message ${tc.setup.msgs[0]} äöå
- Check Log Message ${tc.kws[0].msgs[0]} §½€
- Check Log Message ${tc.kws[1].msgs[0]} äöå §½€
- Check Log Message ${tc.kws[2].kws[0].msgs[0]} äöå
- Check Log Message ${tc.kws[2].kws[1].msgs[0]} äöå §½€
- Check Log Message ${tc.kws[2].kws[2].msgs[0]} §½€
+ ${tc} = Check Test Case UTF-8
+ Check Log Message ${tc.setup[0]} äöå
+ Check Log Message ${tc[0, 0]} §½€
+ Check Log Message ${tc[1, 0]} äöå §½€
+ Check Log Message ${tc[2, 0, 0]} äöå
+ Check Log Message ${tc[2, 1, 0]} äöå §½€
+ Check Log Message ${tc[2, 2, 0]} §½€
UTF-8 In Test Case And UK Names
- ${tc} = Check Test Case UTF-8 Name Äöå §½€"
- Check Keyword Data ${tc.kws[0]} Äöå §½€ \${ret}
- Check Log Message ${tc.kws[1].msgs[0]} äöå §½€
- Check Log Message ${tc.kws[3].msgs[0]} value
+ ${tc} = Check Test Case UTF-8 Name Äöå §½€"
+ Check Keyword Data ${tc[0]} Äöå §½€ \${ret}
+ Check Log Message ${tc[1, 0]} äöå §½€
+ Check Log Message ${tc[3, 0]} value
diff --git a/atest/robot/rebot/compatibility.robot b/atest/robot/rebot/compatibility.robot
index 1957f5f8f56..4df330d0753 100644
--- a/atest/robot/rebot/compatibility.robot
+++ b/atest/robot/rebot/compatibility.robot
@@ -21,9 +21,9 @@ Suite only
Message directly under test
Run Rebot And Validate Statistics rebot/issue-3762.xml 1 0
${tc} = Check Test Case test A
- Check Log Message ${tc.body[0]} Hi from test WARN
- Check Log Message ${tc.body[1].body[0]} Hi from keyword WARN
- Check Log Message ${tc.body[2]} Hi from test again INFO
+ Check Log Message ${tc[0]} Hi from test WARN
+ Check Log Message ${tc[1, 0]} Hi from keyword WARN
+ Check Log Message ${tc[2]} Hi from test again INFO
*** Keywords ***
Run Rebot And Validate Statistics
diff --git a/atest/robot/rebot/filter_by_names.robot b/atest/robot/rebot/filter_by_names.robot
index 2293f80bbec..971b8a36e7a 100644
--- a/atest/robot/rebot/filter_by_names.robot
+++ b/atest/robot/rebot/filter_by_names.robot
@@ -22,16 +22,10 @@ ${INPUT FILE} %{TEMPDIR}${/}robot-test-file.xml
Run And Check Tests --test *one --test Fi?st First Second One Third One
Run And Check Tests --test [Great]Lob[sterB]estCase[!3-9] GlobTestCase1 GlobTestCase2
---test is cumulative with --include
- Run And Check Tests --test fifth --include t2 First Fifth Suite1 Second SubSuite3 Second
-
---exclude wins ovet --test
- Run And Check Tests --test fi* --exclude t1 Fifth
-
--test not matching
Failing Rebot
... Suite 'Root' contains no tests matching name 'nonex'.
- ... --test nonex ${INPUT FILE}
+ ... --test nonex
--test not matching with multiple inputs
Failing Rebot
@@ -41,6 +35,18 @@ ${INPUT FILE} %{TEMPDIR}${/}robot-test-file.xml
... Suite 'My Name' contains no tests matching name 'nonex'.
... --test nonex -N "My Name" ${INPUT FILE} ${INPUT FILE}
+--test and --include must both match
+ Run And Check Tests --test first --include t1 -i f1 First
+ Failing Rebot
+ ... Suite 'Root' contains no tests matching name 'fifth' and matching tag 't1'.
+ ... --test fifth --include t1
+
+--exclude wins over --test
+ Run And Check Tests --test fi* --exclude t1 Fifth
+ Failing Rebot
+ ... Suite 'Root' contains no tests matching name 'first' and not matching tag 'f1'.
+ ... --test first --exclude f1
+
--suite once
Run And Check Suites --suite tsuite1 Tsuite1
@@ -96,7 +102,7 @@ ${INPUT FILE} %{TEMPDIR}${/}robot-test-file.xml
Should Contain Tests ${SUITE} Suite1 First Suite3 First
--suite, --test, --include and --exclude
- Run Suites --suite sub* --suite "custom name *" --test *first -s nomatch -t nomatch --include sub3 --exclude t1
+ Run Suites --suite sub* --suite "custom name *" --test "subsuite3 second" -t *first -s nomatch -t nomatch --include f1 --exclude t1
Should Contain Suites ${SUITE} Suites
Should Contain Suites ${SUITE.suites[0]} Custom name for 📂 'subsuites2' Subsuites
Should Contain Tests ${SUITE} SubSuite2 First SubSuite3 Second
@@ -158,6 +164,6 @@ Run Suites
Stderr Should Be Empty
Failing Rebot
- [Arguments] ${error} ${options} ${sources}
+ [Arguments] ${error} ${options} ${sources}=${INPUT FILE}
Run Rebot Without Processing Output ${options} ${sources}
Stderr Should Be Equal To [ ERROR ] ${error}${USAGE TIP}\n
diff --git a/atest/robot/rebot/json_output_and_input.robot b/atest/robot/rebot/json_output_and_input.robot
index 56befc7dd2c..8fc26e2124f 100644
--- a/atest/robot/rebot/json_output_and_input.robot
+++ b/atest/robot/rebot/json_output_and_input.robot
@@ -7,20 +7,40 @@ ${XML} %{TEMPDIR}/rebot.xml
${JSON} %{TEMPDIR}/rebot.json
*** Test Cases ***
-JSON output
- Outputs should be equal ${JSON} ${XML}
+JSON output contains same suite information as XML output
+ Outputs Should Contain Same Data ${JSON} ${XML}
+
+JSON output structure
+ [Documentation] JSON schema validation would be good, but it's too slow with big output files.
+ ... The test after this one validates a smaller suite against a schema.
+ ${data} = Evaluate json.load(open($JSON, encoding='UTF-8'))
+ Lists Should Be Equal ${data} ${{['generator', 'generated', 'rpa', 'suite', 'statistics', 'errors']}}
+ Should Match ${data}[generator] Rebot ?.* (* on *)
+ Should Match ${data}[generated] 20??-??-??T??:??:??.??????
+ Should Be Equal ${data}[rpa] ${False}
+ Should Be Equal ${data}[suite][name] Misc
+ Should Be Equal ${data}[suite][suites][1][name] Everything
+ Should Be Equal ${data}[statistics][total][skip] ${3}
+ Should Be Equal ${data}[statistics][tags][4][label] f1
+ Should Be Equal ${data}[statistics][suites][-1][id] s1-s17
+ Should Be Equal ${data}[errors][0][level] ERROR
+
+JSON output schema validation
+ [Tags] require-jsonschema
+ Run Rebot Without Processing Output --suite Everything --output %{TEMPDIR}/everything.json ${JSON}
+ Validate JSON Output %{TEMPDIR}/everything.json
JSON input
Run Rebot ${EMPTY} ${JSON}
- Outputs should be equal ${JSON} ${OUTFILE}
+ Outputs Should Contain Same Data ${JSON} ${OUTFILE}
JSON input combined
Run Rebot ${EMPTY} ${XML} ${XML}
Copy Previous Outfile # Expected result
Run Rebot ${EMPTY} ${JSON} ${XML}
- Outputs should be equal ${OUTFILE} ${OUTFILE COPY}
+ Outputs Should Contain Same Data ${OUTFILE} ${OUTFILE COPY}
Run Rebot ${EMPTY} ${JSON} ${JSON}
- Outputs should be equal ${OUTFILE} ${OUTFILE COPY}
+ Outputs Should Contain Same Data ${OUTFILE} ${OUTFILE COPY}
Invalid JSON input
Create File ${JSON} bad
@@ -32,6 +52,14 @@ Invalid JSON input
... Invalid JSON data: *
Stderr Should Match [[] ERROR ] ${error}${USAGE TIP}\n
+Non-existing JSON input
+ Run Rebot Without Processing Output ${EMPTY} non_existing.json
+ ${json} = Normalize Path ${DATADIR}/non_existing.json
+ VAR ${error}
+ ... Reading JSON source '${json}' failed:
+ ... No such file or directory
+ Stderr Should Match [[] ERROR ] ${error}${USAGE TIP}\n
+
*** Keywords ***
Create XML and JSON outputs
Create Output With Robot ${XML} ${EMPTY} misc
diff --git a/atest/robot/rebot/merge.robot b/atest/robot/rebot/merge.robot
index 0d7cfc1a8e6..b2539d6214a 100644
--- a/atest/robot/rebot/merge.robot
+++ b/atest/robot/rebot/merge.robot
@@ -37,6 +37,10 @@ Merge suite documentation and metadata
[Setup] Should Be Equal ${PREV_TEST_STATUS} PASS
Suite documentation and metadata should have been merged
+Suite elapsed time should be updated
+ [Setup] Should Be Equal ${PREV_TEST_STATUS} PASS
+ Should Be True $SUITE.elapsed_time > $ORIGINAL_ELAPSED
+
Merge re-executed and re-re-executed tests
Re-run tests
Re-re-run tests
@@ -82,8 +86,8 @@ Merge ignores skip
... *HTML* Test has been re-executed and results merged.
... Latter result had SKIP status and was ignored. Message:
Should Contain Tests ${SUITE}
- ... Pass=PASS:${prefix}\nTest skipped using '--skip' command line option.
- ... Fail=FAIL:${prefix}\nTest skipped using '--skip' command line option.Original message:\nNot <b>HTML</b> fail
+ ... Pass=PASS:${prefix}\nTest skipped using 'NOT skip' tag pattern.
+ ... Fail=FAIL:${prefix}\nTest skipped using 'NOT skip' tag pattern.Original message:\nNot <b>HTML</b> fail
... Skip=SKIP:${prefix}\nHTML skipOriginal message:\nHTML skip
*** Keywords ***
@@ -95,6 +99,7 @@ Run original tests
... --metadata Original:True
Create Output With Robot ${ORIGINAL} ${options} ${SUITES}
Verify original tests
+ VAR ${ORIGINAL ELAPSED} ${SUITE.elapsed_time} scope=SUITE
Verify original tests
Should Be Equal ${SUITE.name} Suites
@@ -115,6 +120,7 @@ Re-run tests
... --variable TEARDOWN_MSG:New! # -- ;; --
... --variable SETUP:NONE # Affects misc/suites/subsuites/sub1.robot
... --variable TEARDOWN:NONE # -- ;; --
+ ... --variable SLEEP:0.5 # -- ;; --
... --rerunfailed ${ORIGINAL} ${options}
Create Output With Robot ${MERGE 1} ${options} ${SUITES}
Should Be Equal ${SUITE.name} Suites
@@ -178,8 +184,8 @@ Suite setup and teardown should have been merged
Should Be Equal ${SUITE.setup.full_name} BuiltIn.No Operation
Should Be Equal ${SUITE.teardown.name} ${NONE}
Should Be Equal ${SUITE.suites[1].name} Fourth
- Check Log Message ${SUITE.suites[1].setup.msgs[0]} Rerun!
- Check Log Message ${SUITE.suites[1].teardown.msgs[0]} New!
+ Check Log Message ${SUITE.suites[1].setup[0]} Rerun!
+ Check Log Message ${SUITE.suites[1].teardown[0]} New!
Should Be Equal ${SUITE.suites[2].suites[0].name} Sub1
Should Be Equal ${SUITE.suites[2].suites[0].setup.name} ${NONE}
Should Be Equal ${SUITE.suites[2].suites[0].teardown.name} ${NONE}
@@ -243,7 +249,7 @@ Warnings should have been merged
Check Log Message ${ERRORS[0]} Original message WARN
Check Log Message ${ERRORS[1]} Override WARN
${tc} = Check Test Case SubSuite1 First
- Check Log Message ${tc.kws[0].msgs[0]} Override WARN
+ Check Log Message ${tc[0, 0]} Override WARN
Merge should have failed
Stderr Should Be Equal To
diff --git a/atest/robot/rpa/run_rpa_tasks.robot b/atest/robot/rpa/run_rpa_tasks.robot
index 33de99babfa..b2d9b8a762e 100644
--- a/atest/robot/rpa/run_rpa_tasks.robot
+++ b/atest/robot/rpa/run_rpa_tasks.robot
@@ -39,7 +39,7 @@ Conflicting headers with --rpa are fine
Conflicting headers with --norpa are fine
[Template] Run and validate test cases
- --NorPA -v TIMEOUT:Test rpa/ @{ALL TASKS}
+ --NorPA -v TIMEOUT:Test -v RPA:False rpa/ @{ALL TASKS}
Conflicting headers in same file cause error
[Documentation] Using --rpa or --norpa doesn't affect the behavior.
diff --git a/atest/robot/rpa/task_aliases.robot b/atest/robot/rpa/task_aliases.robot
index 4a62e6aad09..533eab1baa1 100644
--- a/atest/robot/rpa/task_aliases.robot
+++ b/atest/robot/rpa/task_aliases.robot
@@ -4,25 +4,25 @@ Resource atest_resource.robot
*** Test Cases ***
Defaults
- ${tc} = Check Test Tags ${TESTNAME} task tags
- Check timeout message ${tc.setup.msgs[0]} 1 minute 10 seconds
- Check log message ${tc.setup.msgs[1]} Setup has an alias!
- Check timeout message ${tc.kws[0].msgs[0]} 1 minute 10 seconds
- Check log message ${tc.kws[0].msgs[1]} Using default settings
- Check log message ${tc.teardown.msgs[0]} Also teardown has an alias!!
- Should be equal ${tc.timeout} 1 minute 10 seconds
+ ${tc} = Check Test Tags ${TESTNAME} task tags
+ Check timeout message ${tc.setup[0]} 1 minute 10 seconds
+ Check log message ${tc.setup[1]} Setup has an alias!
+ Check timeout message ${tc[0, 0]} 1 minute 10 seconds
+ Check log message ${tc[0, 1]} Using default settings
+ Check log message ${tc.teardown[0]} Also teardown has an alias!!
+ Should be equal ${tc.timeout} 1 minute 10 seconds
Override
- ${tc} = Check Test Tags ${TESTNAME} task tags own
- Check log message ${tc.setup.msgs[0]} Overriding setup
- Check log message ${tc.kws[0].msgs[0]} Overriding settings
- Check log message ${tc.teardown.msgs[0]} Overriding teardown as well
- Should be equal ${tc.timeout} ${NONE}
+ ${tc} = Check Test Tags ${TESTNAME} task tags own
+ Check log message ${tc.setup[0]} Overriding setup
+ Check log message ${tc[0, 0]} Overriding settings
+ Check log message ${tc.teardown[0]} Overriding teardown as well
+ Should be equal ${tc.timeout} ${NONE}
Task timeout exceeded
${tc} = Check Test Case ${TESTNAME}
- Check timeout message ${tc.kws[0].msgs[0]} 99 milliseconds
- Check log message ${tc.kws[0].msgs[1]} Task timeout 99 milliseconds exceeded. FAIL
+ Check timeout message ${tc[0, 0]} 99 milliseconds
+ Check log message ${tc[0, 1]} Task timeout 99 milliseconds exceeded. FAIL
Invalid task timeout
Check Test Case ${TESTNAME}
@@ -44,16 +44,16 @@ Task settings are not allowed in resource file
In init file
Run Tests --loglevel DEBUG rpa/tasks
- ${tc} = Check Test Tags Defaults file tag task tags
- Check timeout message ${tc.setup.msgs[0]} 1 minute 10 seconds
- Check log message ${tc.setup.msgs[1]} Setup has an alias!
- Check timeout message ${tc.body[0].msgs[0]} 1 minute 10 seconds
- Check log message ${tc.teardown.msgs[0]} Also teardown has an alias!!
- Should be equal ${tc.timeout} 1 minute 10 seconds
- ${tc} = Check Test Tags Override file tag task tags own
- Check log message ${tc.setup.msgs[0]} Overriding setup
- Check log message ${tc.teardown.msgs[0]} Overriding teardown as well
- Should be equal ${tc.timeout} ${NONE}
+ ${tc} = Check Test Tags Defaults file tag task tags
+ Check timeout message ${tc.setup[0]} 1 minute 10 seconds
+ Check log message ${tc.setup[1]} Setup has an alias!
+ Check timeout message ${tc[0, 0]} 1 minute 10 seconds
+ Check log message ${tc.teardown[0]} Also teardown has an alias!!
+ Should be equal ${tc.timeout} 1 minute 10 seconds
+ ${tc} = Check Test Tags Override file tag task tags own
+ Check log message ${tc.setup[0]} Overriding setup
+ Check log message ${tc.teardown[0]} Overriding teardown as well
+ Should be equal ${tc.timeout} ${NONE}
Should be empty ${ERRORS}
*** Keywords ***
diff --git a/atest/robot/running/GetNestingLevel.py b/atest/robot/running/GetNestingLevel.py
new file mode 100644
index 00000000000..1f091c2a720
--- /dev/null
+++ b/atest/robot/running/GetNestingLevel.py
@@ -0,0 +1,21 @@
+from robot.api import SuiteVisitor
+
+
+class Nesting(SuiteVisitor):
+
+ def __init__(self):
+ self.level = 0
+ self.max = 0
+
+ def start_keyword(self, kw):
+ self.level += 1
+ self.max = max(self.level, self.max)
+
+ def end_keyword(self, kw):
+ self.level -= 1
+
+
+def get_nesting_level(test):
+ nesting = Nesting()
+ test.visit(nesting)
+ return nesting.max
diff --git a/atest/robot/running/continue_on_failure.robot b/atest/robot/running/continue_on_failure.robot
index bcffd3559c4..784d162727f 100644
--- a/atest/robot/running/continue_on_failure.robot
+++ b/atest/robot/running/continue_on_failure.robot
@@ -6,93 +6,93 @@ Resource atest_resource.robot
Continue in test
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[1].msgs[0]} This should be executed
+ Check Log Message ${tc[1, 0]} This should be executed
Continue in user keyword
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[1].msgs[0]} This should be executed in Test Case
+ Check Log Message ${tc[0, 1, 0]} This should be executed in Test Case
Continue in test with several continuable failures
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[1].msgs[0]} This should be executed
- Check Log Message ${tc.kws[3].msgs[0]} This should also be executed
- Check Log Message ${tc.kws[5].msgs[0]} This too should also be executed
+ Check Log Message ${tc[1, 0]} This should be executed
+ Check Log Message ${tc[3, 0]} This should also be executed
+ Check Log Message ${tc[5, 0]} This too should also be executed
Continue in user keyword with several continuable failures
${tc}= Check Test Case ${TESTNAME}
- Verify all failures in user keyword ${tc.kws[0]} Test Case
- Verify all failures in user keyword ${tc.kws[1]} Test Case, Again
+ Verify all failures in user keyword ${tc[0]} Test Case
+ Verify all failures in user keyword ${tc[1]} Test Case, Again
Continuable and regular failure
${tc}= Check Test Case ${TESTNAME}
- Length Should Be ${tc.kws} 4
- Should Be Equal ${tc.kws[-1].status} NOT RUN
+ Length Should Be ${tc.body} 4
+ Should Be Equal ${tc[-1].status} NOT RUN
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
+ Check Log Message ${tc[0, 1, 0]} This should be executed in Top Level UK (with ∏ön ÄßÇïï €§)
+ Verify all failures in user keyword ${tc[0, 2]} Nested UK
Continuable and regular failure in UK
Check Test Case ${TESTNAME}
Several continuable failures and regular failure in nested UK
${tc}= Check Test Case ${TESTNAME}
- Verify all failures in user keyword ${tc.kws[0].kws[2]} Nested UK
- Verify all failures in user keyword ${tc.kws[1].kws[1].kws[2]} Nested UK
+ Verify all failures in user keyword ${tc[0, 2]} Nested UK
+ Verify all failures in user keyword ${tc[1, 1, 2]} Nested UK
Continue when setting variables
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} \${ret} = None
- Check Log Message ${tc.kws[0].msgs[1]} ContinuableApocalypseException: Can be continued FAIL
- Check Log Message ${tc.kws[2].msgs[0]} \${r1} = None
- Check Log Message ${tc.kws[2].msgs[1]} \${r2} = None
- Check Log Message ${tc.kws[2].msgs[2]} \${r3} = None
- Check Log Message ${tc.kws[2].msgs[3]} ContinuableApocalypseException: Can be continued FAIL
- Check Log Message ${tc.kws[4].msgs[0]} \@{list} = [ ]
- Check Log Message ${tc.kws[4].msgs[1]} ContinuableApocalypseException: Can be continued FAIL
- Check Log Message ${tc.kws[6].msgs[0]} No jokes FAIL
- Length Should Be ${tc.kws[6].msgs} 1
+ Check Log Message ${tc[0, 0]} \${ret} = None
+ Check Log Message ${tc[0, 1]} ContinuableApocalypseException: Can be continued FAIL
+ Check Log Message ${tc[2, 0]} \${r1} = None
+ Check Log Message ${tc[2, 1]} \${r2} = None
+ Check Log Message ${tc[2, 2]} \${r3} = None
+ Check Log Message ${tc[2, 3]} ContinuableApocalypseException: Can be continued FAIL
+ Check Log Message ${tc[4, 0]} \@{list} = [ ]
+ Check Log Message ${tc[4, 1]} ContinuableApocalypseException: Can be continued FAIL
+ Check Log Message ${tc[6, 0]} No jokes FAIL
+ Length Should Be ${tc[6].body} 1
Continuable failure in user keyword returning value
Check Test Case ${TESTNAME}
Continue in test setup
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.setup.kws[1].msgs[0]} This should be executed in Test Setup
- Should Be Empty ${tc.kws}
+ Check Log Message ${tc.setup[1, 0]} This should be executed in Test Setup
+ Should Be Empty ${tc.body}
Continue in test teardown
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.teardown.kws[1].msgs[0]} This should be executed in Test Teardown
+ Check Log Message ${tc.teardown[1, 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 Empty ${tc.kws}
+ Verify all failures in user keyword ${tc.setup} Test Setup
+ Should Be Empty ${tc.body}
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
+ Check Log Message ${suite.teardown[1, 0]} This should be executed in Suite Teardown
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 ÄßÇïï €§)
+ Check Log Message ${suite.setup[1, 0]} This should be executed in Suite Setup (with ∏ön ÄßÇïï €§)
Continue in for loop
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} ContinuableApocalypseException: 0 FAIL
- Check Log Message ${tc.kws[0].kws[0].kws[1].msgs[0]} This should be executed inside for loop
- Check Log Message ${tc.kws[0].kws[1].kws[0].msgs[0]} ContinuableApocalypseException: 1 FAIL
- Check Log Message ${tc.kws[0].kws[1].kws[1].msgs[0]} This should be executed inside for loop
- Check Log Message ${tc.kws[0].kws[2].kws[0].msgs[0]} ContinuableApocalypseException: 2 FAIL
- Check Log Message ${tc.kws[0].kws[2].kws[1].msgs[0]} This should be executed inside for loop
- Check Log Message ${tc.kws[0].kws[3].kws[0].msgs[0]} ContinuableApocalypseException: 3 FAIL
- Check Log Message ${tc.kws[0].kws[3].kws[1].msgs[0]} This should be executed inside for loop
- Check Log Message ${tc.kws[0].kws[4].kws[0].msgs[0]} ContinuableApocalypseException: 4 FAIL
- Check Log Message ${tc.kws[0].kws[4].kws[1].msgs[0]} This should be executed inside for loop
- Check Log Message ${tc.kws[1].msgs[0]} This should be executed after for loop
+ Check Log Message ${tc[0, 0, 0, 0]} ContinuableApocalypseException: 0 FAIL
+ Check Log Message ${tc[0, 0, 1, 0]} This should be executed inside for loop
+ Check Log Message ${tc[0, 1, 0, 0]} ContinuableApocalypseException: 1 FAIL
+ Check Log Message ${tc[0, 1, 1, 0]} This should be executed inside for loop
+ Check Log Message ${tc[0, 2, 0, 0]} ContinuableApocalypseException: 2 FAIL
+ Check Log Message ${tc[0, 2, 1, 0]} This should be executed inside for loop
+ Check Log Message ${tc[0, 3, 0, 0]} ContinuableApocalypseException: 3 FAIL
+ Check Log Message ${tc[0, 3, 1, 0]} This should be executed inside for loop
+ Check Log Message ${tc[0, 4, 0, 0]} ContinuableApocalypseException: 4 FAIL
+ Check Log Message ${tc[0, 4, 1, 0]} This should be executed inside for loop
+ Check Log Message ${tc[1, 0]} This should be executed after for loop
Continuable and regular failure in for loop
Check Test Case ${TESTNAME}
@@ -102,9 +102,9 @@ robot.api.ContinuableFailure
*** 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}
+ Check Log Message ${kw[0, 0]} ContinuableApocalypseException: 1 FAIL
+ Check Log Message ${kw[1, 0]} This should be executed in ${where} (with ∏ön ÄßÇïï €§)
+ Check Log Message ${kw[2, 0]} ContinuableApocalypseException: 2 FAIL
+ Check Log Message ${kw[3, 0]} This should also be executed in ${where}
+ Check Log Message ${kw[4, 0]} ContinuableApocalypseException: 3 FAIL
+ Check Log Message ${kw[5, 0]} This too should also be executed in ${where}
diff --git a/atest/robot/running/detect_recursion.robot b/atest/robot/running/detect_recursion.robot
new file mode 100644
index 00000000000..cd50dc5d443
--- /dev/null
+++ b/atest/robot/running/detect_recursion.robot
@@ -0,0 +1,41 @@
+*** Settings ***
+Suite Setup Run Tests ${EMPTY} running/detect_recursion.robot
+Library GetNestingLevel.py
+Resource atest_resource.robot
+
+*** Test Cases ***
+Infinite recursion
+ Check Test Case ${TESTNAME}
+
+Infinite cyclic recursion
+ Check Test Case ${TESTNAME}
+
+Infinite recursion with Run Keyword
+ Check Test Case ${TESTNAME}
+
+Infinitely recursive for loop
+ Check Test Case ${TESTNAME}
+
+Recursion below the recursion limit is ok
+ [Documentation] Also verifies that recursion limit blown earlier doesn't affect subsequent tests
+ Check Test Case ${TESTNAME}
+
+Recursion limit is over 140 started keywords
+ ${tc} = Check Test Case Infinite recursion
+ ${level} = Get Nesting Level ${tc}
+ Should Be True 140 < ${level} < 160
+
+Recursion limit can be raised with `sys.setrecursionlimit`
+ [Setup] Should Be True sys.getrecursionlimit() == 1000
+ # Raise limit with executed tests using sitecustomize.py.
+ Create File %{TEMPDIR}/sitecustomize.py import sys; sys.setrecursionlimit(1500)
+ Set Environment Variable PYTHONPATH %{TEMPDIR}
+ # Also raise limit here to be able to process created outputs.
+ Evaluate sys.setrecursionlimit(1500)
+ Run Tests -t "Infinite recursion" running/detect_recursion.robot
+ ${tc} = Check Test Case Infinite recursion
+ ${level} = Get Nesting Level ${tc}
+ Should Be True 220 < ${level} < 240
+ [Teardown] Run Keywords
+ ... Remove File %{TEMPDIR}/sitecustomize.py AND
+ ... Evaluate sys.setrecursionlimit(1000)
diff --git a/atest/robot/running/duplicate_test_name.robot b/atest/robot/running/duplicate_test_name.robot
index 8996cfaf565..68133471a24 100644
--- a/atest/robot/running/duplicate_test_name.robot
+++ b/atest/robot/running/duplicate_test_name.robot
@@ -3,24 +3,35 @@ Suite Setup Run Tests --exclude exclude running/duplicate_test_name.
Resource atest_resource.robot
*** Test Cases ***
-Tests with same name should be executed
+Tests with same name are executed
Should Contain Tests ${SUITE}
- ... Same Test Multiple Times
- ... Same Test Multiple Times
- ... Same Test Multiple Times
- ... Same Test With Different Case And Spaces
- ... SameTestwith Different CASE and s p a c e s
- ... Same Test In Data But Only One Executed
+ ... Duplicates
+ ... Duplicates
+ ... Duplicates
+ ... Duplicates with different case and spaces
+ ... Duplicates with different CASE ands p a c e s
+ ... Duplicates but only one executed
+ ... Test 1 Test 2 Test 3
+ ... Duplicates after resolving variables
+ ... Duplicates after resolving variables
-There should be warning when multiple tests with same name are executed
- Check Multiple Tests Log Message ${ERRORS[0]} Same Test Multiple Times
- Check Multiple Tests Log Message ${ERRORS[1]} Same Test Multiple Times
- Check Multiple Tests Log Message ${ERRORS[2]} SameTestwith Different CASE and s p a c e s
+There is warning when multiple tests with same name are executed
+ Check Multiple Tests Log Message ${ERRORS[0]} Duplicates
+ Check Multiple Tests Log Message ${ERRORS[1]} Duplicates
+ Check Multiple Tests Log Message ${ERRORS[2]} Duplicates with different CASE ands p a c e s
-There should be no warning when there are multiple tests with same name in data but only one is executed
- ${tc} = Check Test Case Same Test In Data But Only One Executed
- Check Log Message ${tc.kws[0].msgs[0]} This is executed!
- Length Should Be ${ERRORS} 3
+There is warning if names are same after resolving variables
+ Check Multiple Tests Log Message ${ERRORS[3]} Duplicates after resolving variables
+
+There is no warning when there are multiple tests with same name but only one is executed
+ Check Test Case Duplicates but only one executed
+ Length Should Be ${ERRORS} 4
+
+Original name can be same if there is variable and its value changes
+ Check Test Case Test 1
+ Check Test Case Test 2
+ Check Test Case Test 3
+ Length Should Be ${ERRORS} 4
*** Keywords ***
Check Multiple Tests Log Message
diff --git a/atest/robot/running/exit_on_failure_tag.robot b/atest/robot/running/exit_on_failure_tag.robot
new file mode 100644
index 00000000000..f95649083ca
--- /dev/null
+++ b/atest/robot/running/exit_on_failure_tag.robot
@@ -0,0 +1,17 @@
+*** Settings ***
+Suite Setup Run Tests ${EMPTY} running/exit_on_failure_tag.robot
+Resource atest_resource.robot
+
+*** Test Cases ***
+Passing test with the tag has not special effect
+ Check Test Case ${TESTNAME}
+
+Failing test without the tag has no special effect
+ Check Test Case ${TESTNAME}
+
+Failing test with the tag initiates exit-on-failure
+ Check Test Case ${TESTNAME}
+
+Subsequent tests are not run
+ Check Test Case ${TESTNAME} 1
+ Check Test Case ${TESTNAME} 2
diff --git a/atest/robot/running/failures_in_teardown.robot b/atest/robot/running/failures_in_teardown.robot
index 8ab85190675..175af344269 100644
--- a/atest/robot/running/failures_in_teardown.robot
+++ b/atest/robot/running/failures_in_teardown.robot
@@ -6,16 +6,16 @@ Resource atest_resource.robot
*** Test Cases ***
One Failure
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.teardown.kws[1].msgs[0]} This should be executed
+ Check Log Message ${tc.teardown[1, 0]} This should be executed
Multiple Failures
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.teardown.kws[2].msgs[0]} This should also be executed
+ Check Log Message ${tc.teardown[2, 0]} This should also be executed
Failure When Setting Variables
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.teardown.kws[0].msgs[0]} \${ret} = None
- Check Log Message ${tc.teardown.kws[0].msgs[1]} Return values is None FAIL
+ Check Log Message ${tc.teardown[0, 0]} \${ret} = None
+ Check Log Message ${tc.teardown[0, 1]} Return values is None FAIL
Failure In For Loop
Check Test Case ${TESTNAME}
@@ -26,43 +26,63 @@ Execution Continues After Test Timeout
Execution Stops After Keyword Timeout
${tc} = Check Test Case ${TESTNAME}
- Length Should Be ${tc.teardown.kws} 2
- Should Be Equal ${tc.teardown.kws[-1].status} NOT RUN
+ Length Should Be ${tc.teardown.body} 2
+ Should Be Equal ${tc.teardown[-1].status} NOT RUN
-Execution Continues After Keyword Timeout Occurs In Executed Keyword
+Execution continues if executed keyword fails for keyword timeout
${tc} = Check Test Case ${TESTNAME}
- Length Should Be ${tc.teardown.body} 2
- Length Should Be ${tc.teardown.body[0].body} 2
- Should Be Equal ${tc.teardown.body[0].body[0].status} FAIL
- Should Be Equal ${tc.teardown.body[0].body[1].status} NOT RUN
- Should Be Equal ${tc.teardown.body[0].status} FAIL
- Should Be Equal ${tc.teardown.body[1].status} FAIL
+ Length Should Be ${tc.teardown.body} 2
+ Should Be Equal ${tc.teardown.body[0].status} FAIL
+ Should Be Equal ${tc.teardown.body[1].status} FAIL
+ Length Should Be ${tc.teardown.body[0].body} 2
+ Should Be Equal ${tc.teardown[0, 0].status} FAIL
+ Check Log Message ${tc.teardown}[0, 0, 0] Keyword timeout 42 milliseconds exceeded. FAIL
+ Should Be Equal ${tc.teardown[0, 1].status} NOT RUN
+ Length Should Be ${tc.teardown.body[1].body} 1
+ Check Log Message ${tc.teardown}[1, 0] This should be executed FAIL
+
+Execution stops after keyword timeout if keyword uses WUKS
+ ${tc} = Check Test Case ${TESTNAME}
+ Length Should Be ${tc.teardown.body} 2
+ Should Be Equal ${tc.teardown.body[0].status} FAIL
+ Should Be Equal ${tc.teardown.body[1].status} NOT RUN
+ Length Should Be ${tc.teardown.body[0].body} 2
+ Should Be Equal ${tc.teardown[0, 0].status} FAIL
+ Should Be Equal ${tc.teardown[0, 1].status} FAIL
+ Length Should Be ${tc.teardown[0, 0].body} 2
+ Should Be Equal ${tc.teardown[0, 0, 0].status} PASS
+ Should Be Equal ${tc.teardown[0, 0, 1].status} FAIL
+ Check Log Message ${tc.teardown}[0, 0, 1, 0] Failing! FAIL
+ Length Should Be ${tc.teardown[0, 1].body} 2
+ Should Be Equal ${tc.teardown[0, 1, 0].status} FAIL
+ Check Log Message ${tc.teardown}[0, 1, 0, 0] Keyword timeout 100 milliseconds exceeded. FAIL
+ Should Be Equal ${tc.teardown[0, 1, 1].status} NOT RUN
Execution Continues If Variable Does Not Exist
${tc} = Check Test Case ${TESTNAME}
- Length Should Be ${tc.teardown.kws} 3
+ Length Should Be ${tc.teardown.body} 3
Execution Continues After Keyword Errors
${tc} = Check Test Case ${TESTNAME}
- Length Should Be ${tc.teardown.kws} 3
+ Length Should Be ${tc.teardown.body} 3
Execution Stops After Syntax Error
${tc} = Check Test Case ${TESTNAME}
- Length Should Be ${tc.teardown.kws} 2
- Should Be Equal ${tc.teardown.kws[-1].status} NOT RUN
+ Length Should Be ${tc.teardown.body} 2
+ Should Be Equal ${tc.teardown[-1].status} NOT RUN
Fatal Error
${tc} = Check Test Case ${TESTNAME} 1
- Length Should Be ${tc.teardown.kws} 2
- Should Be Equal ${tc.teardown.kws[-1].status} NOT RUN
- Check Test Case ${TESTNAME} 2
+ Length Should Be ${tc.teardown.body} 2
+ Should Be Equal ${tc.teardown[-1].status} NOT RUN
+ Check Test Case ${TESTNAME} 2
Suite Teardown Is Executed Fully
${td} = Set Variable ${SUITE.teardown}
- Check Log Message ${td.kws[0].msgs[0]} Suite Message 1 FAIL
- Check Log Message ${td.kws[1].msgs[0]} Suite Message 2 (with ∏ön ÄßÇïï €§) FAIL
- Check Log Message ${td.kws[2].msgs[0]} Variable '\${it is ok not to exist}' not found. FAIL
- Check Log Message ${td.kws[3].msgs[0]} This should be executed
+ Check Log Message ${td[0, 0]} Suite Message 1 FAIL
+ Check Log Message ${td[1, 0]} Suite Message 2 (with ∏ön ÄßÇïï €§) FAIL
+ Check Log Message ${td[2, 0]} Variable '\${it is ok not to exist}' not found. FAIL
+ Check Log Message ${td[3, 0]} This should be executed
${msg} = Catenate SEPARATOR=\n\n
... Suite teardown failed:\nSeveral failures occurred:
... 1) Suite Message 1
@@ -73,5 +93,5 @@ Suite Teardown Is Executed Fully
Suite Teardown Should Stop At Fatal Error
Run Tests ${EMPTY} running/fatal_error_in_suite_teardown.robot
${ts} = Get Test Suite fatal error in suite teardown
- Length Should Be ${ts.teardown.kws} 2
- Should Be Equal ${ts.teardown.kws[-1].status} NOT RUN
+ Length Should Be ${ts.teardown.body} 2
+ Should Be Equal ${ts.teardown[-1].status} NOT RUN
diff --git a/atest/robot/running/fatal_exception.robot b/atest/robot/running/fatal_exception.robot
index 7166f538ad2..6c3898b42df 100644
--- a/atest/robot/running/fatal_exception.robot
+++ b/atest/robot/running/fatal_exception.robot
@@ -5,7 +5,7 @@ Resource atest_resource.robot
Exit From Python Keyword
Run Tests ${EMPTY} running/fatal_exception/01__python_library_kw.robot
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.teardown.msgs[0]} This should be executed
+ Check Log Message ${tc.teardown[0]} This should be executed
Check Test Case Test That Should Not Be Run 1
robot.api.FatalError
@@ -42,7 +42,7 @@ Multiple Suite Aware Exiting From Suite Setup
Run Tests ${EMPTY} running/fatal_exception_suite_setup/
Check Test Case Test That Should Not Be Run 1
${ts1} = Get Test Suite Suite Setup
- Should End With ${ts1.teardown.msgs[0].message} Tearing down 1
+ Should End With ${ts1.teardown[0].message} Tearing down 1
Check Test Case Test That Should Not Be Run 2.1
Check Test Case Test That Should Not Be Run 2.2
${ts2} = Get Test Suite Irrelevant
diff --git a/atest/robot/running/flatten.robot b/atest/robot/running/flatten.robot
index d9fe596666d..dd3ab863fd9 100644
--- a/atest/robot/running/flatten.robot
+++ b/atest/robot/running/flatten.robot
@@ -5,25 +5,28 @@ Resource atest_resource.robot
*** Test Cases ***
A single user keyword
${tc}= User keyword content should be flattened 1
- Check Log Message ${tc.body[0].messages[0]} From the main kw
+ Check Log Message ${tc[0, 0]} From the main kw
Nested UK
${tc}= User keyword content should be flattened 2
- Check Log Message ${tc.body[0].messages[0]} arg
- Check Log Message ${tc.body[0].messages[1]} from nested kw
+ Check Log Message ${tc[0, 0]} arg
+ Check Log Message ${tc[0, 1]} from nested kw
Loops and stuff
- ${tc}= User keyword content should be flattened 10
- Check Log Message ${tc.body[0].messages[0]} inside for 0
- Check Log Message ${tc.body[0].messages[1]} inside for 1
- Check Log Message ${tc.body[0].messages[2]} inside for 2
- Check Log Message ${tc.body[0].messages[3]} inside while 0
- Check Log Message ${tc.body[0].messages[4]} inside while 1
- Check Log Message ${tc.body[0].messages[5]} inside while 2
- Check Log Message ${tc.body[0].messages[6]} inside if
- Check Log Message ${tc.body[0].messages[7]} fail inside try FAIL
- Check Log Message ${tc.body[0].messages[8]} Traceback (most recent call last):* DEBUG pattern=True
- Check Log Message ${tc.body[0].messages[9]} inside except
+ ${tc}= User keyword content should be flattened 13
+ Check Log Message ${tc[0, 0]} inside for 0
+ Check Log Message ${tc[0, 1]} inside for 1
+ Check Log Message ${tc[0, 2]} inside for 2
+ Check Log Message ${tc[0, 3]} inside while 0
+ Check Log Message ${tc[0, 4]} \${LIMIT} = 1
+ Check Log Message ${tc[0, 5]} inside while 1
+ Check Log Message ${tc[0, 6]} \${LIMIT} = 2
+ Check Log Message ${tc[0, 7]} inside while 2
+ Check Log Message ${tc[0, 8]} \${LIMIT} = 3
+ Check Log Message ${tc[0, 9]} inside if
+ Check Log Message ${tc[0, 10]} fail inside try FAIL
+ Check Log Message ${tc[0, 11]} Traceback (most recent call last):* DEBUG pattern=True
+ Check Log Message ${tc[0, 12]} inside except
Recursion
User keyword content should be flattened 8
@@ -34,15 +37,15 @@ Listener methods start and end keyword are called
Log levels
Run Tests ${EMPTY} running/flatten.robot
${tc}= User keyword content should be flattened 4
- Check Log Message ${tc.body[0].messages[0]} INFO 1
- Check Log Message ${tc.body[0].messages[1]} Log level changed from INFO to DEBUG. DEBUG
- Check Log Message ${tc.body[0].messages[2]} INFO 2
- Check Log Message ${tc.body[0].messages[3]} DEBUG 2 level=DEBUG
+ Check Log Message ${tc[0, 0]} INFO 1
+ Check Log Message ${tc[0, 1]} Log level changed from INFO to DEBUG. DEBUG
+ Check Log Message ${tc[0, 2]} INFO 2
+ Check Log Message ${tc[0, 3]} DEBUG 2 level=DEBUG
*** Keywords ***
User keyword content should be flattened
[Arguments] ${expected_message_count}=0
${tc}= Check Test Case ${TESTNAME}
- Length Should Be ${tc.body[0].body} ${expected_message_count}
- Length Should Be ${tc.body[0].messages} ${expected_message_count}
+ Length Should Be ${tc[0].body} ${expected_message_count}
+ Length Should Be ${tc[0].messages} ${expected_message_count}
RETURN ${tc}
diff --git a/atest/robot/running/for/continue_for_loop.robot b/atest/robot/running/for/continue_for_loop.robot
index 4b4cc9f3c8a..59ab08e67b4 100644
--- a/atest/robot/running/for/continue_for_loop.robot
+++ b/atest/robot/running/for/continue_for_loop.robot
@@ -26,8 +26,8 @@ Continue For Loop In User Keyword Without For Loop Should Fail
Continue For Loop Keyword Should Log Info
${tc} = Check Test Case Simple Continue For Loop
- Should Be Equal ${tc.kws[0].kws[0].kws[0].full_name} BuiltIn.Continue For Loop
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} Continuing for loop from the next iteration.
+ Should Be Equal ${tc[0, 0, 0].full_name} BuiltIn.Continue For Loop
+ Check Log Message ${tc[0, 0, 0, 0]} Continuing for loop from the next iteration.
Continue For Loop In Test Teardown
Test And All Keywords Should Have Passed
diff --git a/atest/robot/running/for/exit_for_loop.robot b/atest/robot/running/for/exit_for_loop.robot
index 127d8708d00..aff02d26484 100644
--- a/atest/robot/running/for/exit_for_loop.robot
+++ b/atest/robot/running/for/exit_for_loop.robot
@@ -29,8 +29,8 @@ Exit For Loop In User Keyword Without For Loop Should Fail
Exit For Loop Keyword Should Log Info
${tc} = Check Test Case Simple Exit For Loop
- Should Be Equal ${tc.kws[0].kws[0].kws[0].full_name} BuiltIn.Exit For Loop
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} Exiting for loop altogether.
+ Should Be Equal ${tc[0, 0, 0].full_name} BuiltIn.Exit For Loop
+ Check Log Message ${tc[0, 0, 0, 0]} Exiting for loop altogether.
Exit For Loop In Test Teardown
Test And All Keywords Should Have Passed
diff --git a/atest/robot/running/for/for.resource b/atest/robot/running/for/for.resource
index 9a71e966d7d..9b29093eda6 100644
--- a/atest/robot/running/for/for.resource
+++ b/atest/robot/running/for/for.resource
@@ -10,21 +10,21 @@ Check test and get loop
Check test and failed loop
[Arguments] ${test name} ${type}=FOR ${loop index}=0 &{config}
${loop} = Check test and get loop ${test name} ${loop index}
- Length Should Be ${loop.body} 2
- Should Be Equal ${loop.body[0].type} ITERATION
- Should Be Equal ${loop.body[1].type} MESSAGE
+ Length Should Be ${loop.body} 2
+ Should Be Equal ${loop[0].type} ITERATION
+ Should Be Equal ${loop[1].type} MESSAGE
Run Keyword Should Be ${type} loop ${loop} 1 FAIL &{config}
Should be FOR loop
[Arguments] ${loop} ${iterations} ${status}=PASS ${flavor}=IN
... ${start}=${None} ${mode}=${None} ${fill}=${None}
- Should Be Equal ${loop.type} FOR
- Should Be Equal ${loop.flavor} ${flavor}
- Should Be Equal ${loop.start} ${start}
- Should Be Equal ${loop.mode} ${mode}
- Should Be Equal ${loop.fill} ${fill}
- Length Should Be ${loop.body.filter(messages=False)} ${iterations}
- Should Be Equal ${loop.status} ${status}
+ Should Be Equal ${loop.type} FOR
+ Should Be Equal ${loop.flavor} ${flavor}
+ Should Be Equal ${loop.start} ${start}
+ Should Be Equal ${loop.mode} ${mode}
+ Should Be Equal ${loop.fill} ${fill}
+ Length Should Be ${loop.non_messages} ${iterations}
+ Should Be Equal ${loop.status} ${status}
Should be IN RANGE loop
[Arguments] ${loop} ${iterations} ${status}=PASS
diff --git a/atest/robot/running/for/for.robot b/atest/robot/running/for/for.robot
index 0d7a2ec21e1..93e7769b44b 100644
--- a/atest/robot/running/for/for.robot
+++ b/atest/robot/running/for/for.robot
@@ -1,28 +1,28 @@
*** Settings ***
-Suite Setup Run Tests ${EMPTY} running/for/for.robot
+Suite Setup Run Tests --log log-tests-also-string-reprs.html running/for/for.robot
+Suite Teardown File Should Exist ${OUTDIR}/log-tests-also-string-reprs.html
Resource for.resource
*** Test Cases ***
Simple loop
- ${tc} = Check test case ${TEST NAME}
- ${loop} = Set variable ${tc.body[1]}
- Check log message ${tc.body[0].msgs[0]} Not yet in FOR
- Should be FOR loop ${loop} 2
- Should be FOR iteration ${loop.body[0]} \${var}=one
- Check log message ${loop.body[0].body[0].msgs[0]} var: one
- Should be FOR iteration ${loop.body[1]} \${var}=two
- Check log message ${loop.body[1].body[0].msgs[0]} var: two
- Check log message ${tc.body[2].body[0]} Not in FOR anymore
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Log Message ${tc[0, 0]} Not yet in FOR
+ Should be FOR loop ${tc[1]} 2
+ Should be FOR iteration ${tc[1, 0]} \${var}=one
+ Check Log Message ${tc[1, 0, 0, 0]} var: one
+ Should be FOR iteration ${tc[1, 1]} \${var}=two
+ Check Log Message ${tc[1, 1, 0, 0]} var: two
+ Check Log Message ${tc[2, 0]} Not in FOR anymore
Variables in values
${loop} = Check test and get loop ${TEST NAME}
- Should be FOR loop ${loop} 6
- "Variables in values" helper ${loop.kws[0]} 1
- "Variables in values" helper ${loop.kws[1]} 2
- "Variables in values" helper ${loop.kws[2]} 3
- "Variables in values" helper ${loop.kws[3]} 4
- "Variables in values" helper ${loop.kws[4]} 5
- "Variables in values" helper ${loop.kws[5]} 6
+ Should be FOR loop ${loop} 6
+ "Variables in values" helper ${loop[0]} 1
+ "Variables in values" helper ${loop[1]} 2
+ "Variables in values" helper ${loop[2]} 3
+ "Variables in values" helper ${loop[3]} 4
+ "Variables in values" helper ${loop[4]} 5
+ "Variables in values" helper ${loop[5]} 6
Indentation is not required
${loop} = Check test and get loop ${TEST NAME} 1
@@ -30,203 +30,203 @@ Indentation is not required
Values on multiple rows
${loop} = Check test and get loop ${TEST NAME}
- Should be FOR loop ${loop} 10
- Check log message ${loop.kws[0].kws[0].msgs[0]} 1
+ Should be FOR loop ${loop} 10
+ Check Log Message ${loop[0, 0, 0]} 1
FOR ${i} IN RANGE 10
- Check log message ${loop.kws[${i}].kws[0].msgs[0]} ${{str($i + 1)}}
+ Check Log Message ${loop[${i}, 0, 0]} ${{str($i + 1)}}
END
# Sanity check
- Check log message ${loop.kws[0].kws[0].msgs[0]} 1
- Check log message ${loop.kws[4].kws[0].msgs[0]} 5
- Check log message ${loop.kws[9].kws[0].msgs[0]} 10
+ Check Log Message ${loop[0, 0, 0]} 1
+ Check Log Message ${loop[4, 0, 0]} 5
+ Check Log Message ${loop[9, 0, 0]} 10
Keyword arguments on multiple rows
${loop} = Check test and get loop ${TEST NAME}
- Should be FOR loop ${loop} 2
- Check log message ${loop.kws[0].kws[1].msgs[0]} 1 2 3 4 5 6 7 one
- Check log message ${loop.kws[1].kws[1].msgs[0]} 1 2 3 4 5 6 7 two
+ Should be FOR loop ${loop} 2
+ Check Log Message ${loop[0, 1, 0]} 1 2 3 4 5 6 7 one
+ Check Log Message ${loop[1, 1, 0]} 1 2 3 4 5 6 7 two
Multiple loops in a test
- ${tc} = Check test case ${TEST NAME}
- Should be FOR loop ${tc.kws[0]} 2
- Check log message ${tc.kws[0].kws[0].kws[0].msgs[0]} In first loop with "foo"
- Check log message ${tc.kws[0].kws[1].kws[0].msgs[0]} In first loop with "bar"
- Should be FOR loop ${tc.kws[1]} 1
- Check kw "My UK 2" ${tc.kws[1].kws[0].kws[0]} Hello, world!
- Check log message ${tc.kws[2].msgs[0]} Outside loop
- Should be FOR loop ${tc.kws[3]} 2
- Check log message ${tc.kws[3].kws[0].kws[0].msgs[0]} Third loop
- Check log message ${tc.kws[3].kws[0].kws[2].msgs[0]} Value: a
- Check log message ${tc.kws[3].kws[1].kws[0].msgs[0]} Third loop
- Check log message ${tc.kws[3].kws[1].kws[2].msgs[0]} Value: b
- Check log message ${tc.kws[4].msgs[0]} The End
+ ${tc} = Check Test Case ${TEST NAME}
+ Should be FOR loop ${tc[0]} 2
+ Check Log Message ${tc[0, 0, 0, 0]} In first loop with "foo"
+ Check Log Message ${tc[0, 1, 0, 0]} In first loop with "bar"
+ Should be FOR loop ${tc[1]} 1
+ Check kw "My UK 2" ${tc[1, 0, 0]} Hello, world!
+ Check Log Message ${tc[2, 0]} Outside loop
+ Should be FOR loop ${tc[3]} 2
+ Check Log Message ${tc[3, 0, 0, 0]} Third loop
+ Check Log Message ${tc[3, 0, 2, 0]} Value: a
+ Check Log Message ${tc[3, 1, 0, 0]} Third loop
+ Check Log Message ${tc[3, 1, 2, 0]} Value: b
+ Check Log Message ${tc[4, 0]} The End
Nested loop syntax
- ${tc} = Check test case ${TEST NAME}
- Should be FOR loop ${tc.kws[0]} 3
- Should be FOR loop ${tc.kws[0].kws[0].kws[1]} 3
- Check log message ${tc.kws[0].kws[0].kws[0].msgs[0]} 1 in
- Check log message ${tc.kws[0].kws[0].kws[1].kws[0].kws[0].msgs[0]} values 1 a
- Check log message ${tc.kws[0].kws[0].kws[1].kws[1].kws[0].msgs[0]} values 1 b
- Check log message ${tc.kws[0].kws[0].kws[1].kws[2].kws[0].msgs[0]} values 1 c
- Check log message ${tc.kws[0].kws[0].kws[2].msgs[0]} 1 out
- Check log message ${tc.kws[0].kws[1].kws[0].msgs[0]} 2 in
- Check log message ${tc.kws[0].kws[1].kws[1].kws[0].kws[0].msgs[0]} values 2 a
- Check log message ${tc.kws[0].kws[1].kws[1].kws[1].kws[0].msgs[0]} values 2 b
- Check log message ${tc.kws[0].kws[1].kws[1].kws[2].kws[0].msgs[0]} values 2 c
- Check log message ${tc.kws[0].kws[1].kws[2].msgs[0]} 2 out
- Check log message ${tc.kws[0].kws[2].kws[0].msgs[0]} 3 in
- Check log message ${tc.kws[0].kws[2].kws[1].kws[0].kws[0].msgs[0]} values 3 a
- Check log message ${tc.kws[0].kws[2].kws[1].kws[1].kws[0].msgs[0]} values 3 b
- Check log message ${tc.kws[0].kws[2].kws[1].kws[2].kws[0].msgs[0]} values 3 c
- Check log message ${tc.kws[0].kws[2].kws[2].msgs[0]} 3 out
- Check log message ${tc.kws[1].msgs[0]} The End
+ ${tc} = Check Test Case ${TEST NAME}
+ Should be FOR loop ${tc[0]} 3
+ Should be FOR loop ${tc[0, 0, 1]} 3
+ Check Log Message ${tc[0, 0, 0, 0]} 1 in
+ Check Log Message ${tc[0, 0, 1, 0, 0, 0]} values 1 a
+ Check Log Message ${tc[0, 0, 1, 1, 0, 0]} values 1 b
+ Check Log Message ${tc[0, 0, 1, 2, 0, 0]} values 1 c
+ Check Log Message ${tc[0, 0, 2, 0]} 1 out
+ Check Log Message ${tc[0, 1, 0, 0]} 2 in
+ Check Log Message ${tc[0, 1, 1, 0, 0, 0]} values 2 a
+ Check Log Message ${tc[0, 1, 1, 1, 0, 0]} values 2 b
+ Check Log Message ${tc[0, 1, 1, 2, 0, 0]} values 2 c
+ Check Log Message ${tc[0, 1, 2, 0]} 2 out
+ Check Log Message ${tc[0, 2, 0, 0]} 3 in
+ Check Log Message ${tc[0, 2, 1, 0, 0, 0]} values 3 a
+ Check Log Message ${tc[0, 2, 1, 1, 0, 0]} values 3 b
+ Check Log Message ${tc[0, 2, 1, 2, 0, 0]} values 3 c
+ Check Log Message ${tc[0, 2, 2, 0]} 3 out
+ Check Log Message ${tc[1, 0]} The End
Multiple loops in a loop
- Check test case ${TEST NAME}
+ Check Test Case ${TEST NAME}
Deeply nested loops
- Check test case ${TEST NAME}
+ Check Test Case ${TEST NAME}
Settings after FOR
- ${tc} = Check test case ${TEST NAME}
- Should be FOR loop ${tc.kws[0]} 1
- Check log message ${tc.teardown.msgs[0]} Teardown was found and eXecuted.
+ ${tc} = Check Test Case ${TEST NAME}
+ Should be FOR loop ${tc[0]} 1
+ Check Log Message ${tc.teardown[0]} Teardown was found and eXecuted.
Looping over empty list variable is OK
- ${tc} = Check test case ${TEST NAME}
- Should be FOR loop ${tc.kws[0]} 1 NOT RUN
- Should be FOR iteration ${tc.body[0].body[0]} \${var}=
- Check keyword data ${tc.body[0].body[0].body[0]} BuiltIn.Fail args=Not executed status=NOT RUN
+ ${tc} = Check Test Case ${TEST NAME}
+ Should be FOR loop ${tc[0]} 1 NOT RUN
+ Should be FOR iteration ${tc[0, 0]} \${var}=
+ Check keyword data ${tc[0, 0, 0]} BuiltIn.Fail args=Not executed status=NOT RUN
Other iterables
- ${tc} = Check test case ${TEST NAME}
- Should be FOR loop ${tc.kws[2]} 10
+ ${tc} = Check Test Case ${TEST NAME}
+ Should be FOR loop ${tc[2]} 10
Failure inside FOR
${loop} = Check test and get loop ${TEST NAME} 1
- Should be FOR loop ${loop} 1 FAIL
- Check log message ${loop.kws[0].kws[0].msgs[0]} Hello before failing kw
- Should be equal ${loop.kws[0].kws[0].status} PASS
- Check log message ${loop.kws[0].kws[1].msgs[0]} Here we fail! FAIL
- Should be equal ${loop.kws[0].kws[1].status} FAIL
- Should be equal ${loop.kws[0].kws[2].status} NOT RUN
- Should be equal ${loop.kws[0].status} FAIL
- Length should be ${loop.kws[0].kws} 3
+ Should be FOR loop ${loop} 1 FAIL
+ Check Log Message ${loop[0, 0, 0]} Hello before failing kw
+ Should Be Equal ${loop[0, 0].status} PASS
+ Check Log Message ${loop[0, 1, 0]} Here we fail! FAIL
+ Should Be Equal ${loop[0, 1].status} FAIL
+ Should Be Equal ${loop[0, 2].status} NOT RUN
+ Should Be Equal ${loop[0].status} FAIL
+ Length Should Be ${loop[0].body} 3
${loop} = Check test and get loop ${TEST NAME} 2
- Should be FOR loop ${loop} 4 FAIL
- Check log message ${loop.kws[0].kws[0].msgs[0]} Before Check
- Check log message ${loop.kws[0].kws[2].msgs[0]} After Check
- Length should be ${loop.kws[0].kws} 3
- Should be equal ${loop.kws[0].status} PASS
- Should be equal ${loop.kws[1].status} PASS
- Should be equal ${loop.kws[2].status} PASS
- Check log message ${loop.kws[3].kws[0].msgs[0]} Before Check
- Check log message ${loop.kws[3].kws[1].msgs[0]} Failure with <4> FAIL
- Should be equal ${loop.kws[3].kws[2].status} NOT RUN
- Length should be ${loop.kws[3].kws} 3
- Should be equal ${loop.kws[3].status} FAIL
+ Should be FOR loop ${loop} 4 FAIL
+ Check Log Message ${loop[0, 0, 0]} Before Check
+ Check Log Message ${loop[0, 2, 0]} After Check
+ Length Should Be ${loop[0].body} 3
+ Should Be Equal ${loop[0].status} PASS
+ Should Be Equal ${loop[1].status} PASS
+ Should Be Equal ${loop[2].status} PASS
+ Check Log Message ${loop[3, 0, 0]} Before Check
+ Check Log Message ${loop[3, 1, 0]} Failure with <4> FAIL
+ Should Be Equal ${loop[3, 2].status} NOT RUN
+ Length Should Be ${loop[3].body} 3
+ Should Be Equal ${loop[3].status} FAIL
Loop with user keywords
${loop} = Check test and get loop ${TEST NAME}
Should be FOR loop ${loop} 2
- Check kw "My UK" ${loop.kws[0].kws[0]}
- Check kw "My UK 2" ${loop.kws[0].kws[1]} foo
- Check kw "My UK" ${loop.kws[1].kws[0]}
- Check kw "My UK 2" ${loop.kws[1].kws[1]} bar
+ Check kw "My UK" ${loop[0, 0]}
+ Check kw "My UK 2" ${loop[0, 1]} foo
+ Check kw "My UK" ${loop[1, 0]}
+ Check kw "My UK 2" ${loop[1, 1]} bar
Loop with failures in user keywords
- ${tc} = Check test case ${TEST NAME}
- Should be FOR loop ${tc.kws[0]} 2 FAIL
+ ${tc} = Check Test Case ${TEST NAME}
+ Should be FOR loop ${tc[0]} 2 FAIL
Loop in user keyword
- ${tc} = Check test case ${TEST NAME}
- Check kw "For In UK" ${tc.kws[0]}
- Check kw "For In UK with Args" ${tc.kws[1]} 4 one
+ ${tc} = Check Test Case ${TEST NAME}
+ Check kw "For In UK" ${tc[0]}
+ Check kw "For In UK with Args" ${tc[1]} 4 one
Keyword with loop calling other keywords with loops
- ${tc} = Check test case ${TEST NAME}
- Check kw "Nested For In UK" ${tc.kws[0]} foo
+ ${tc} = Check Test Case ${TEST NAME}
+ Check kw "Nested For In UK" ${tc[0]} foo
Test with loop calling keywords with loops
${loop} = Check test and get loop ${TEST NAME} 1
- Should be FOR loop ${loop} 1 FAIL
- Check kw "For In UK" ${loop.kws[0].kws[0]}
- Check kw "For In UK with Args" ${loop.kws[0].kws[1]} 2 one
- Check kw "Nested For In UK" ${loop.kws[0].kws[2]} one
+ Should be FOR loop ${loop} 1 FAIL
+ Check kw "For In UK" ${loop[0, 0]}
+ Check kw "For In UK with Args" ${loop[0, 1]} 2 one
+ Check kw "Nested For In UK" ${loop[0, 2]} one
Loop variables is available after loop
- Check test case ${TEST NAME}
+ Check Test Case ${TEST NAME}
Assign inside loop
${loop} = Check test and get loop ${TEST NAME}
Should be FOR loop ${loop} 2
- Check log message ${loop.kws[0].kws[0].msgs[0]} \${v1} = v1
- Check log message ${loop.kws[0].kws[1].msgs[0]} \${v2} = v2
- Check log message ${loop.kws[0].kws[1].msgs[1]} \${v3} = vY
- Check log message ${loop.kws[0].kws[2].msgs[0]} \@{list} = [ v1 | v2 | vY | Y ]
- Check log message ${loop.kws[1].kws[0].msgs[0]} \${v1} = v1
- Check log message ${loop.kws[1].kws[1].msgs[0]} \${v2} = v2
- Check log message ${loop.kws[1].kws[1].msgs[1]} \${v3} = vZ
- Check log message ${loop.kws[1].kws[2].msgs[0]} \@{list} = [ v1 | v2 | vZ | Z ]
+ Check Log Message ${loop[0, 0, 0]} \${v1} = v1
+ Check Log Message ${loop[0, 1, 0]} \${v2} = v2
+ Check Log Message ${loop[0, 1, 1]} \${v3} = vY
+ Check Log Message ${loop[0, 2, 0]} \@{list} = [ v1 | v2 | vY | Y ]
+ Check Log Message ${loop[1, 0, 0]} \${v1} = v1
+ Check Log Message ${loop[1, 1, 0]} \${v2} = v2
+ Check Log Message ${loop[1, 1, 1]} \${v3} = vZ
+ Check Log Message ${loop[1, 2, 0]} \@{list} = [ v1 | v2 | vZ | Z ]
Invalid assign inside loop
- ${tc} = Check test case ${TEST NAME}
- Should be FOR loop ${tc.kws[0]} 1 FAIL
+ ${tc} = Check Test Case ${TEST NAME}
+ Should be FOR loop ${tc[0]} 1 FAIL
Loop with non-existing keyword
- Check test case ${TEST NAME}
+ Check Test Case ${TEST NAME}
Loop with non-existing variable
- Check test case ${TEST NAME}
+ Check Test Case ${TEST NAME}
Loop value with non-existing variable
- Check test case ${TEST NAME}
+ Check Test Case ${TEST NAME}
Multiple loop variables
${tc} = Check Test Case ${TEST NAME}
- ${loop} = Set Variable ${tc.body[0]}
- Should be FOR loop ${loop} 4
- Should be FOR iteration ${loop.body[0]} \${x}=1 \${y}=a
- Check log message ${loop.body[0].body[0].msgs[0]} 1a
- Should be FOR iteration ${loop.body[1]} \${x}=2 \${y}=b
- Check log message ${loop.body[1].body[0].msgs[0]} 2b
- Should be FOR iteration ${loop.body[2]} \${x}=3 \${y}=c
- Check log message ${loop.body[2].body[0].msgs[0]} 3c
- Should be FOR iteration ${loop.body[3]} \${x}=4 \${y}=d
- Check log message ${loop.body[3].body[0].msgs[0]} 4d
- ${loop} = Set Variable ${tc.body[2]}
- Should be FOR loop ${loop} 2
- Should be FOR iteration ${loop.body[0]} \${a}=1 \${b}=2 \${c}=3 \${d}=4 \${e}=5
- Should be FOR iteration ${loop.body[1]} \${a}=1 \${b}=2 \${c}=3 \${d}=4 \${e}=5
+ ${loop} = Set Variable ${tc[0]}
+ Should be FOR loop ${loop} 4
+ Should be FOR iteration ${loop[0]} \${x}=1 \${y}=a
+ Check Log Message ${loop[0, 0, 0]} 1a
+ Should be FOR iteration ${loop[1]} \${x}=2 \${y}=b
+ Check Log Message ${loop[1, 0, 0]} 2b
+ Should be FOR iteration ${loop[2]} \${x}=3 \${y}=c
+ Check Log Message ${loop[2, 0, 0]} 3c
+ Should be FOR iteration ${loop[3]} \${x}=4 \${y}=d
+ Check Log Message ${loop[3, 0, 0]} 4d
+ ${loop} = Set Variable ${tc[2]}
+ Should be FOR loop ${loop} 2
+ Should be FOR iteration ${loop[0]} \${a}=1 \${b}=2 \${c}=3 \${d}=4 \${e}=5
+ Should be FOR iteration ${loop[1]} \${a}=1 \${b}=2 \${c}=3 \${d}=4 \${e}=5
Wrong number of loop variables
Check test and failed loop ${TEST NAME} 1
Check test and failed loop ${TEST NAME} 2
Cut long iteration variable values
- ${tc} = Check test case ${TEST NAME}
- ${loop} = Set Variable ${tc.body[6]}
+ ${tc} = Check Test Case ${TEST NAME}
+ ${loop} = Set Variable ${tc[6]}
${exp10} = Set Variable 0123456789
${exp100} = Evaluate "${exp10}" * 10
${exp200} = Evaluate "${exp10}" * 20
${exp200+} = Set Variable ${exp200}...
- Should be FOR loop ${loop} 6
- Should be FOR iteration ${loop.body[0]} \${var}=${exp10}
- Should be FOR iteration ${loop.body[1]} \${var}=${exp100}
- Should be FOR iteration ${loop.body[2]} \${var}=${exp200}
- Should be FOR iteration ${loop.body[3]} \${var}=${exp200+}
- Should be FOR iteration ${loop.body[4]} \${var}=${exp200+}
- Should be FOR iteration ${loop.body[5]} \${var}=${exp200+}
- ${loop} = Set Variable ${tc.body[7]}
- Should be FOR loop ${loop} 2
- Should be FOR iteration ${loop.body[0]} \${var1}=${exp10} \${var2}=${exp100} \${var3}=${exp200}
- Should be FOR iteration ${loop.body[1]} \${var1}=${exp200+} \${var2}=${exp200+} \${var3}=${exp200+}
+ Should be FOR loop ${loop} 6
+ Should be FOR iteration ${loop[0]} \${var}=${exp10}
+ Should be FOR iteration ${loop[1]} \${var}=${exp100}
+ Should be FOR iteration ${loop[2]} \${var}=${exp200}
+ Should be FOR iteration ${loop[3]} \${var}=${exp200+}
+ Should be FOR iteration ${loop[4]} \${var}=${exp200+}
+ Should be FOR iteration ${loop[5]} \${var}=${exp200+}
+ ${loop} = Set Variable ${tc[7]}
+ Should be FOR loop ${loop} 2
+ Should be FOR iteration ${loop[0]} \${var1}=${exp10} \${var2}=${exp100} \${var3}=${exp200}
+ Should be FOR iteration ${loop[1]} \${var1}=${exp200+} \${var2}=${exp200+} \${var3}=${exp200+}
Characters that are illegal in XML
- ${tc} = Check test case ${TEST NAME}
- Should be FOR iteration ${tc.body[0].body[0]} \${var}=illegal:
- Should be FOR iteration ${tc.body[0].body[1]} \${var}=more:
+ ${tc} = Check Test Case ${TEST NAME}
+ Should be FOR iteration ${tc[0, 0]} \${var}=illegal:
+ Should be FOR iteration ${tc[0, 1]} \${var}=more:
Old :FOR syntax is not supported
Check Test Case ${TESTNAME}
@@ -235,12 +235,12 @@ Escaping with backslash is not supported
Check Test Case ${TESTNAME}
FOR is case and space sensitive
- Check test case ${TEST NAME} 1
- Check test case ${TEST NAME} 2
+ Check Test Case ${TEST NAME} 1
+ Check Test Case ${TEST NAME} 2
Invalid END usage
- Check test case ${TEST NAME} 1
- Check test case ${TEST NAME} 2
+ Check Test Case ${TEST NAME} 1
+ Check Test Case ${TEST NAME} 2
Empty body
Check test and failed loop ${TEST NAME}
@@ -266,13 +266,13 @@ Invalid loop variable
Check test and failed loop ${TEST NAME} 6
Invalid separator
- Check test case ${TEST NAME}
+ Check Test Case ${TEST NAME}
Separator is case- and space-sensitive
- Check test case ${TEST NAME} 1
- Check test case ${TEST NAME} 2
- Check test case ${TEST NAME} 3
- Check test case ${TEST NAME} 4
+ Check Test Case ${TEST NAME} 1
+ Check Test Case ${TEST NAME} 2
+ Check Test Case ${TEST NAME} 3
+ Check Test Case ${TEST NAME} 4
FOR without any paramenters
Check Test Case ${TESTNAME}
@@ -283,10 +283,10 @@ Syntax error in nested loop
Unexecuted
${tc} = Check Test Case ${TESTNAME}
- Should be FOR loop ${tc.body[1].body[0].body[0]} 1 NOT RUN
- Should be FOR iteration ${tc.body[1].body[0].body[0].body[0]} \${x}= \${y}=
- Should be FOR loop ${tc.body[5]} 1 NOT RUN
- Should be FOR iteration ${tc.body[5].body[0]} \${x}= \${y}=
+ Should be FOR loop ${tc[1, 0, 0]} 1 NOT RUN
+ Should be FOR iteration ${tc[1, 0, 0, 0]} \${x}= \${y}=
+ Should be FOR loop ${tc[5]} 1 NOT RUN
+ Should be FOR iteration ${tc[5, 0]} \${x}= \${y}=
Header at the end of file
Check Test Case ${TESTNAME}
@@ -294,49 +294,49 @@ Header at the end of file
*** Keywords ***
"Variables in values" helper
[Arguments] ${kw} ${num}
- Check log message ${kw.kws[0].msgs[0]} ${num}
- Check log message ${kw.kws[1].msgs[0]} Hello from for loop
- Should be equal ${kw.kws[2].full_name} BuiltIn.No Operation
+ Check Log Message ${kw[0, 0]} ${num}
+ Check Log Message ${kw[1, 0]} Hello from for loop
+ Should Be Equal ${kw[2].full_name} BuiltIn.No Operation
Check kw "My UK"
[Arguments] ${kw}
- Should be equal ${kw.full_name} My UK
- Should be equal ${kw.kws[0].full_name} BuiltIn.No Operation
- Check log message ${kw.kws[1].msgs[0]} We are in My UK
+ Should Be Equal ${kw.full_name} My UK
+ Should Be Equal ${kw[0].full_name} BuiltIn.No Operation
+ Check Log Message ${kw[1, 0]} We are in My UK
Check kw "My UK 2"
[Arguments] ${kw} ${arg}
- Should be equal ${kw.full_name} My UK 2
- Check kw "My UK" ${kw.kws[0]}
- Check log message ${kw.kws[1].msgs[0]} My UK 2 got argument "${arg}"
- Check kw "My UK" ${kw.kws[2]}
+ Should Be Equal ${kw.full_name} My UK 2
+ Check kw "My UK" ${kw[0]}
+ Check Log Message ${kw[1, 0]} My UK 2 got argument "${arg}"
+ Check kw "My UK" ${kw[2]}
Check kw "For In UK"
[Arguments] ${kw}
- Should be equal ${kw.full_name} For In UK
- Check log message ${kw.kws[0].msgs[0]} Not for yet
- Should be FOR loop ${kw.kws[1]} 2
- Check log message ${kw.kws[1].kws[0].kws[0].msgs[0]} This is for with 1
- Check kw "My UK" ${kw.kws[1].kws[0].kws[1]}
- Check log message ${kw.kws[1].kws[1].kws[0].msgs[0]} This is for with 2
- Check kw "My UK" ${kw.kws[1].kws[1].kws[1]}
- Check log message ${kw.kws[2].msgs[0]} Not for anymore
+ Should Be Equal ${kw.full_name} For In UK
+ Check Log Message ${kw[0, 0]} Not for yet
+ Should be FOR loop ${kw[1]} 2
+ Check Log Message ${kw[1, 0, 0, 0]} This is for with 1
+ Check kw "My UK" ${kw[1, 0, 1]}
+ Check Log Message ${kw[1, 1, 0, 0]} This is for with 2
+ Check kw "My UK" ${kw[1, 1, 1]}
+ Check Log Message ${kw[2, 0]} Not for anymore
Check kw "For In UK With Args"
[Arguments] ${kw} ${arg_count} ${first_arg}
- Should be equal ${kw.full_name} For In UK With Args
- Should be FOR loop ${kw.kws[0]} ${arg_count}
- Check kw "My UK 2" ${kw.kws[0].kws[0].kws[0]} ${first_arg}
- Should be FOR loop ${kw.kws[2]} 1
- Check log message ${kw.kws[2].kws[0].kws[0].msgs[0]} This for loop is executed only once
+ Should Be Equal ${kw.full_name} For In UK With Args
+ Should be FOR loop ${kw[0]} ${arg_count}
+ Check kw "My UK 2" ${kw[0, 0, 0]} ${first_arg}
+ Should be FOR loop ${kw[2]} 1
+ Check Log Message ${kw[2, 0, 0, 0]} This for loop is executed only once
Check kw "Nested For In UK"
[Arguments] ${kw} ${first_arg}
- Should be FOR loop ${kw.kws[0]} 1 FAIL
- Check kw "For In UK" ${kw.kws[0].kws[0].kws[0]}
- ${nested2} = Set Variable ${kw.kws[0].kws[0].kws[1]}
- Should be equal ${nested2.full_name} Nested For In UK 2
- Should be FOR loop ${nested2.kws[0]} 2
- Check kw "For In UK" ${nested2.kws[0].kws[0].kws[0]}
- Check log message ${nested2.kws[0].kws[0].kws[1].msgs[0]} Got arg: ${first_arg}
- Check log message ${nested2.kws[1].msgs[0]} This ought to be enough FAIL
+ Should be FOR loop ${kw[0]} 1 FAIL
+ Check kw "For In UK" ${kw[0, 0, 0]}
+ ${nested2} = Set Variable ${kw[0, 0, 1]}
+ Should Be Equal ${nested2.full_name} Nested For In UK 2
+ Should be FOR loop ${nested2[0]} 2
+ Check kw "For In UK" ${nested2[0, 0, 0]}
+ Check Log Message ${nested2[0, 0, 1, 0]} Got arg: ${first_arg}
+ Check Log Message ${nested2[1, 0]} This ought to be enough FAIL
diff --git a/atest/robot/running/for/for_dict_iteration.robot b/atest/robot/running/for/for_dict_iteration.robot
index 52910c9337e..a8b840726fc 100644
--- a/atest/robot/running/for/for_dict_iteration.robot
+++ b/atest/robot/running/for/for_dict_iteration.robot
@@ -72,14 +72,14 @@ Equal sign in variable
... FOR loop iteration over values that are all in 'name=value' format like 'a=1' is deprecated.
... In the future this syntax will mean iterating over names and values separately like when iterating over '\&{dict} variables.
... Escape at least one of the values like 'a\\=1' to use normal FOR loop iteration and to disable this warning.
- Check Log Message ${tc.body[0].msgs[0]} ${message} WARN
- Check Log Message ${ERRORS}[0] ${message} WARN
+ Check Log Message ${tc[0, 0]} ${message} WARN
+ Check Log Message ${ERRORS}[0] ${message} WARN
${message} = Catenate
... FOR loop iteration over values that are all in 'name=value' format like 'x==1' is deprecated.
... In the future this syntax will mean iterating over names and values separately like when iterating over '\&{dict} variables.
... Escape at least one of the values like 'x\\==1' to use normal FOR loop iteration and to disable this warning.
- Check Log Message ${tc.body[2].msgs[0]} ${message} WARN
- Check Log Message ${ERRORS}[1] ${message} WARN
+ Check Log Message ${tc[2, 0]} ${message} WARN
+ Check Log Message ${ERRORS}[1] ${message} WARN
Non-string keys
Check Test Case ${TESTNAME}
diff --git a/atest/robot/running/for/for_in_range.robot b/atest/robot/running/for/for_in_range.robot
index 9c3f2c12a7a..0defe65d78d 100644
--- a/atest/robot/running/for/for_in_range.robot
+++ b/atest/robot/running/for/for_in_range.robot
@@ -5,65 +5,65 @@ Resource for.resource
*** Test Cases ***
Only stop
${loop} = Check test and get loop ${TEST NAME}
- Should be IN RANGE loop ${loop} 100
- Should be FOR iteration ${loop.body[0]} \${i}=0
- Check log message ${loop.body[0].body[1].msgs[0]} i: 0
- Should be FOR iteration ${loop.body[1]} \${i}=1
- Check log message ${loop.body[1].body[1].msgs[0]} i: 1
- Should be FOR iteration ${loop.body[42]} \${i}=42
- Check log message ${loop.body[42].body[1].msgs[0]} i: 42
- Should be FOR iteration ${loop.body[-1]} \${i}=99
- Check log message ${loop.body[-1].body[1].msgs[0]} i: 99
+ Should be IN RANGE loop ${loop} 100
+ Should be FOR iteration ${loop[0]} \${i}=0
+ Check log message ${loop[0, 1, 0]} i: 0
+ Should be FOR iteration ${loop[1]} \${i}=1
+ Check log message ${loop[1, 1, 0]} i: 1
+ Should be FOR iteration ${loop[42]} \${i}=42
+ Check log message ${loop[42, 1, 0]} i: 42
+ Should be FOR iteration ${loop[-1]} \${i}=99
+ Check log message ${loop[-1, 1, 0]} i: 99
Start and stop
- ${loop} = Check test and get loop ${TEST NAME}
- Should be IN RANGE loop ${loop} 4
+ ${loop} = Check test and get loop ${TEST NAME}
+ Should be IN RANGE loop ${loop} 4
Start, stop and step
- ${loop} = Check test and get loop ${TEST NAME}
- Should be IN RANGE loop ${loop} 3
- Should be FOR iteration ${loop.body[0]} \${item}=10
- Should be FOR iteration ${loop.body[1]} \${item}=7
- Should be FOR iteration ${loop.body[2]} \${item}=4
+ ${loop} = Check test and get loop ${TEST NAME}
+ Should be IN RANGE loop ${loop} 3
+ Should be FOR iteration ${loop[0]} \${item}=10
+ Should be FOR iteration ${loop[1]} \${item}=7
+ Should be FOR iteration ${loop[2]} \${item}=4
Float stop
- ${loop} = Check test and get loop ${TEST NAME} 1
- Should be IN RANGE loop ${loop} 4
- Should be FOR iteration ${loop.body[0]} \${item}=0.0
- Should be FOR iteration ${loop.body[1]} \${item}=1.0
- Should be FOR iteration ${loop.body[2]} \${item}=2.0
- Should be FOR iteration ${loop.body[3]} \${item}=3.0
- ${loop} = Check test and get loop ${TEST NAME} 2
- Should be IN RANGE loop ${loop} 3
- Should be FOR iteration ${loop.body[0]} \${item}=0.0
- Should be FOR iteration ${loop.body[1]} \${item}=1.0
- Should be FOR iteration ${loop.body[2]} \${item}=2.0
+ ${loop} = Check test and get loop ${TEST NAME} 1
+ Should be IN RANGE loop ${loop} 4
+ Should be FOR iteration ${loop[0]} \${item}=0.0
+ Should be FOR iteration ${loop[1]} \${item}=1.0
+ Should be FOR iteration ${loop[2]} \${item}=2.0
+ Should be FOR iteration ${loop[3]} \${item}=3.0
+ ${loop} = Check test and get loop ${TEST NAME} 2
+ Should be IN RANGE loop ${loop} 3
+ Should be FOR iteration ${loop[0]} \${item}=0.0
+ Should be FOR iteration ${loop[1]} \${item}=1.0
+ Should be FOR iteration ${loop[2]} \${item}=2.0
Float start and stop
- ${loop} = Check test and get loop ${TEST NAME} 1
- Should be IN RANGE loop ${loop} 3
- Should be FOR iteration ${loop.body[0]} \${item}=-1.5
- Should be FOR iteration ${loop.body[1]} \${item}=-0.5
- Should be FOR iteration ${loop.body[2]} \${item}=0.5
- ${loop} = Check test and get loop ${TEST NAME} 2 0
- Should be IN RANGE loop ${loop} 4
- Should be FOR iteration ${loop.body[0]} \${item}=-1.5
- Should be FOR iteration ${loop.body[1]} \${item}=-0.5
- Should be FOR iteration ${loop.body[2]} \${item}=0.5
- Should be FOR iteration ${loop.body[3]} \${item}=1.5
+ ${loop} = Check test and get loop ${TEST NAME} 1
+ Should be IN RANGE loop ${loop} 3
+ Should be FOR iteration ${loop[0]} \${item}=-1.5
+ Should be FOR iteration ${loop[1]} \${item}=-0.5
+ Should be FOR iteration ${loop[2]} \${item}=0.5
+ ${loop} = Check test and get loop ${TEST NAME} 2 0
+ Should be IN RANGE loop ${loop} 4
+ Should be FOR iteration ${loop[0]} \${item}=-1.5
+ Should be FOR iteration ${loop[1]} \${item}=-0.5
+ Should be FOR iteration ${loop[2]} \${item}=0.5
+ Should be FOR iteration ${loop[3]} \${item}=1.5
Float start, stop and step
- ${loop} = Check test and get loop ${TEST NAME}
- Should be IN RANGE loop ${loop} 3
- Should be FOR iteration ${loop.body[0]} \${item}=10.99
- Should be FOR iteration ${loop.body[1]} \${item}=7.95
- Should be FOR iteration ${loop.body[2]} \${item}=4.91
+ ${loop} = Check test and get loop ${TEST NAME}
+ Should be IN RANGE loop ${loop} 3
+ Should be FOR iteration ${loop[0]} \${item}=10.99
+ Should be FOR iteration ${loop[1]} \${item}=7.95
+ Should be FOR iteration ${loop[2]} \${item}=4.91
Variables in arguments
- ${loop} = Check test and get loop ${TEST NAME} 0
- Should be IN RANGE loop ${loop} 2
- ${loop} = Check test and get loop ${TEST NAME} 2
- Should be IN RANGE loop ${loop} 1
+ ${loop} = Check test and get loop ${TEST NAME} 0
+ Should be IN RANGE loop ${loop} 2
+ ${loop} = Check test and get loop ${TEST NAME} 2
+ Should be IN RANGE loop ${loop} 1
Calculations
Check test case ${TEST NAME}
@@ -72,15 +72,15 @@ Calculations with floats
Check test case ${TEST NAME}
Multiple variables
- ${loop} = Check test and get loop ${TEST NAME} 0
- Should be IN RANGE loop ${loop} 1
- Should be FOR iteration ${loop.body[0]} \${a}=0 \${b}=1 \${c}=2 \${d}=3 \${e}=4
- ${loop} = Check test and get loop ${TEST NAME} 2
- Should be IN RANGE loop ${loop} 4
- Should be FOR iteration ${loop.body[0]} \${i}=-1 \${j}=0 \${k}=1
- Should be FOR iteration ${loop.body[1]} \${i}=2 \${j}=3 \${k}=4
- Should be FOR iteration ${loop.body[2]} \${i}=5 \${j}=6 \${k}=7
- Should be FOR iteration ${loop.body[3]} \${i}=8 \${j}=9 \${k}=10
+ ${loop} = Check test and get loop ${TEST NAME} 0
+ Should be IN RANGE loop ${loop} 1
+ Should be FOR iteration ${loop[0]} \${a}=0 \${b}=1 \${c}=2 \${d}=3 \${e}=4
+ ${loop} = Check test and get loop ${TEST NAME} 2
+ Should be IN RANGE loop ${loop} 4
+ Should be FOR iteration ${loop[0]} \${i}=-1 \${j}=0 \${k}=1
+ Should be FOR iteration ${loop[1]} \${i}=2 \${j}=3 \${k}=4
+ Should be FOR iteration ${loop[2]} \${i}=5 \${j}=6 \${k}=7
+ Should be FOR iteration ${loop[3]} \${i}=8 \${j}=9 \${k}=10
Too many arguments
Check test and failed loop ${TEST NAME} IN RANGE
diff --git a/atest/robot/running/for/for_in_zip.robot b/atest/robot/running/for/for_in_zip.robot
index 41a9de220ea..987e080ff40 100644
--- a/atest/robot/running/for/for_in_zip.robot
+++ b/atest/robot/running/for/for_in_zip.robot
@@ -5,122 +5,122 @@ Resource for.resource
*** Test Cases ***
Two variables and lists
${loop} = Check test and get loop ${TEST NAME}
- Should be IN ZIP loop ${loop} 3
- Should be FOR iteration ${loop.body[0]} \${x}=a \${y}=x
- Should be FOR iteration ${loop.body[1]} \${x}=b \${y}=y
- Should be FOR iteration ${loop.body[2]} \${x}=c \${y}=z
+ Should be IN ZIP loop ${loop} 3
+ Should be FOR iteration ${loop[0]} \${x}=a \${y}=x
+ Should be FOR iteration ${loop[1]} \${x}=b \${y}=y
+ Should be FOR iteration ${loop[2]} \${x}=c \${y}=z
Uneven lists cause deprecation warning by default
${loop} = Check test and get loop ${TEST NAME}
- Should be IN ZIP loop ${loop} 3
- Check Log Message ${loop.body[0]}
+ Should be IN ZIP loop ${loop} 3
+ Check Log Message ${loop[0]}
... FOR IN ZIP default mode will be changed from SHORTEST to STRICT in Robot Framework 8.0. Use 'mode=SHORTEST' to keep using the SHORTEST mode. If the mode is not changed, execution will fail like this in the future: FOR IN ZIP items must have equal lengths in the STRICT mode, but lengths are 3 and 5. WARN
- Should be FOR iteration ${loop.body[1]} \${x}=a \${y}=1
- Should be FOR iteration ${loop.body[2]} \${x}=b \${y}=2
- Should be FOR iteration ${loop.body[3]} \${x}=c \${y}=3
+ Should be FOR iteration ${loop[1]} \${x}=a \${y}=1
+ Should be FOR iteration ${loop[2]} \${x}=b \${y}=2
+ Should be FOR iteration ${loop[3]} \${x}=c \${y}=3
Three variables and lists
${loop} = Check test and get loop ${TEST NAME}
- Should be IN ZIP loop ${loop} 3
- Should be FOR iteration ${loop.body[0]} \${x}=a \${y}=x \${z}=1
- Should be FOR iteration ${loop.body[1]} \${x}=b \${y}=y \${z}=2
- Should be FOR iteration ${loop.body[2]} \${x}=c \${y}=z \${z}=3
+ Should be IN ZIP loop ${loop} 3
+ Should be FOR iteration ${loop[0]} \${x}=a \${y}=x \${z}=1
+ Should be FOR iteration ${loop[1]} \${x}=b \${y}=y \${z}=2
+ Should be FOR iteration ${loop[2]} \${x}=c \${y}=z \${z}=3
Six variables and lists
${loop} = Check test and get loop ${TEST NAME}
- Should be IN ZIP loop ${loop} 3
- Should be FOR iteration ${loop.body[0]} \${x}=a \${y}=x \${z}=1 \${å}=1 \${ä}=x \${ö}=a
- Should be FOR iteration ${loop.body[1]} \${x}=b \${y}=y \${z}=2 \${å}=2 \${ä}=y \${ö}=b
- Should be FOR iteration ${loop.body[2]} \${x}=c \${y}=z \${z}=3 \${å}=3 \${ä}=z \${ö}=c
+ Should be IN ZIP loop ${loop} 3
+ Should be FOR iteration ${loop[0]} \${x}=a \${y}=x \${z}=1 \${å}=1 \${ä}=x \${ö}=a
+ Should be FOR iteration ${loop[1]} \${x}=b \${y}=y \${z}=2 \${å}=2 \${ä}=y \${ö}=b
+ Should be FOR iteration ${loop[2]} \${x}=c \${y}=z \${z}=3 \${å}=3 \${ä}=z \${ö}=c
One variable and list
${loop} = Check test and get loop ${TEST NAME}
- Should be IN ZIP loop ${loop} 3
- Should be FOR iteration ${loop.body[0]} \${x}=a
- Should be FOR iteration ${loop.body[1]} \${x}=b
- Should be FOR iteration ${loop.body[2]} \${x}=c
+ Should be IN ZIP loop ${loop} 3
+ Should be FOR iteration ${loop[0]} \${x}=a
+ Should be FOR iteration ${loop[1]} \${x}=b
+ Should be FOR iteration ${loop[2]} \${x}=c
One variable and two lists
${loop} = Check test and get loop ${TEST NAME}
- Should be IN ZIP loop ${loop} 3
- Should be FOR iteration ${loop.body[0]} \${x}=('a', 'x')
- Should be FOR iteration ${loop.body[1]} \${x}=('b', 'y')
- Should be FOR iteration ${loop.body[2]} \${x}=('c', 'z')
+ Should be IN ZIP loop ${loop} 3
+ Should be FOR iteration ${loop[0]} \${x}=('a', 'x')
+ Should be FOR iteration ${loop[1]} \${x}=('b', 'y')
+ Should be FOR iteration ${loop[2]} \${x}=('c', 'z')
One variable and six lists
${loop} = Check test and get loop ${TEST NAME}
- Should be IN ZIP loop ${loop} 3
- Should be FOR iteration ${loop.body[0]} \${x}=('a', 'x', 1, 1, 'x', 'a')
- Should be FOR iteration ${loop.body[1]} \${x}=('b', 'y', 2, 2, 'y', 'b')
- Should be FOR iteration ${loop.body[2]} \${x}=('c', 'z', 3, 3, 'z', 'c')
+ Should be IN ZIP loop ${loop} 3
+ Should be FOR iteration ${loop[0]} \${x}=('a', 'x', 1, 1, 'x', 'a')
+ Should be FOR iteration ${loop[1]} \${x}=('b', 'y', 2, 2, 'y', 'b')
+ Should be FOR iteration ${loop[2]} \${x}=('c', 'z', 3, 3, 'z', 'c')
Other iterables
Check Test Case ${TEST NAME}
List variable containing iterables
${loop} = Check test and get loop ${TEST NAME} 1
- Should be IN ZIP loop ${loop} 3
- Should be FOR iteration ${loop.body[0]} \${x}=a \${y}=x \${z}=f
- Should be FOR iteration ${loop.body[1]} \${x}=b \${y}=y \${z}=o
- Should be FOR iteration ${loop.body[2]} \${x}=c \${y}=z \${z}=o
+ Should be IN ZIP loop ${loop} 3
+ Should be FOR iteration ${loop[0]} \${x}=a \${y}=x \${z}=f
+ Should be FOR iteration ${loop[1]} \${x}=b \${y}=y \${z}=o
+ Should be FOR iteration ${loop[2]} \${x}=c \${y}=z \${z}=o
List variable with iterables can be empty
${tc} = Check Test Case ${TEST NAME}
- Should be IN ZIP loop ${tc.body[0]} 1 NOT RUN
- Should be FOR iteration ${tc.body[0].body[0]} \${x}=
- Should be IN ZIP loop ${tc.body[1]} 1 NOT RUN
- Should be FOR iteration ${tc.body[1].body[0]} \${x}= \${y}= \${z}=
- Check Log Message ${tc.body[2].msgs[0]} Executed!
+ Should be IN ZIP loop ${tc[0]} 1 NOT RUN
+ Should be FOR iteration ${tc[0, 0]} \${x}=
+ Should be IN ZIP loop ${tc[1]} 1 NOT RUN
+ Should be FOR iteration ${tc[1, 0]} \${x}= \${y}= \${z}=
+ Check Log Message ${tc[2, 0]} Executed!
Strict mode
${tc} = Check Test Case ${TEST NAME}
- Should be IN ZIP loop ${tc.body[0]} 3 PASS mode=STRICT
- Should be IN ZIP loop ${tc.body[2]} 1 FAIL mode=strict
+ Should be IN ZIP loop ${tc[0]} 3 PASS mode=STRICT
+ Should be IN ZIP loop ${tc[2]} 1 FAIL mode=strict
Strict mode requires items to have length
${tc} = Check Test Case ${TEST NAME}
- Should be IN ZIP loop ${tc.body[0]} 1 FAIL mode=STRICT
+ Should be IN ZIP loop ${tc[0]} 1 FAIL mode=STRICT
Shortest mode
${tc} = Check Test Case ${TEST NAME}
- Should be IN ZIP loop ${tc.body[0]} 3 PASS mode=SHORTEST fill=ignored
- Should be IN ZIP loop ${tc.body[3]} 3 PASS mode=\${{'shortest'}}
+ Should be IN ZIP loop ${tc[0]} 3 PASS mode=SHORTEST fill=ignored
+ Should be IN ZIP loop ${tc[3]} 3 PASS mode=\${{'shortest'}}
Shortest mode supports infinite iterators
${tc} = Check Test Case ${TEST NAME}
- Should be IN ZIP loop ${tc.body[0]} 3 PASS mode=SHORTEST
+ Should be IN ZIP loop ${tc[0]} 3 PASS mode=SHORTEST
Longest mode
${tc} = Check Test Case ${TEST NAME}
- Should be IN ZIP loop ${tc.body[0]} 3 PASS mode=LONGEST
- Should be IN ZIP loop ${tc.body[3]} 5 PASS mode=LoNgEsT
+ Should be IN ZIP loop ${tc[0]} 3 PASS mode=LONGEST
+ Should be IN ZIP loop ${tc[3]} 5 PASS mode=LoNgEsT
Longest mode with custom fill value
${tc} = Check Test Case ${TEST NAME}
- Should be IN ZIP loop ${tc.body[0]} 5 PASS mode=longest fill=?
- Should be IN ZIP loop ${tc.body[3]} 3 PASS mode=longest fill=\${0}
+ Should be IN ZIP loop ${tc[0]} 5 PASS mode=longest fill=?
+ Should be IN ZIP loop ${tc[3]} 3 PASS mode=longest fill=\${0}
Invalid mode
${tc} = Check Test Case ${TEST NAME}
- Should be IN ZIP loop ${tc.body[0]} 1 FAIL mode=bad
+ Should be IN ZIP loop ${tc[0]} 1 FAIL mode=bad
Invalid mode from variable
${tc} = Check Test Case ${TEST NAME}
- Should be IN ZIP loop ${tc.body[0]} 1 FAIL mode=\${{'bad'}}
+ Should be IN ZIP loop ${tc[0]} 1 FAIL mode=\${{'bad'}}
Config more than once
${tc} = Check Test Case ${TEST NAME} 1
- Should be IN ZIP loop ${tc.body[0]} 1 FAIL mode=shortest
+ Should be IN ZIP loop ${tc[0]} 1 FAIL mode=shortest
${tc} = Check Test Case ${TEST NAME} 2
- Should be IN ZIP loop ${tc.body[0]} 1 FAIL fill=z
+ Should be IN ZIP loop ${tc[0]} 1 FAIL fill=z
Non-existing variable in mode
${tc} = Check Test Case ${TEST NAME}
- Should be IN ZIP loop ${tc.body[0]} 1 FAIL mode=\${bad} fill=\${ignored}
+ Should be IN ZIP loop ${tc[0]} 1 FAIL mode=\${bad} fill=\${ignored}
Non-existing variable in fill value
${tc} = Check Test Case ${TEST NAME}
- Should be IN ZIP loop ${tc.body[0]} 1 FAIL mode=longest fill=\${bad}
+ Should be IN ZIP loop ${tc[0]} 1 FAIL mode=longest fill=\${bad}
Not iterable value
Check test and failed loop ${TEST NAME} IN ZIP
diff --git a/atest/robot/running/group/group.robot b/atest/robot/running/group/group.robot
new file mode 100644
index 00000000000..f579f090cf5
--- /dev/null
+++ b/atest/robot/running/group/group.robot
@@ -0,0 +1,42 @@
+*** Settings ***
+Suite Setup Run Tests ${EMPTY} running/group/group.robot
+Resource atest_resource.robot
+
+*** Test Cases ***
+Basics
+ ${tc}= Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=GROUP name=1st group children=2
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD name=Log args=Inside group
+ Check Body Item Data ${tc[0, 1]} type=KEYWORD name=Log args=Still inside
+ Check Body Item Data ${tc[1]} type=GROUP name=second children=1
+ Check Body Item Data ${tc[1, 0]} type=KEYWORD name=Log args=Inside second group
+ Check Body Item Data ${tc[2]} type=KEYWORD name=Log args=After
+
+Failing
+ ${tc}= Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=GROUP name=Fails children=2 status=FAIL message=Failing inside GROUP!
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD name=Fail children=1 status=FAIL message=Failing inside GROUP!
+ Check Body Item Data ${tc[0, 1]} type=KEYWORD name=Fail children=0 status=NOT RUN
+ Check Body Item Data ${tc[1]} type=GROUP name=Not run children=1 status=NOT RUN
+ Check Body Item Data ${tc[1, 0]} type=KEYWORD name=Fail children=0 status=NOT RUN
+
+Anonymous
+ ${tc}= Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=GROUP name=${EMPTY} children=1
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD name=Log args=Inside unnamed group
+
+Variable in name
+ ${tc}= Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=GROUP name=Test is named: ${TEST NAME} children=1
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD name=Log args=\${TEST_NAME}
+ Check Log Message ${tc[0, 0, 0]} ${TEST NAME}
+ Check Body Item Data ${tc[1]} type=GROUP name=42 children=1
+ Check Body Item Data ${tc[1, 0]} type=KEYWORD name=Log args=Should be 42
+
+In user keyword
+ ${tc}= Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=KEYWORD name=Keyword children=4
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD name=Log args=Before
+ Check Body Item Data ${tc[0, 1]} type=GROUP name=First children=2
+ Check Body Item Data ${tc[0, 2]} type=GROUP name=Second children=1
+ Check Body Item Data ${tc[0, 3]} type=KEYWORD name=Log args=After
diff --git a/atest/robot/running/group/invalid_group.robot b/atest/robot/running/group/invalid_group.robot
new file mode 100644
index 00000000000..f6d415cdaf9
--- /dev/null
+++ b/atest/robot/running/group/invalid_group.robot
@@ -0,0 +1,44 @@
+*** Settings ***
+Suite Setup Run Tests ${EMPTY} running/group/invalid_group.robot
+Resource atest_resource.robot
+
+*** Test Cases ***
+END missing
+ ${tc} = Check Test Case ${TESTNAME}
+ Length Should Be ${tc.body} 1
+ Check Body Item Data ${tc[0]} GROUP status=FAIL children=2 message=GROUP must have closing END.
+ Check Body Item Data ${tc[0, 0]} KEYWORD status=NOT RUN children=0 name=Fail args=Not run
+ Check Body Item Data ${tc[0, 1]} MESSAGE level=FAIL message=GROUP must have closing END.
+
+Empty
+ ${tc} Check Test Case ${TESTNAME}
+ Length Should Be ${tc.body} 2
+ Check Body Item Data ${tc[0]} GROUP status=FAIL children=1 message=GROUP cannot be empty.
+ Check Body Item Data ${tc[0, 0]} MESSAGE level=FAIL message=GROUP cannot be empty.
+ Check Body Item Data ${tc[1]} KEYWORD status=NOT RUN children=0 name=Log args=Outside
+
+Multiple parameters
+ ${tc} Check Test Case ${TESTNAME}
+ Length Should Be ${tc.body} 2
+ Check Body Item Data ${tc[0]} GROUP status=FAIL children=2 message=GROUP accepts only one argument as name, got 3 arguments 'Too', 'many' and 'values'.
+ Check Body Item Data ${tc[0, 0]} KEYWORD status=NOT RUN children=0 name=Fail args=Not run
+ Check Body Item Data ${tc[0, 1]} MESSAGE level=FAIL message=GROUP accepts only one argument as name, got 3 arguments 'Too', 'many' and 'values'.
+ Check Body Item Data ${tc[1]} KEYWORD status=NOT RUN children=0 name=Log args=Last Keyword
+
+Non-existing variable in name
+ ${tc} Check Test Case ${TESTNAME}
+ Length Should Be ${tc.body} 2
+ Check Body Item Data ${tc[0]} GROUP status=FAIL children=2 message=Variable '\${non_existing_var}' not found. name=\${non_existing_var} in name
+ Check Body Item Data ${tc[0, 0]} KEYWORD status=NOT RUN children=0 name=Fail args=Not run
+ Check Body Item Data ${tc[0, 1]} MESSAGE level=FAIL message=Variable '\${non_existing_var}' not found.
+ Check Body Item Data ${tc[1]} KEYWORD status=NOT RUN children=0 name=Log args=Last Keyword
+
+Invalid data is not reported after failures
+ ${tc} Check Test Case ${TESTNAME}
+ Length Should Be ${tc.body} 4
+ Check Body Item Data ${tc[0]} KEYWORD status=FAIL children=1 name=Fail args=Something bad happened! message=Something bad happened!
+ Check Body Item Data ${tc[1]} GROUP status=NOT RUN children=1 name=\${non_existing_non_executed_variable_is_ok}
+ Check Body Item Data ${tc[1, 0]} KEYWORD status=NOT RUN children=0 name=Fail args=Not run
+ Check Body Item Data ${tc[2]} GROUP status=NOT RUN children=0 name=Empty non-executed GROUP is ok
+ Check Body Item Data ${tc[3]} GROUP status=NOT RUN children=1 name=Even missing END is ok
+ Check Body Item Data ${tc[3, 0]} KEYWORD status=NOT RUN children=0 name=Fail args=Not run
diff --git a/atest/robot/running/group/nesting_group.robot b/atest/robot/running/group/nesting_group.robot
new file mode 100644
index 00000000000..1d612e0c189
--- /dev/null
+++ b/atest/robot/running/group/nesting_group.robot
@@ -0,0 +1,51 @@
+*** Settings ***
+Suite Setup Run Tests ${EMPTY} running/group/nesting_group.robot
+Resource atest_resource.robot
+
+*** Test Cases ***
+Nested
+ ${tc} Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=GROUP name=
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD name=Set Variable
+ Check Body Item Data ${tc[0, 1]} type=GROUP name=This Is A Named Group
+ Check Body Item Data ${tc[0, 1, 0]} type=KEYWORD name=Should Be Equal
+
+With other control structures
+ ${tc} Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=IF/ELSE ROOT
+ Check Body Item Data ${tc[0, 0]} type=IF condition=True children=2
+ Check Body Item Data ${tc[0, 0, 0]} type=GROUP name=Hello children=1
+ Check Body Item Data ${tc[0, 0, 0, 0]} type=VAR name=\${i}
+ Check Body Item Data ${tc[0, 0, 1]} type=GROUP name=With WHILE children=2
+ Check Body Item Data ${tc[0, 0, 1, 0]} type=WHILE condition=$i < 2 children=2
+ Check Body Item Data ${tc[0, 0, 1, 0, 0]} type=ITERATION
+ Check Body Item Data ${tc[0, 0, 1, 0, 0, 0]} type=GROUP name=Group1 Inside WHILE (0) children=1
+ Check Body Item Data ${tc[0, 0, 1, 0, 0, 0, 0]} type=KEYWORD name=Log args=\${i}
+ Check Body Item Data ${tc[0, 0, 1, 0, 0, 1]} type=GROUP name=Group2 Inside WHILE children=1
+ Check Body Item Data ${tc[0, 0, 1, 0, 0, 1, 0]} type=VAR name=\${i} value=\${i + 1}
+ Check Body Item Data ${tc[0, 0, 1, 0, 1]} type=ITERATION
+ Check Body Item Data ${tc[0, 0, 1, 0, 1, 0]} type=GROUP name=Group1 Inside WHILE (1) children=1
+ Check Body Item Data ${tc[0, 0, 1, 0, 1, 0, 0]} type=KEYWORD name=Log args=\${i}
+ Check Body Item Data ${tc[0, 0, 1, 0, 1, 1]} type=GROUP name=Group2 Inside WHILE children=1
+ Check Body Item Data ${tc[0, 0, 1, 0, 1, 1, 0]} type=VAR name=\${i} value=\${i + 1}
+ Check Body Item Data ${tc[0, 0, 1, 1]} type=IF/ELSE ROOT
+ Check Body Item Data ${tc[0, 0, 1, 1, 0]} type=IF status=NOT RUN condition=$i != 2 children=1
+ Check Body Item Data ${tc[0, 0, 1, 1, 0, 0]} type=KEYWORD status=NOT RUN name=Fail args=Shall be logged but NOT RUN
+
+In non-executed branch
+ ${tc} Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=VAR name=\${var} value=value
+ Check Body Item Data ${tc[1]} type=IF/ELSE ROOT
+ Check Body Item Data ${tc[1, 0]} type=IF condition=True children=1
+ Check Body Item Data ${tc[1, 0, 0]} type=GROUP name=GROUP in IF children=2
+ Check Body Item Data ${tc[1, 0, 0, 0]} type=KEYWORD name=Should Be Equal
+ Check Body Item Data ${tc[1, 0, 0, 1]} type=IF/ELSE ROOT
+ Check Body Item Data ${tc[1, 0, 0, 1, 0]} type=IF status=PASS children=1 condition=True
+ Check Body Item Data ${tc[1, 0, 0, 1, 0, 0]} type=KEYWORD status=PASS name=Log args=IF in GROUP
+ Check Body Item Data ${tc[1, 0, 0, 1, 1]} type=ELSE status=NOT RUN
+ Check Body Item Data ${tc[1, 0, 0, 1, 1, 0]} type=GROUP status=NOT RUN children=1 name=GROUP in ELSE
+ Check Body Item Data ${tc[1, 0, 0, 1, 1, 0, 0]} type=KEYWORD status=NOT RUN name=Fail args=Shall be logged but NOT RUN
+ Check Body Item Data ${tc[1, 1]} type=ELSE IF status=NOT RUN
+ Check Body Item Data ${tc[1, 1, 0]} type=GROUP status=NOT RUN children=1 name=\${non_existing_variable_is_fine_here}
+ Check Body Item Data ${tc[1, 2]} type=ELSE status=NOT RUN
+ Check Body Item Data ${tc[1, 2, 0]} type=GROUP status=NOT RUN children=0 name=Even empty GROUP is allowed
diff --git a/atest/robot/running/group/templates.robot b/atest/robot/running/group/templates.robot
new file mode 100644
index 00000000000..b42966b2524
--- /dev/null
+++ b/atest/robot/running/group/templates.robot
@@ -0,0 +1,69 @@
+*** Settings ***
+Suite Setup Run Tests ${EMPTY} running/group/templates.robot
+Resource atest_resource.robot
+
+*** Test Cases ***
+Pass
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=GROUP status=PASS children=1 name=1
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD status=PASS children=1 name=Run Keyword args=Log, 1.1
+ Check Body Item Data ${tc[1]} type=GROUP status=PASS children=2 name=2
+ Check Body Item Data ${tc[1, 0]} type=KEYWORD status=PASS children=1 name=Run Keyword args=Log, 2.1
+ Check Body Item Data ${tc[1, 1]} type=KEYWORD status=PASS children=1 name=Run Keyword args=Log, 2.2
+
+Pass and fail
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=GROUP status=PASS children=1 name=1
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD status=PASS children=1 name=Run Keyword args=Log, 1.1
+ Check Body Item Data ${tc[1]} type=GROUP status=FAIL children=2 name=2 message=2.1
+ Check Body Item Data ${tc[1, 0]} type=KEYWORD status=FAIL children=1 name=Run Keyword args=Fail, 2.1 message=2.1
+ Check Body Item Data ${tc[1, 1]} type=KEYWORD status=PASS children=1 name=Run Keyword args=Log, 2.2
+ Check Body Item Data ${tc[2]} type=GROUP status=PASS children=1 name=3
+ Check Body Item Data ${tc[2, 0]} type=KEYWORD status=PASS children=1 name=Run Keyword args=Log, 3.1
+
+Fail multiple times
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=GROUP status=FAIL children=1 name=1 message=1.1
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD status=FAIL children=1 name=Run Keyword args=Fail, 1.1 message=1.1
+ Check Body Item Data ${tc[1]} type=GROUP status=FAIL children=3 name=2 message=Several failures occurred:\n\n1) 2.1\n\n2) 2.3
+ Check Body Item Data ${tc[1, 0]} type=KEYWORD status=FAIL children=1 name=Run Keyword args=Fail, 2.1 message=2.1
+ Check Body Item Data ${tc[1, 1]} type=KEYWORD status=PASS children=1 name=Run Keyword args=Log, 2.2
+ Check Body Item Data ${tc[1, 2]} type=KEYWORD status=FAIL children=1 name=Run Keyword args=Fail, 2.3 message=2.3
+ Check Body Item Data ${tc[2]} type=GROUP status=PASS children=1 name=3
+ Check Body Item Data ${tc[2, 0]} type=KEYWORD status=PASS children=1 name=Run Keyword args=Log, 3.1
+ Check Body Item Data ${tc[3]} type=GROUP status=FAIL children=1 name=4 message=4.1
+ Check Body Item Data ${tc[3, 0]} type=KEYWORD status=FAIL children=1 name=Run Keyword args=Fail, 4.1 message=4.1
+
+Pass and skip
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=GROUP status=SKIP children=1 name=1 message=1.1
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD status=SKIP children=1 name=Run Keyword args=Skip, 1.1 message=1.1
+ Check Body Item Data ${tc[1]} type=GROUP status=PASS children=1 name=2
+ Check Body Item Data ${tc[1, 0]} type=KEYWORD status=PASS children=1 name=Run Keyword args=Log, 2.1
+ Check Body Item Data ${tc[2]} type=GROUP status=PASS children=2 name=3
+ Check Body Item Data ${tc[2, 0]} type=KEYWORD status=SKIP children=1 name=Run Keyword args=Skip, 3.1 message=3.1
+ Check Body Item Data ${tc[2, 1]} type=KEYWORD status=PASS children=1 name=Run Keyword args=Log, 3.2
+
+Pass, fail and skip
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=GROUP status=FAIL children=3 name=1 message=1.1
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD status=FAIL children=1 name=Run Keyword args=Fail, 1.1 message=1.1
+ Check Body Item Data ${tc[0, 1]} type=KEYWORD status=SKIP children=1 name=Run Keyword args=Skip, 1.2 message=1.2
+ Check Body Item Data ${tc[0, 2]} type=KEYWORD status=PASS children=1 name=Run Keyword args=Log, 1.3
+ Check Body Item Data ${tc[1]} type=GROUP status=SKIP children=1 name=2 message=2.1
+ Check Body Item Data ${tc[1, 0]} type=KEYWORD status=SKIP children=1 name=Run Keyword args=Skip, 2.1 message=2.1
+ Check Body Item Data ${tc[2]} type=GROUP status=PASS children=1 name=3
+ Check Body Item Data ${tc[2, 0]} type=KEYWORD status=PASS children=1 name=Run Keyword args=Log, 3.1
+
+Skip all
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=GROUP status=SKIP children=2 name=1 message=All iterations skipped.
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD status=SKIP children=1 name=Run Keyword args=Skip, 1.1 message=1.1
+ Check Body Item Data ${tc[0, 1]} type=KEYWORD status=SKIP children=1 name=Run Keyword args=Skip, 1.2 message=1.2
+ Check Body Item Data ${tc[1]} type=GROUP status=SKIP children=1 name=2 message=2.1
+ Check Body Item Data ${tc[1, 0]} type=KEYWORD status=SKIP children=1 name=Run Keyword args=Skip, 2.1 message=2.1
+
+Just one that is skipped
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Body Item Data ${tc[0]} type=GROUP status=SKIP children=1 name=1 message=1.1
+ Check Body Item Data ${tc[0, 0]} type=KEYWORD status=SKIP children=1 name=Run Keyword args=Skip, 1.1 message=1.1
diff --git a/atest/robot/running/html_error_message.robot b/atest/robot/running/html_error_message.robot
index 007d5a3cd04..9ff087a0d82 100644
--- a/atest/robot/running/html_error_message.robot
+++ b/atest/robot/running/html_error_message.robot
@@ -9,15 +9,15 @@ ${FAILURE} Robot Framework
*** Test Cases ***
Set Test Message
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Set test message to:\n${MESSAGE} html=True
+ Check Log Message ${tc[0, 0]} Set test message to:\n${MESSAGE} html=True
HTML failure
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} ${FAILURE} FAIL html=True
+ Check Log Message ${tc[0, 0]} ${FAILURE} FAIL html=True
HTML failure with non-generic exception
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} ValueError: Invalid value FAIL html=True
+ Check Log Message ${tc[0, 0]} ValueError: Invalid value FAIL html=True
HTML failure in setup
Check Test Case ${TESTNAME}
@@ -30,8 +30,8 @@ Normal failure in body and HTML failure in teardown
HTML failure in body and normal failure teardown
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Should be HTML FAIL html=True
- Check Log Message ${tc.teardown.msgs[0]} Should NOT be HTML FAIL html=False
+ Check Log Message ${tc[0, 0]} Should be HTML FAIL html=True
+ Check Log Message ${tc.teardown[0]} Should NOT be HTML FAIL html=False
HTML failure in body and in teardown
Check Test Case ${TESTNAME}
diff --git a/atest/robot/running/if/complex_if.robot b/atest/robot/running/if/complex_if.robot
index 49afc29aaca..1e4662b1f12 100644
--- a/atest/robot/running/if/complex_if.robot
+++ b/atest/robot/running/if/complex_if.robot
@@ -14,7 +14,7 @@ If inside for loop
Setting after if
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.teardown.msgs[0]} Teardown was found and executed.
+ Check Log Message ${tc.teardown[0]} Teardown was found and executed.
For loop inside if
Check Test Case ${TESTNAME}
@@ -24,23 +24,23 @@ For loop inside for loop
Direct Boolean condition
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].status} PASS
- Should Be Equal ${tc.body[0].body[0].status} PASS
- Should Be Equal ${tc.body[0].body[0].body[0].status} PASS
+ Should Be Equal ${tc[0].status} PASS
+ Should Be Equal ${tc[0, 0].status} PASS
+ Should Be Equal ${tc[0, 0, 0].status} PASS
Direct Boolean condition false
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].status} PASS
- Should Be Equal ${tc.body[0].body[0].status} NOT RUN
- Should Be Equal ${tc.body[0].body[0].body[0].status} NOT RUN
+ Should Be Equal ${tc[0].status} PASS
+ Should Be Equal ${tc[0, 0].status} NOT RUN
+ Should Be Equal ${tc[0, 0, 0].status} NOT RUN
Nesting insanity
Check Test Case ${TESTNAME}
Recursive If
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].kws[0].status} PASS
- Should Be Equal ${tc.kws[0].kws[0].kws[0].kws[0].status} PASS
+ Should Be Equal ${tc[0, 0].status} PASS
+ Should Be Equal ${tc[0, 0, 0, 0].status} PASS
If creating variable
Check Test Case ${TESTNAME}
diff --git a/atest/robot/running/if/if_else.robot b/atest/robot/running/if/if_else.robot
index c1d5689808d..6331aeb4dfc 100644
--- a/atest/robot/running/if/if_else.robot
+++ b/atest/robot/running/if/if_else.robot
@@ -41,7 +41,7 @@ If failing in else keyword
Expression evaluation time is included in elapsed time
${tc} = Check Test Case ${TESTNAME}
- Elapsed Time Should Be Valid ${tc.body[0].elapsed_time} minimum=0.2
- Elapsed Time Should Be Valid ${tc.body[0].body[0].elapsed_time} minimum=0.1
- Elapsed Time Should Be Valid ${tc.body[0].body[1].elapsed_time} minimum=0.1
- Elapsed Time Should Be Valid ${tc.body[0].body[2].elapsed_time} maximum=1.0
+ Elapsed Time Should Be Valid ${tc[0].elapsed_time} minimum=0.2
+ Elapsed Time Should Be Valid ${tc[0, 0].elapsed_time} minimum=0.1
+ Elapsed Time Should Be Valid ${tc[0, 1].elapsed_time} minimum=0.1
+ Elapsed Time Should Be Valid ${tc[0, 2].elapsed_time} maximum=1.0
diff --git a/atest/robot/running/if/inline_if_else.robot b/atest/robot/running/if/inline_if_else.robot
index a1418d70100..d3a5a346db5 100644
--- a/atest/robot/running/if/inline_if_else.robot
+++ b/atest/robot/running/if/inline_if_else.robot
@@ -22,10 +22,10 @@ Not executed after failure
Not executed after failure with assignment
[Template] NONE
${tc} = Check Test Case ${TEST NAME}
- Check IF/ELSE Status NOT RUN NOT RUN root=${tc.body[1]} run=False
- Check IF/ELSE Status NOT RUN NOT RUN root=${tc.body[2]} run=False
- Check Keyword Data ${tc.body[1].body[0].body[0]} Not run assign=\${x} status=NOT RUN
- Check Keyword Data ${tc.body[2].body[0].body[0]} Not run assign=\${x}, \@{y} status=NOT RUN
+ Check IF/ELSE Status NOT RUN NOT RUN root=${tc[1]} run=False
+ Check IF/ELSE Status NOT RUN NOT RUN root=${tc[2]} run=False
+ Check Keyword Data ${tc[1, 0, 0]} Not run assign=\${x} status=NOT RUN
+ Check Keyword Data ${tc[2, 0, 0]} Not run assign=\${x}, \@{y} status=NOT RUN
ELSE IF not executed
NOT RUN NOT RUN PASS index=0
@@ -79,20 +79,20 @@ Assign when no branch is run
Inside FOR
[Template] NONE
${tc} = Check Test Case ${TEST NAME}
- Check IF/ELSE Status NOT RUN PASS root=${tc.body[0].body[0].body[0]}
- Check IF/ELSE Status NOT RUN PASS root=${tc.body[0].body[1].body[0]}
- Check IF/ELSE Status FAIL NOT RUN root=${tc.body[0].body[2].body[0]}
+ Check IF/ELSE Status NOT RUN PASS root=${tc[0, 0, 0]}
+ Check IF/ELSE Status NOT RUN PASS root=${tc[0, 1, 0]}
+ Check IF/ELSE Status FAIL NOT RUN root=${tc[0, 2, 0]}
Inside normal IF
[Template] NONE
${tc} = Check Test Case ${TEST NAME}
- Check IF/ELSE Status NOT RUN PASS root=${tc.body[0].body[0].body[1]}
- Check IF/ELSE Status NOT RUN NOT RUN root=${tc.body[0].body[1].body[0]} run=False
+ Check IF/ELSE Status NOT RUN PASS root=${tc[0, 0, 1]}
+ Check IF/ELSE Status NOT RUN NOT RUN root=${tc[0, 1, 0]} run=False
In keyword
[Template] NONE
${tc} = Check Test Case ${TEST NAME}
- Check IF/ELSE Status PASS NOT RUN root=${tc.body[0].body[0]}
- Check IF/ELSE Status NOT RUN PASS NOT RUN root=${tc.body[0].body[1]}
+ Check IF/ELSE Status PASS NOT RUN root=${tc[0, 0]}
+ Check IF/ELSE Status NOT RUN PASS NOT RUN root=${tc[0, 1]}
Check IF/ELSE Status NOT RUN NOT RUN NOT RUN FAIL
- ... NOT RUN NOT RUN NOT RUN root=${tc.body[0].body[2]}
+ ... NOT RUN NOT RUN NOT RUN root=${tc[0, 2]}
diff --git a/atest/robot/running/if/invalid_if.robot b/atest/robot/running/if/invalid_if.robot
index 4f52de27720..714a7b4eb80 100644
--- a/atest/robot/running/if/invalid_if.robot
+++ b/atest/robot/running/if/invalid_if.robot
@@ -28,6 +28,12 @@ ELSE IF with invalid condition
Recommend $var syntax if invalid condition contains ${var}
FAIL index=1
+$var recommendation with multiple variables
+ FAIL index=1
+
+Remove quotes around variable in $var recommendation
+ FAIL index=2
+
IF without END
FAIL
@@ -44,7 +50,7 @@ ELSE IF without condition
ELSE IF with multiple conditions
[Template] NONE
${tc} = Branch statuses should be FAIL NOT RUN NOT RUN
- Should Be Equal ${tc.body[0].body[1].condition} \${False}, ooops, \${True}
+ Should Be Equal ${tc[0, 1].condition} \${False}, ooops, \${True}
ELSE with condition
FAIL NOT RUN
diff --git a/atest/robot/running/if/invalid_inline_if.robot b/atest/robot/running/if/invalid_inline_if.robot
index 01ea3768dd0..5a7ba2c0ac0 100644
--- a/atest/robot/running/if/invalid_inline_if.robot
+++ b/atest/robot/running/if/invalid_inline_if.robot
@@ -65,11 +65,11 @@ Unnecessary END
Invalid END after inline header
[Template] NONE
${tc} = Check Test Case ${TEST NAME}
- Check IF/ELSE Status PASS root=${tc.body[0]}
- Check Log Message ${tc.body[0].body[0].body[0].body[0]} Executed inside inline IF
- Check Log Message ${tc.body[1].body[0]} Executed outside IF
- Should Be Equal ${tc.body[2].type} ERROR
- Should Be Equal ${tc.body[2].status} FAIL
+ Check IF/ELSE Status PASS root=${tc[0]}
+ Check Log Message ${tc[0, 0, 0, 0]} Executed inside inline IF
+ Check Log Message ${tc[1, 0]} Executed outside IF
+ Should Be Equal ${tc[2].type} ERROR
+ Should Be Equal ${tc[2].status} FAIL
Assign in IF branch
FAIL
@@ -107,9 +107,9 @@ Assign when ELSE branch is empty
Control structures are allowed
[Template] NONE
${tc} = Check Test Case ${TESTNAME}
- Check IF/ELSE Status NOT RUN PASS root=${tc.body[0].body[0]}
+ Check IF/ELSE Status NOT RUN PASS root=${tc[0, 0]}
Control structures are not allowed with assignment
[Template] NONE
${tc} = Check Test Case ${TESTNAME}
- Check IF/ELSE Status FAIL NOT RUN root=${tc.body[0].body[0]}
+ Check IF/ELSE Status FAIL NOT RUN root=${tc[0, 0]}
diff --git a/atest/robot/running/invalid_break_and_continue.robot b/atest/robot/running/invalid_break_and_continue.robot
index 6aeafe8493d..6730a116b6a 100644
--- a/atest/robot/running/invalid_break_and_continue.robot
+++ b/atest/robot/running/invalid_break_and_continue.robot
@@ -26,11 +26,11 @@ CONTINUE in TRY-ELSE
CONTINUE with argument in FOR
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].body[0].body[1].body[0]} CONTINUE does not accept arguments, got 'should not work'. FAIL
+ Check Log Message ${tc[0, 0, 1, 0]} CONTINUE does not accept arguments, got 'should not work'. FAIL
CONTINUE with argument in WHILE
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].body[0].body[1].body[0]} CONTINUE does not accept arguments, got 'should', 'not' and 'work'. FAIL
+ Check Log Message ${tc[0, 0, 1, 0]} CONTINUE does not accept arguments, got 'should', 'not' and 'work'. FAIL
BREAK in test case
Check Test Case ${TESTNAME}
@@ -55,8 +55,8 @@ BREAK in TRY-ELSE
BREAK with argument in FOR
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].body[0].body[1].body[0]} BREAK does not accept arguments, got 'should not work'. FAIL
+ Check Log Message ${tc[0, 0, 1, 0]} BREAK does not accept arguments, got 'should not work'. FAIL
BREAK with argument in WHILE
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.body[0].body[0].body[1].body[0]} BREAK does not accept arguments, got 'should', 'not' and 'work'. FAIL
+ Check Log Message ${tc[0, 0, 1, 0]} BREAK does not accept arguments, got 'should', 'not' and 'work'. FAIL
diff --git a/atest/robot/running/long_error_messages.robot b/atest/robot/running/long_error_messages.robot
index 891d106ee07..abef7c57b16 100644
--- a/atest/robot/running/long_error_messages.robot
+++ b/atest/robot/running/long_error_messages.robot
@@ -42,21 +42,21 @@ Has Been Cut
Should Contain ${test.message} ${EXPLANATION}
Should Match Non Empty Regexp ${test.message} ${eol_dots}
Should Match Non Empty Regexp ${test.message} ${bol_dots}
- Error Message In Log Should Not Have Been Cut ${test.kws}
+ Error Message In Log Should Not Have Been Cut ${test}
RETURN ${test}
Error Message In Log Should Not Have Been Cut
- [Arguments] ${kws}
- @{keywords} = Set Variable ${kws}
- FOR ${kw} IN @{keywords}
- Run Keyword If ${kw.msgs}
- ... Should Not Contain ${kw.msgs[-1].message} ${EXPLANATION}
- Error Message In Log Should Not Have Been Cut ${kw.kws}
+ [Arguments] ${item}
+ FOR ${child} IN @{item.non_messages}
+ FOR ${msg} IN @{child.messages}
+ Should Not Contain ${msg.message} ${EXPLANATION}
+ END
+ Error Message In Log Should Not Have Been Cut ${child}
END
Should Match Non Empty Regexp
[Arguments] ${message} ${pattern}
- Run Keyword If $pattern
+ IF $pattern
... Should Match Regexp ${message} ${pattern}
Has Not Been Cut
diff --git a/atest/robot/running/non_ascii_bytes.robot b/atest/robot/running/non_ascii_bytes.robot
index 18b726cd5c2..b84792d1a6e 100644
--- a/atest/robot/running/non_ascii_bytes.robot
+++ b/atest/robot/running/non_ascii_bytes.robot
@@ -8,26 +8,26 @@ Variables ${DATADIR}/running/expbytevalues.py
*** Test Cases ***
In Message
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} ${exp_log_msg}
+ Check Log Message ${tc[0, 0]} ${exp_log_msg}
In Multiline Message
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} ${exp_log_multiline_msg}
+ Check Log Message ${tc[0, 0]} ${exp_log_multiline_msg}
In Return Value
[Documentation] Return value is not altered by the framework and thus it
... contains the exact same bytes that the keyword returned.
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} \${retval} = ${exp_return_msg}
+ Check Log Message ${tc[0, 0]} \${retval} = ${exp_return_msg}
In Exception
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} ${exp_error_msg} FAIL
+ Check Log Message ${tc[0, 0]} ${exp_error_msg} FAIL
In Exception In Setup
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.setup.msgs[0]} ${exp_error_msg} FAIL
+ Check Log Message ${tc.setup[0]} ${exp_error_msg} FAIL
In Exception In Teardown
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.teardown.msgs[0]} ${exp_error_msg} FAIL
+ Check Log Message ${tc.teardown[0]} ${exp_error_msg} FAIL
diff --git a/atest/robot/running/pass_execution.robot b/atest/robot/running/pass_execution.robot
index 2fa03944982..4bea02d7167 100644
--- a/atest/robot/running/pass_execution.robot
+++ b/atest/robot/running/pass_execution.robot
@@ -1,9 +1,9 @@
*** Settings ***
-Suite Setup Run Tests ${EMPTY} running/pass_execution.robot
-Resource atest_resource.robot
+Suite Setup Run Tests ${EMPTY} running/pass_execution.robot
+Resource atest_resource.robot
*** Variables ***
-${PREFIX}= Execution passed with message:\n
+${PREFIX}= Execution passed with message:\n
*** Test Cases ***
Message is required
@@ -11,11 +11,11 @@ Message is required
With message
${tc}= Check Test Tags ${TESTNAME} force1 force2
- Check Log Message ${tc.kws[0].msgs[0]} ${PREFIX}My message
+ Check Log Message ${tc[0, 0]} ${PREFIX}My message
With HTML message
${tc}= Check Test Tags ${TESTNAME} force1 force2
- Check Log Message ${tc.kws[0].msgs[0]} ${PREFIX}Message HTML
+ Check Log Message ${tc[0, 0]} ${PREFIX}Message HTML
Empty message is not allowed
Check Test Case ${TESTNAME}
@@ -40,17 +40,17 @@ Used in template keyword
Used in for loop
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} ${PREFIX}Message with 'foo'
+ Check Log Message ${tc[0, 0, 0, 0]} ${PREFIX}Message with 'foo'
Used in setup
${tc} = Check Test Case ${TESTNAME}
- Keyword Should Have Been Executed ${tc.kws[0]}
+ Keyword Should Have Been Executed ${tc[0]}
Keyword Should Have Been Executed ${tc.teardown}
Used in teardown
${tc}= Check Test Case ${TESTNAME}
Should Be Equal ${tc.teardown.status} PASS
- Check Log Message ${tc.teardown.kws[0].msgs[0]} ${PREFIX}This message is used.
+ Check Log Message ${tc.teardown[0, 0]} ${PREFIX}This message is used.
Before failing teardown
Check Test Case ${TESTNAME}
@@ -60,14 +60,14 @@ After continuable failure
After continuable failure in user keyword
${tc}= Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].status} FAIL
+ Should Be Equal ${tc[0].status} FAIL
After continuable failure in FOR loop
${tc}= Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].status} FAIL
- Should Be Equal ${tc.kws[0].kws[0].status} FAIL
- Should Be Equal ${tc.kws[0].kws[0].kws[0].status} FAIL
- Should Be Equal ${tc.kws[0].kws[0].kws[1].status} PASS
+ Should Be Equal ${tc[0].status} FAIL
+ Should Be Equal ${tc[0, 0].status} FAIL
+ Should Be Equal ${tc[0, 0, 0].status} FAIL
+ Should Be Equal ${tc[0, 0, 1].status} PASS
After continuable failure and before failing teardown
Check Test Case ${TESTNAME}
@@ -86,57 +86,57 @@ After continuable failure in keyword teardown
Remove one tag
${tc}= Check Test Tags ${TESTNAME} force2
- Check Log Message ${tc.kws[0].msgs[0]} Removed tag 'force1'.
- Check Log Message ${tc.kws[0].msgs[1]} ${PREFIX}Message
+ Check Log Message ${tc[0, 0]} Removed tag 'force1'.
+ Check Log Message ${tc[0, 1]} ${PREFIX}Message
Remove multiple tags
${tc}= Check Test Tags ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Removed tags 'force1' and 'force2'.
- Check Log Message ${tc.kws[0].msgs[1]} ${PREFIX}Message
+ Check Log Message ${tc[0, 0]} Removed tags 'force1' and 'force2'.
+ Check Log Message ${tc[0, 1]} ${PREFIX}Message
Remove tags with pattern
${tc}= Check Test Tags ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Removed tag 'force?'.
- Check Log Message ${tc.kws[0].msgs[1]} ${PREFIX}Message
+ Check Log Message ${tc[0, 0]} Removed tag 'force?'.
+ Check Log Message ${tc[0, 1]} ${PREFIX}Message
Set one tag
${tc}= Check Test Tags ${TESTNAME} force1 force2 tag
- Check Log Message ${tc.kws[0].msgs[0]} Set tag 'tag'.
- Check Log Message ${tc.kws[0].msgs[1]} ${PREFIX}Message
+ Check Log Message ${tc[0, 0]} Set tag 'tag'.
+ Check Log Message ${tc[0, 1]} ${PREFIX}Message
Set multiple tags
${tc}= Check Test Tags ${TESTNAME} force1 force2 tag1 tag2
- Check Log Message ${tc.kws[0].msgs[0]} Set tags 'tag1' and 'tag2'.
- Check Log Message ${tc.kws[0].msgs[1]} ${PREFIX}Message
+ Check Log Message ${tc[0, 0]} Set tags 'tag1' and 'tag2'.
+ Check Log Message ${tc[0, 1]} ${PREFIX}Message
Set and remove tags
${tc}= Check Test Tags ${TESTNAME} tag1 tag2
- Check Log Message ${tc.kws[0].msgs[0]} Removed tag 'force?'.
- Check Log Message ${tc.kws[0].msgs[1]} Set tags 'tag1' and 'tag2'.
- Check Log Message ${tc.kws[0].msgs[2]} ${PREFIX}Message
+ Check Log Message ${tc[0, 0]} Removed tag 'force?'.
+ Check Log Message ${tc[0, 1]} Set tags 'tag1' and 'tag2'.
+ Check Log Message ${tc[0, 2]} ${PREFIX}Message
Set tags are not removed
${tc}= Check Test Tags ${TESTNAME} force1 force2 tag1 tag2
- Check Log Message ${tc.kws[0].msgs[0]} Removed tag 'tag?'.
- Check Log Message ${tc.kws[0].msgs[1]} Set tags 'tag1' and 'tag2'.
- Check Log Message ${tc.kws[0].msgs[2]} ${PREFIX}Message
+ Check Log Message ${tc[0, 0]} Removed tag 'tag?'.
+ Check Log Message ${tc[0, 1]} Set tags 'tag1' and 'tag2'.
+ Check Log Message ${tc[0, 2]} ${PREFIX}Message
Set tags in teardown
${tc}= Check Test Tags ${TESTNAME} tag1 tag2
- Check Log Message ${tc.teardown.msgs[0]} Removed tag 'force?'.
- Check Log Message ${tc.teardown.msgs[1]} Set tags 'tag1' and 'tag2'.
- Check Log Message ${tc.teardown.msgs[2]} ${PREFIX}Message
+ Check Log Message ${tc.teardown[0]} Removed tag 'force?'.
+ Check Log Message ${tc.teardown[1]} Set tags 'tag1' and 'tag2'.
+ Check Log Message ${tc.teardown[2]} ${PREFIX}Message
Pass Execution If when condition is true
Check Test Case ${TESTNAME}
Pass Execution If when condition is false
${tc} = Check Test Case ${TESTNAME}
- Keyword Should Have Been Executed ${tc.kws[1]}
+ Keyword Should Have Been Executed ${tc[1]}
Pass Execution If resolves variables only condition is true
${tc} = Check Test Case ${TESTNAME}
- Keyword Should Have Been Executed ${tc.kws[1]}
+ Keyword Should Have Been Executed ${tc[1]}
Pass Execution If with multiple variables
Check Test Tags ${TESTNAME} force1 force2 my tags
diff --git a/atest/robot/running/prevent_recursion.robot b/atest/robot/running/prevent_recursion.robot
deleted file mode 100644
index 8641c4e476d..00000000000
--- a/atest/robot/running/prevent_recursion.robot
+++ /dev/null
@@ -1,21 +0,0 @@
-*** Settings ***
-Suite Setup Run Tests ${EMPTY} running/prevent_recursion.robot
-Resource atest_resource.robot
-
-*** Test Cases ***
-Infinite recursion
- Check Test Case ${TESTNAME}
-
-Infinite cyclic recursion
- Check Test Case ${TESTNAME}
-
-Infinite recursion with Run Keyword
- Check Test Case ${TESTNAME}
-
-Infinitely recursive for loop
- Check Test Case ${TESTNAME}
-
-Recursion below the recursion limit is ok
- [Documentation] Also verifies that recursion limit blown earlier doesn't affect subsequent tests
- Check Test Case ${TESTNAME}
-
diff --git a/atest/robot/running/return.robot b/atest/robot/running/return.robot
index a9da6755056..a94de10b833 100644
--- a/atest/robot/running/return.robot
+++ b/atest/robot/running/return.robot
@@ -5,51 +5,51 @@ Resource atest_resource.robot
*** Test Cases ***
Simple
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].body[1].type} RETURN
- Should Be Equal ${tc.body[0].body[1].values} ${{()}}
- Should Be Equal ${tc.body[0].body[1].status} PASS
- Should Be Equal ${tc.body[0].body[1].message} ${EMPTY}
- Should Be Equal ${tc.body[0].body[2].status} NOT RUN
- Should Be Equal ${tc.body[0].message} ${EMPTY}
+ Should Be Equal ${tc[0, 1].type} RETURN
+ Should Be Equal ${tc[0, 1].values} ${{()}}
+ Should Be Equal ${tc[0, 1].status} PASS
+ Should Be Equal ${tc[0, 1].message} ${EMPTY}
+ Should Be Equal ${tc[0, 2].status} NOT RUN
+ Should Be Equal ${tc[0].message} ${EMPTY}
Return value
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].body[0].type} RETURN
- Should Be Equal ${tc.body[0].body[0].values} ${{('value',)}}
+ Should Be Equal ${tc[0, 0].type} RETURN
+ Should Be Equal ${tc[0, 0].values} ${{('value',)}}
Return value as variable
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].body[0].type} RETURN
- Should Be Equal ${tc.body[0].body[0].values} ${{('\${42}',)}}
+ Should Be Equal ${tc[0, 0].type} RETURN
+ Should Be Equal ${tc[0, 0].values} ${{('\${42}',)}}
Return multiple values
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].body[0].type} RETURN
- Should Be Equal ${tc.body[0].body[0].values} ${{('first', '\${2}', 'third')}}
+ Should Be Equal ${tc[0, 0].type} RETURN
+ Should Be Equal ${tc[0, 0].values} ${{('first', '\${2}', 'third')}}
In nested keyword
Check Test Case ${TESTNAME}
In IF
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].body[0].body[0].body[0].type} RETURN
- Should Be Equal ${tc.body[0].body[0].body[0].body[0].status} PASS
- Should Be Equal ${tc.body[0].body[0].body[0].body[1].status} NOT RUN
- Should Be Equal ${tc.body[0].body[1].status} NOT RUN
- Should Be Equal ${tc.body[2].body[0].body[1].body[0].type} RETURN
- Should Be Equal ${tc.body[2].body[0].body[1].body[0].status} PASS
- Should Be Equal ${tc.body[2].body[0].body[1].body[1].status} NOT RUN
- Should Be Equal ${tc.body[2].body[1].status} NOT RUN
+ Should Be Equal ${tc[0, 0, 0, 0].type} RETURN
+ Should Be Equal ${tc[0, 0, 0, 0].status} PASS
+ Should Be Equal ${tc[0, 0, 0, 1].status} NOT RUN
+ Should Be Equal ${tc[0, 1].status} NOT RUN
+ Should Be Equal ${tc[2, 0, 1, 0].type} RETURN
+ Should Be Equal ${tc[2, 0, 1, 0].status} PASS
+ Should Be Equal ${tc[2, 0, 1, 1].status} NOT RUN
+ Should Be Equal ${tc[2, 1].status} NOT RUN
In inline IF
Check Test Case ${TESTNAME}
In FOR
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].body[0].body[0].body[0].type} RETURN
- Should Be Equal ${tc.body[0].body[0].body[0].body[0].status} PASS
- Should Be Equal ${tc.body[0].body[0].body[0].body[1].status} NOT RUN
- Should Be Equal ${tc.body[0].body[1].status} NOT RUN
+ Should Be Equal ${tc[0, 0, 0, 0].type} RETURN
+ Should Be Equal ${tc[0, 0, 0, 0].status} PASS
+ Should Be Equal ${tc[0, 0, 0, 1].status} NOT RUN
+ Should Be Equal ${tc[0, 1].status} NOT RUN
In nested FOR/IF structure
Check Test Case ${TESTNAME}
diff --git a/atest/robot/running/return_from_keyword.robot b/atest/robot/running/return_from_keyword.robot
index 4c9c2fa72b6..34b905cfa3c 100644
--- a/atest/robot/running/return_from_keyword.robot
+++ b/atest/robot/running/return_from_keyword.robot
@@ -56,5 +56,5 @@ Return From Keyword If does not evaluate bogus arguments if condition is untrue
Logs Info
${tc} = Check Test Case Without Return Value
- Check Log Message ${tc.kws[0].kws[0].msgs[0]}
+ Check Log Message ${tc[0, 0, 0]}
... Returning from the enclosing user keyword.
diff --git a/atest/robot/running/setup_and_teardown_using_embedded_arguments.robot b/atest/robot/running/setup_and_teardown_using_embedded_arguments.robot
new file mode 100644
index 00000000000..49d2660f2d4
--- /dev/null
+++ b/atest/robot/running/setup_and_teardown_using_embedded_arguments.robot
@@ -0,0 +1,14 @@
+*** Settings ***
+Suite Setup Run Tests ${EMPTY} running/setup_and_teardown_using_embedded_arguments.robot
+Resource atest_resource.robot
+
+*** Test Cases ***
+Suite setup and teardown
+ Should Be Equal ${SUITE.setup.status} PASS
+ Should Be Equal ${SUITE.teardown.status} PASS
+
+Test setup and teardown
+ Check Test Case ${TESTNAME}
+
+Keyword setup and teardown
+ Check Test Case ${TESTNAME}
diff --git a/atest/robot/running/skip.robot b/atest/robot/running/skip.robot
index 886a5f26b03..1af592e235f 100644
--- a/atest/robot/running/skip.robot
+++ b/atest/robot/running/skip.robot
@@ -44,7 +44,7 @@ Skip in Teardown After Failure In Body
Teardown is executed after skip
${tc} = Check Test Case ${TEST NAME}
- Check log message ${tc.teardown.msgs[0]} Teardown is executed!
+ Check log message ${tc.teardown[0]} Teardown is executed!
Fail in Teardown After Skip In Body
Check Test Case ${TEST NAME}
@@ -110,27 +110,39 @@ Skip with Wait Until Keyword Succeeds
Skipped with --skip
Check Test Case ${TEST NAME}
-Skipped when test is tagged with robot:skip
+Skipped with --skip when tag uses variable
+ Check Test Case ${TEST NAME}
+
+Skipped with robot:skip
+ Check Test Case ${TEST NAME}
+
+Skipped with robot:skip when tag uses variable
Check Test Case ${TEST NAME}
Skipped with --SkipOnFailure
Check Test Case ${TEST NAME}
-Skipped with --SkipOnFailure when Failure in Test Setup
+Skipped with --SkipOnFailure when tag uses variable
Check Test Case ${TEST NAME}
-Skipped with --SkipOnFailure when Failure in Test Teardown
+Skipped with --SkipOnFailure when failure in setup
Check Test Case ${TEST NAME}
-Skipped with --SkipOnFailure when Set Tags Used in Teardown
+Skipped with --SkipOnFailure when failure in teardown
Check Test Case ${TEST NAME}
-Skipped although test fails since test is tagged with robot:skip-on-failure
+Skipped with --SkipOnFailure when Set Tags used in teardown
Check Test Case ${TEST NAME}
-Using Skip Does Not Affect Passing And Failing Tests
- Check Test Case Passing Test
- Check Test Case Failing Test
+Skipped with robot:skip-on-failure
+ Check Test Case ${TEST NAME}
+
+Skipped with robot:skip-on-failure when tag uses variable
+ Check Test Case ${TEST NAME}
+
+Skipping does not affect passing and failing tests
+ Check Test Case Passing
+ Check Test Case Failing
Suite setup and teardown are not run if all tests are unconditionally skipped or excluded
${suite} = Get Test Suite All Skipped
@@ -139,3 +151,17 @@ Suite setup and teardown are not run if all tests are unconditionally skipped or
Check Test Case Skip using robot:skip
Check Test Case Skip using --skip
Length Should Be ${suite.suites[0].tests} 2
+
+--skip and --skip-on-failure used multiple times
+ Run Tests --skip skip-this --skip no-match --SkipOnFailure skip-on-failure --skip-on-failure xxx running/skip/skip.robot
+ Check Test Case Skipped with --skip
+ ... message=Test skipped using 'no-match' and 'skip-this' tags.
+ Check Test Case Skipped with --SkipOnFailure
+ ... message=Failed test skipped using 'skip-on-failure' and 'xxx' tags.\n\nOriginal failure:\nOoops, we fail!
+
+--skip and --skip-on-failure with patterns
+ Run Tests --skip skip-t*s --skip no-match --SkipOnFailure xxxORskip-on-failure running/skip/skip.robot
+ Check Test Case Skipped with --skip
+ ... message=Test skipped using 'no-match' and 'skip-t*s' tag patterns.
+ Check Test Case Skipped with --SkipOnFailure
+ ... message=Failed test skipped using 'xxx OR skip-on-failure' tag pattern.\n\nOriginal failure:\nOoops, we fail!
diff --git a/atest/robot/running/skip_in_rpa_mode.robot b/atest/robot/running/skip_in_rpa_mode.robot
index e5370328d05..6da7ef27bfd 100644
--- a/atest/robot/running/skip_in_rpa_mode.robot
+++ b/atest/robot/running/skip_in_rpa_mode.robot
@@ -1,5 +1,5 @@
*** Settings ***
-Suite Setup Run Tests --rpa --skip skip-this --SkipOnFailure skip-on-failure --variable test_or_task:Task running/skip/
+Suite Setup Run Tests --rpa --skip skip-this --SkipOnFailure skip-on-failure --variable test_or_task:task running/skip/
Resource atest_resource.robot
*** Test Cases ***
@@ -8,4 +8,3 @@ Skipped with --skip
Skipped with --SkipOnFailure
Check Test Case ${TEST NAME}
-
diff --git a/atest/robot/running/skip_with_template.robot b/atest/robot/running/skip_with_template.robot
new file mode 100644
index 00000000000..a642c665146
--- /dev/null
+++ b/atest/robot/running/skip_with_template.robot
@@ -0,0 +1,71 @@
+*** Settings ***
+Suite Setup Run Tests ${EMPTY} running/skip_with_template.robot
+Resource atest_resource.robot
+
+*** Test Cases ***
+SKIP + PASS -> PASS
+ ${tc} = Check Test Case ${TEST NAME}
+ Status Should Be ${tc[0]} SKIP Skipped
+ Status Should Be ${tc[1]} PASS
+
+FAIL + ANY -> FAIL
+ ${tc} = Check Test Case ${TEST NAME}
+ Status Should Be ${tc[0]} PASS
+ Status Should Be ${tc[1]} SKIP Skipped
+ Status Should Be ${tc[2]} PASS
+ Status Should Be ${tc[3]} FAIL Failed
+ Status Should Be ${tc[4]} SKIP Skipped
+
+Only SKIP -> SKIP
+ ${tc} = Check Test Case ${TEST NAME}
+ Status Should Be ${tc[0]} SKIP Skipped
+ Status Should Be ${tc[1]} SKIP Skipped
+
+IF w/ SKIP + PASS -> PASS
+ ${tc} = Check Test Case ${TEST NAME}
+ Status Should Be ${tc[0]} PASS
+ Status Should Be ${tc[1]} SKIP Skipped
+ Status Should Be ${tc[2]} PASS
+
+IF w/ FAIL + ANY -> FAIL
+ ${tc} = Check Test Case ${TEST NAME}
+ Status Should Be ${tc[0]} FAIL Failed
+ Status Should Be ${tc[1]} SKIP Skipped
+ Status Should Be ${tc[2]} PASS
+
+IF w/ only SKIP -> SKIP
+ ${tc} = Check Test Case ${TEST NAME}
+ Status Should Be ${tc[0]} SKIP All iterations skipped.
+ Status Should Be ${tc[1]} SKIP Skip 3
+ Status Should Be ${tc[2]} SKIP Skip 4
+
+FOR w/ SKIP + PASS -> PASS
+ ${tc} = Check Test Case ${TEST NAME}
+ Status Should Be ${tc[0]} PASS
+ Status Should Be ${tc[1]} SKIP just once
+ Status Should Be ${tc[2]} PASS
+
+FOR w/ FAIL + ANY -> FAIL
+ ${tc} = Check Test Case ${TEST NAME}
+ Status Should Be ${tc[0]} FAIL Several failures occurred:\n\n1) a\n\n2) b
+ Status Should Be ${tc[1]} SKIP just once
+ Status Should Be ${tc[2]} PASS
+
+FOR w/ only SKIP -> SKIP
+ ${tc} = Check Test Case ${TEST NAME}
+ Status Should Be ${tc[0]} SKIP All iterations skipped.
+ Status Should Be ${tc[1]} SKIP just once
+
+Messages in test body are ignored
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Log Message ${tc[0]} Hello 'Messages in test body are ignored', says listener!
+ Check Log Message ${tc[1, 0, 0]} Library listener adds messages to body of this test.
+ Check Log Message ${tc[2, 0, 0]} This iteration is skipped! SKIP
+ Check Log Message ${tc[3, 0, 0]} This iteration passes!
+ Check Log Message ${tc[4]} Bye 'Messages in test body are ignored', says listener!
+
+*** Keywords ***
+Status Should Be
+ [Arguments] ${item} ${status} ${message}=
+ Should Be Equal ${item.status} ${status}
+ Should Be Equal ${item.message} ${message}
diff --git a/atest/robot/running/steps_after_failure.robot b/atest/robot/running/steps_after_failure.robot
index 30a1de2dc96..602f40d3001 100644
--- a/atest/robot/running/steps_after_failure.robot
+++ b/atest/robot/running/steps_after_failure.robot
@@ -5,143 +5,159 @@ Resource atest_resource.robot
*** Test Cases ***
Library keyword after failure
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[2:]} 5
- Check Log Message ${tc.teardown.msgs[0]} This is run
+ Should Not Be Run ${tc[2:]} 5
+ Check Log Message ${tc.teardown[0]} This is run
User keyword after failure
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]}
+ Should Not Be Run ${tc[1:]}
Non-existing keyword after failure
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]}
+ Should Not Be Run ${tc[1:]}
Invalid keyword usage after failure
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]}
+ Should Not Be Run ${tc[1:]}
Assignment after failure
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]} 4
- Check Keyword Data ${tc.body[1]} Not run assign=\${x} status=NOT RUN
- Check Keyword Data ${tc.body[2]} Not run assign=\${x} status=NOT RUN
- Check Keyword Data ${tc.body[3]} Not run assign=\${x}, \${y} status=NOT RUN
- Check Keyword Data ${tc.body[4]} Not run assign=\${x}, \${y} status=NOT RUN
+ Should Not Be Run ${tc[1:]} 4
+ Check Keyword Data ${tc[1]} Not run assign=\${x} status=NOT RUN
+ Check Keyword Data ${tc[2]} Not run assign=\${x} status=NOT RUN
+ Check Keyword Data ${tc[3]} Not run assign=\${x}, \${y} status=NOT RUN
+ Check Keyword Data ${tc[4]} Not run assign=\${x}, \${y} status=NOT RUN
IF after failure
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]}
- Should Not Be Run ${tc.body[1].body[0].body}
- Should Not Be Run ${tc.body[1].body[1].body}
- Check Keyword Data ${tc.body[1].body[1].body[0]}
+ Should Not Be Run ${tc[1:]}
+ Should Not Be Run ${tc[1, 0].body}
+ Should Not Be Run ${tc[1, 1].body}
+ Check Keyword Data ${tc[1, 1, 0]}
+ ... BuiltIn.Fail assign=\${x} args=This should not be run status=NOT RUN
+
+GROUP after failure
+ ${tc} = Check Test Case ${TESTNAME}
+ Should Not Be Run ${tc[1:]}
+ Should Not Be Run ${tc[1].body} 2
+ Check Keyword Data ${tc[1, 1]}
... BuiltIn.Fail assign=\${x} args=This should not be run status=NOT RUN
FOR after failure
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]}
- Should Not Be Run ${tc.body[1].body}
- Should Not Be Run ${tc.body[1].body[0].body} 2
- Check Keyword Data ${tc.body[1].body[0].body[1]}
+ Should Not Be Run ${tc[1:]}
+ Should Not Be Run ${tc[1].body}
+ Should Not Be Run ${tc[1, 0].body} 2
+ Check Keyword Data ${tc[1, 0, 1]}
... BuiltIn.Fail assign=\${x} args=This should not be run either status=NOT RUN
TRY after failure
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]}
- Should Not Be Run ${tc.body[1].body} 4
- FOR ${step} IN @{tc.body[1].body}
+ Should Not Be Run ${tc[1:]}
+ Should Not Be Run ${tc[1].body} 4
+ FOR ${step} IN @{tc[1].body}
Should Not Be Run ${step.body}
END
WHILE after failure
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]} 3
- Should Not Be Run ${tc.body[1].body}
- Should Not Be Run ${tc.body[1].body[0].body} 3
- Should Not Be Run ${tc.body[2].body}
- Should Not Be Run ${tc.body[2].body[0].body} 2
- Should Not Be Run ${tc.body[3].body}
- Should Not Be Run ${tc.body[3].body[0].body} 1
+ Should Not Be Run ${tc[1:]} 3
+ Should Not Be Run ${tc[1].body}
+ Should Not Be Run ${tc[1, 0].body} 3
+ Should Not Be Run ${tc[2].body}
+ Should Not Be Run ${tc[2, 0].body} 2
+ Should Not Be Run ${tc[3].body}
+ Should Not Be Run ${tc[3, 0].body} 1
RETURN after failure
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]}
- Should Not Be Run ${tc.body[0].body[1:]} 2
- Should Be Equal ${tc.body[0].body[1].type} RETURN
+ Should Not Be Run ${tc[1:]}
+ Should Not Be Run ${tc[0][1:]} 2
+ Should Be Equal ${tc[0, 1].type} RETURN
BREAK and CONTINUE after failure
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]} 1
- Should Not Be Run ${tc.body[0].body[0].body[1:]} 2
- Should Not Be Run ${tc.body[1].body}
- Should Not Be Run ${tc.body[1].body[0].body} 2
+ Should Not Be Run ${tc[1:]} 1
+ Should Not Be Run ${tc[0, 0][1:]} 2
+ Should Not Be Run ${tc[1].body}
+ Should Not Be Run ${tc[1, 0].body} 2
Nested control structure after failure
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]} 2
- Should Be Equal ${tc.body[1].type} FOR
- Should Not Be Run ${tc.body[1].body} 1
- Should Be Equal ${tc.body[1].body[0].type} ITERATION
- Should Not Be Run ${tc.body[1].body[0].body} 2
- Should Be Equal ${tc.body[1].body[0].body[0].type} IF/ELSE ROOT
- Should Not Be Run ${tc.body[1].body[0].body[0].body} 2
- Should Be Equal ${tc.body[1].body[0].body[0].body[0].type} IF
- Should Not Be Run ${tc.body[1].body[0].body[0].body[0].body} 2
- Should Be Equal ${tc.body[1].body[0].body[0].body[0].body[0].type} FOR
- Should Not Be Run ${tc.body[1].body[0].body[0].body[0].body[0].body} 1
- Should Be Equal ${tc.body[1].body[0].body[0].body[0].body[0].body[0].type} ITERATION
- Should Not Be Run ${tc.body[1].body[0].body[0].body[0].body[0].body[0].body} 3
- Should Be Equal ${tc.body[1].body[0].body[0].body[0].body[0].body[0].body[0].type} KEYWORD
- Should Be Equal ${tc.body[1].body[0].body[0].body[0].body[0].body[0].body[1].type} KEYWORD
- Should Be Equal ${tc.body[1].body[0].body[0].body[0].body[0].body[0].body[2].type} KEYWORD
- Should Be Equal ${tc.body[1].body[0].body[0].body[0].body[1].type} KEYWORD
- Should Be Equal ${tc.body[1].body[0].body[0].body[1].type} ELSE
- Should Not Be Run ${tc.body[1].body[0].body[0].body[1].body} 2
- Should Be Equal ${tc.body[1].body[0].body[0].body[1].body[0].type} WHILE
- Should Not Be Run ${tc.body[1].body[0].body[0].body[1].body[0].body} 1
- Should Be Equal ${tc.body[1].body[0].body[0].body[1].body[0].body[0].type} ITERATION
- Should Not Be Run ${tc.body[1].body[0].body[0].body[1].body[0].body[0].body} 2
- Should Be Equal ${tc.body[1].body[0].body[0].body[1].body[0].body[0].body[0].type} KEYWORD
- Should Be Equal ${tc.body[1].body[0].body[0].body[1].body[0].body[0].body[1].type} KEYWORD
- Should Be Equal ${tc.body[1].body[0].body[0].body[1].body[1].type} TRY/EXCEPT ROOT
- Should Not Be Run ${tc.body[1].body[0].body[0].body[1].body[1].body} 2
- Should Be Equal ${tc.body[1].body[0].body[0].body[1].body[1].body[0].type} TRY
- Should Not Be Run ${tc.body[1].body[0].body[0].body[1].body[1].body[0].body} 1
- Should Be Equal ${tc.body[1].body[0].body[0].body[1].body[1].body[0].body[0].type} KEYWORD
- Should Be Equal ${tc.body[1].body[0].body[0].body[1].body[1].body[1].type} EXCEPT
- Should Not Be Run ${tc.body[1].body[0].body[0].body[1].body[1].body[1].body} 1
- Should Be Equal ${tc.body[1].body[0].body[0].body[1].body[1].body[1].body[0].type} BREAK
- Should Be Equal ${tc.body[1].body[0].body[1].type} KEYWORD
- Should Be Equal ${tc.body[2].type} KEYWORD
+ Should Not Be Run ${tc[1:]} 2
+ Should Be Equal ${tc[1].type} FOR
+ Should Not Be Run ${tc[1].body} 1
+ Should Be Equal ${tc[1, 0].type} ITERATION
+ Should Not Be Run ${tc[1, 0].body} 2
+ Should Be Equal ${tc[1, 0, 0].type} IF/ELSE ROOT
+ Should Not Be Run ${tc[1, 0, 0].body} 2
+ Should Be Equal ${tc[1, 0, 0, 0].type} IF
+ Should Not Be Run ${tc[1, 0, 0, 0].body} 2
+ Should Be Equal ${tc[1, 0, 0, 0, 0].type} FOR
+ Should Not Be Run ${tc[1, 0, 0, 0, 0].body} 1
+ Should Be Equal ${tc[1, 0, 0, 0, 0, 0].type} ITERATION
+ Should Not Be Run ${tc[1, 0, 0, 0, 0, 0].body} 2
+ Should Be Equal ${tc[1, 0, 0, 0, 0, 0, 0].type} KEYWORD
+ Should Be Equal ${tc[1, 0, 0, 0, 0, 0, 1].type} GROUP
+ Should Not Be Run ${tc[1, 0, 0, 0, 0, 0, 1].body} 2
+ Should Be Equal ${tc[1, 0, 0, 0, 0, 0, 1, 0].type} KEYWORD
+ Should Be Equal ${tc[1, 0, 0, 0, 0, 0, 1, 1].type} KEYWORD
+ Should Be Equal ${tc[1, 0, 0, 0, 1].type} KEYWORD
+ Should Be Equal ${tc[1, 0, 0, 1].type} ELSE
+ Should Not Be Run ${tc[1, 0, 0, 1].body} 2
+ Should Be Equal ${tc[1, 0, 0, 1, 0].type} WHILE
+ Should Not Be Run ${tc[1, 0, 0, 1, 0].body} 1
+ Should Be Equal ${tc[1, 0, 0, 1, 0, 0].type} ITERATION
+ Should Not Be Run ${tc[1, 0, 0, 1, 0, 0].body} 2
+ Should Be Equal ${tc[1, 0, 0, 1, 0, 0, 0].type} KEYWORD
+ Should Be Equal ${tc[1, 0, 0, 1, 0, 0, 1].type} KEYWORD
+ Should Be Equal ${tc[1, 0, 0, 1, 1].type} TRY/EXCEPT ROOT
+ Should Not Be Run ${tc[1, 0, 0, 1, 1].body} 2
+ Should Be Equal ${tc[1, 0, 0, 1, 1, 0].type} TRY
+ Should Not Be Run ${tc[1, 0, 0, 1, 1, 0].body} 1
+ Should Be Equal ${tc[1, 0, 0, 1, 1, 0, 0].type} KEYWORD
+ Should Be Equal ${tc[1, 0, 0, 1, 1, 1].type} EXCEPT
+ Should Not Be Run ${tc[1, 0, 0, 1, 1, 1].body} 1
+ Should Be Equal ${tc[1, 0, 0, 1, 1, 1, 0].type} BREAK
+ Should Be Equal ${tc[1, 0, 1].type} KEYWORD
+ Should Be Equal ${tc[2].type} KEYWORD
Failure in user keyword
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]}
- Should Not Be Run ${tc.body[0].body[1:]} 2
+ Should Not Be Run ${tc[1:]}
+ Should Not Be Run ${tc[0][1:]} 2
Failure in IF branch
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[0].body[0].body[1:]}
- Should Not Be Run ${tc.body[0].body[1].body}
- Should Not Be Run ${tc.body[1:]}
+ Should Not Be Run ${tc[0, 0][1:]}
+ Should Not Be Run ${tc[0, 1].body}
+ Should Not Be Run ${tc[1:]}
Failure in ELSE IF branch
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[0].body[0].body}
- Should Not Be Run ${tc.body[0].body[1].body[1:]}
- Should Not Be Run ${tc.body[0].body[2].body}
- Should Not Be Run ${tc.body[1:]}
+ Should Not Be Run ${tc[0, 0].body}
+ Should Not Be Run ${tc[0, 1][1:]}
+ Should Not Be Run ${tc[0, 2].body}
+ Should Not Be Run ${tc[1:]}
Failure in ELSE branch
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[0].body[0].body}
- Should Not Be Run ${tc.body[0].body[1].body[1:]}
- Should Not Be Run ${tc.body[1:]}
+ Should Not Be Run ${tc[0, 0].body}
+ Should Not Be Run ${tc[0, 1][1:]}
+ Should Not Be Run ${tc[1:]}
+
+Failure in GROUP
+ ${tc} = Check Test Case ${TESTNAME}
+ Should Not Be Run ${tc[0, 0][1:]}
+ Should Not Be Run ${tc[0][1:]} 2
+ Should Not Be Run ${tc[0, 2].body}
+ Should Not Be Run ${tc[1:]}
Failure in FOR iteration
${tc} = Check Test Case ${TESTNAME}
- Should Not Be Run ${tc.body[1:]}
- Length Should Be ${tc.body[0].body} 1
- Should Not Be Run ${tc.body[0].body[0].body[1:]}
+ Should Not Be Run ${tc[1:]}
+ Length Should Be ${tc[0].body} 1
+ Should Not Be Run ${tc[0, 0][1:]}
*** Keywords ***
Should Not Be Run
diff --git a/atest/robot/running/stopping_with_signal.robot b/atest/robot/running/stopping_with_signal.robot
index 15043d4bc59..f93f2eb4348 100644
--- a/atest/robot/running/stopping_with_signal.robot
+++ b/atest/robot/running/stopping_with_signal.robot
@@ -59,8 +59,8 @@ One Signal Should Stop Test Execution Gracefully And Test Case And Suite Teardow
Start And Send Signal with_teardown.robot One SIGINT
Check Test Cases Have Failed Correctly
${tc} = Get Test Case Test
- Check Log Message ${tc.teardown.msgs[0]} Logging Test Case Teardown
- Check Log Message ${SUITE.teardown.kws[0].msgs[0]} Logging Suite Teardown
+ Check Log Message ${tc.teardown[0]} Logging Test Case Teardown
+ Check Log Message ${SUITE.teardown[0, 0]} Logging Suite Teardown
Skip Teardowns After Stopping Gracefully
Start And Send Signal with_teardown.robot One SIGINT 0s --SkipTeardownOnExit
@@ -73,9 +73,9 @@ SIGINT Signal Should Stop Async Test Execution Gracefully
Start And Send Signal async_stop.robot One SIGINT 5
Check Test Cases Have Failed Correctly
${tc} = Get Test Case Test
- Evaluate len(${tc.kws[1].msgs}) == 1
- Check Log Message ${tc.kws[1].msgs[0]} Start Sleep
- Evaluate len(${SUITE.teardown.msgs}) == 0
+ Length Should Be ${tc[1].body} 1
+ Check Log Message ${tc[1, 0]} Start Sleep
+ Length Should Be ${SUITE.teardown.body} 0
Two SIGINT Signals Should Stop Async Test Execution Forcefully
Start And Send Signal async_stop.robot Two SIGINTs 5
@@ -86,9 +86,9 @@ SIGTERM Signal Should Stop Async Test Execution Gracefully
Start And Send Signal async_stop.robot One SIGTERM 5
Check Test Cases Have Failed Correctly
${tc} = Get Test Case Test
- Evaluate len(${tc.kws[1].msgs}) == 1
- Check Log Message ${tc.kws[1].msgs[0]} Start Sleep
- Evaluate len(${SUITE.teardown.msgs}) == 0
+ Length Should Be ${tc[1].body} 1
+ Check Log Message ${tc[1, 0]} Start Sleep
+ Length Should Be ${SUITE.teardown.body} 0
Two SIGTERM Signals Should Stop Async Test Execution Forcefully
[Tags] no-windows
diff --git a/atest/robot/running/test_case_status.robot b/atest/robot/running/test_case_status.robot
index cba04ca835d..55e4ae27b1a 100644
--- a/atest/robot/running/test_case_status.robot
+++ b/atest/robot/running/test_case_status.robot
@@ -41,12 +41,10 @@ Test Setup And Teardown Pass
Check Test Case ${TEST NAME}
Test Teardown is Run When Setup Fails
- ${test} Check Test Case ${TEST NAME}
- ${td} = Set Variable ${test.teardown}
- Should Not Be Equal ${td} ${None} Teardown not run No values
- Length Should Be ${td.msgs} 1
- Check Log Message ${td.msgs[0]} Hello from teardown!
- Length Should Be ${td.kws} 0
+ ${tc} = Check Test Case ${TEST NAME}
+ Should Not Be Equal ${tc.teardown} ${None} Teardown not run No values
+ Length Should Be ${tc.teardown.body} 1
+ Check Log Message ${tc.teardown[0]} Hello from teardown!
Test Setup And Teardown Fails
Check Test Case ${TEST NAME}
diff --git a/atest/robot/running/test_template.robot b/atest/robot/running/test_template.robot
index a6faecac8dd..ba2a2e22941 100644
--- a/atest/robot/running/test_template.robot
+++ b/atest/robot/running/test_template.robot
@@ -59,32 +59,32 @@ Invalid FOR
Template With IF
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].status} PASS
- Should Be Equal ${tc.body[0].body[0].type} IF
- Should Be Equal ${tc.body[0].body[0].status} NOT RUN
- Should Be Equal ${tc.body[0].body[1].type} ELSE IF
- Should Be Equal ${tc.body[0].body[1].status} NOT RUN
- Should Be Equal ${tc.body[0].body[2].type} ELSE
- Should Be Equal ${tc.body[0].body[2].status} PASS
+ Should Be Equal ${tc[0].status} PASS
+ Should Be Equal ${tc[0, 0].type} IF
+ Should Be Equal ${tc[0, 0].status} NOT RUN
+ Should Be Equal ${tc[0, 1].type} ELSE IF
+ Should Be Equal ${tc[0, 1].status} NOT RUN
+ Should Be Equal ${tc[0, 2].type} ELSE
+ Should Be Equal ${tc[0, 2].status} PASS
Template With IF Failing
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].status} FAIL
- Should Be Equal ${tc.body[0].body[0].type} IF
- Should Be Equal ${tc.body[0].body[0].status} FAIL
- Should Be Equal ${tc.body[1].status} FAIL
- Should Be Equal ${tc.body[1].body[0].type} IF
- Should Be Equal ${tc.body[1].body[0].status} NOT RUN
- Should Be Equal ${tc.body[1].body[1].type} ELSE IF
- Should Be Equal ${tc.body[1].body[1].status} FAIL
- Should Be Equal ${tc.body[1].body[2].type} ELSE
- Should Be Equal ${tc.body[1].body[2].status} NOT RUN
+ Should Be Equal ${tc[0].status} FAIL
+ Should Be Equal ${tc[0, 0].type} IF
+ Should Be Equal ${tc[0, 0].status} FAIL
+ Should Be Equal ${tc[1].status} FAIL
+ Should Be Equal ${tc[1, 0].type} IF
+ Should Be Equal ${tc[1, 0].status} NOT RUN
+ Should Be Equal ${tc[1, 1].type} ELSE IF
+ Should Be Equal ${tc[1, 1].status} FAIL
+ Should Be Equal ${tc[1, 2].type} ELSE
+ Should Be Equal ${tc[1, 2].status} NOT RUN
Invalid IF
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].status} FAIL
- Should Be Equal ${tc.body[0].body[0].type} IF
- Should Be Equal ${tc.body[0].body[0].status} FAIL
+ Should Be Equal ${tc[0].status} FAIL
+ Should Be Equal ${tc[0, 0].type} IF
+ Should Be Equal ${tc[0, 0].status} FAIL
FOR and IF
Check Test Case ${TESTNAME}
diff --git a/atest/robot/running/test_template_with_embeded_args.robot b/atest/robot/running/test_template_with_embeded_args.robot
index 680406bce21..65b3d427abe 100644
--- a/atest/robot/running/test_template_with_embeded_args.robot
+++ b/atest/robot/running/test_template_with_embeded_args.robot
@@ -5,39 +5,39 @@ Resource atest_resource.robot
*** Test Cases ***
Matching arguments
${tc} = Check Test Case ${TESTNAME}
- Keyword should be ${tc.kws[0]} The result of 1 + 1 should be 2
- Keyword should be ${tc.kws[1]} The result of 1 + 2 should be 3
- Keyword should be ${tc.kws[2]} The result of 1 + 3 should be 5
+ Keyword should be ${tc[0]} The result of 1 + 1 should be 2
+ Keyword should be ${tc[1]} The result of 1 + 2 should be 3
+ Keyword should be ${tc[2]} The result of 1 + 3 should be 5
Argument names do not need to be same as in definition
${tc} = Check Test Case ${TESTNAME}
- Keyword should be ${tc.kws[0]} The result of 1 + 1 should be 2
- Keyword should be ${tc.kws[1]} The result of 1 + 2 should be 3
- Keyword should be ${tc.kws[2]} The result of 1 + 3 should be 5
+ Keyword should be ${tc[0]} The result of 1 + 1 should be 2
+ Keyword should be ${tc[1]} The result of 1 + 2 should be 3
+ Keyword should be ${tc[2]} The result of 1 + 3 should be 5
Some arguments can be hard-coded
${tc} = Check Test Case ${TESTNAME}
- Keyword should be ${tc.kws[0]} The result of 1 + 1 should be 3
- Keyword should be ${tc.kws[1]} The result of 1 + 2 should be 3
- Keyword should be ${tc.kws[2]} The result of 1 + 3 should be 3
+ Keyword should be ${tc[0]} The result of 1 + 1 should be 3
+ Keyword should be ${tc[1]} The result of 1 + 2 should be 3
+ Keyword should be ${tc[2]} The result of 1 + 3 should be 3
Can have different arguments than definition
${tc} = Check Test Case ${TESTNAME}
- Keyword should be ${tc.kws[0]} The result of 38 + 3 + 1 should be 42
- Keyword should be ${tc.kws[1]} The non-existing of 666 should be 42
+ Keyword should be ${tc[0]} The result of 38 + 3 + 1 should be 42
+ Keyword should be ${tc[1]} The non-existing of 666 should be 42
Can use variables
${tc} = Check Test Case ${TESTNAME}
- Keyword should be ${tc.kws[0]} The result of \${1} + \${2} should be \${3}
+ Keyword should be ${tc[0]} The result of \${1} + \${2} should be \${3}
Cannot have more arguments than variables
${tc} = Check Test Case ${TESTNAME}
- Keyword should be ${tc.kws[0]} The result of \${calc} should be 3
+ Keyword should be ${tc[0]} The result of \${calc} should be 3
... 1 + 2 extra
Cannot have less arguments than variables
${tc} = Check Test Case ${TESTNAME}
- Keyword should be ${tc.kws[0]} The result of \${calc} should be \${extra}
+ Keyword should be ${tc[0]} The result of \${calc} should be \${extra}
... 1 + 2
*** Keywords ***
diff --git a/atest/robot/running/timeouts.robot b/atest/robot/running/timeouts.robot
index d106d24919b..fa3d5ccec0a 100644
--- a/atest/robot/running/timeouts.robot
+++ b/atest/robot/running/timeouts.robot
@@ -23,7 +23,7 @@ Show Correct Traceback When Failing Before Timeout
... ${SPACE*2}File "*", line *, in exception
... ${SPACE*4}raise exception(msg)
... RuntimeError: Failure before timeout
- Check Log Message ${tc.kws[0].msgs[-1]} ${expected} DEBUG pattern=True traceback=True
+ Check Log Message ${tc[0, -1]} ${expected} DEBUG pattern=True traceback=True
Timeouted Test Timeouts
Check Test Case Sleeping And Timeouting
@@ -63,17 +63,17 @@ Test Timeouts When Also Keywords Are Timeouted
Keyword Timeout From Variable
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].timeout} 1 millisecond
+ Should Be Equal ${tc[0].timeout} 1 millisecond
Keyword Timeout From Argument
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].timeout} 1 second
- Should Be Equal ${tc.kws[1].timeout} 2 milliseconds
+ Should Be Equal ${tc[0].timeout} 1 second
+ Should Be Equal ${tc[1].timeout} 2 milliseconds
Embedded Arguments Timeout From Argument
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].timeout} 1 second
- Should Be Equal ${tc.kws[1].timeout} 3 milliseconds
+ Should Be Equal ${tc[0].timeout} 1 second
+ Should Be Equal ${tc[1].timeout} 3 milliseconds
Local Variables Are Not Visible In Child Keyword Timeout
Check Test Case ${TEST NAME}
@@ -88,9 +88,9 @@ Test Timeout During Setup
Teardown After Test Timeout
[Documentation] Test that teardown is executed after a test has timed out
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.teardown.msgs[0]} Teardown executed
+ Check Log Message ${tc.teardown[0]} Teardown executed
${tc} = Check Test Case Teardown With Sleep After Test Timeout
- Check Log Message ${tc.teardown.kws[1].msgs[0]} Teardown executed
+ Check Log Message ${tc.teardown[1, 0]} Teardown executed
Failing Teardown After Test Timeout
Check Test Case ${TEST NAME}
@@ -98,7 +98,7 @@ Failing Teardown After Test Timeout
Test Timeout During Teardown
[Documentation] Test timeout should not interrupt teardown but test should be failed afterwards
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.teardown.kws[1].msgs[0]} Teardown executed
+ Check Log Message ${tc.teardown[1, 0]} Teardown executed
Timeouted Setup Passes
Check Test Case ${TEST NAME}
@@ -133,8 +133,8 @@ Keyword Timeout Should Not Be Active For Run Keyword Variants But To Keywords Th
Logging With Timeouts
[Documentation] Testing that logging works with timeouts
${tc} = Check Test Case Timeouted Keyword Passes
- Check Log Message ${tc.kws[0].msgs[1]} Testing logging in timeouted test
- Check Log Message ${tc.kws[1].kws[0].msgs[1]} Testing logging in timeouted keyword
+ Check Log Message ${tc[0, 1]} Testing logging in timeouted test
+ Check Log Message ${tc[1, 0, 1]} Testing logging in timeouted keyword
Timeouted Keyword Called With Wrong Number of Arguments
Check Test Case ${TEST NAME}
@@ -144,31 +144,31 @@ Timeouted Keyword Called With Wrong Number of Arguments with Run Keyword
Test Timeout Logging
${tc} = Check Test Case Passing
- Timeout should have been active ${tc.kws[0]} 1 second 1
+ Timeout should have been active ${tc[0]} 1 second 1
${tc} = Check Test Case Failing Before Timeout
- Timeout should have been active ${tc.kws[0]} 2 seconds 3
+ Timeout should have been active ${tc[0]} 2 seconds 3
${tc} = Check Test Case Sleeping And Timeouting
- Timeout should have been active ${tc.kws[0]} 1 second 2 exceeded=True
+ Timeout should have been active ${tc[0]} 1 second 2 exceeded=True
Keyword Timeout Logging
${tc} = Check Test Case Timeouted Keyword Passes
- Keyword timeout should have been active ${tc.kws[1].kws[0]} 5 seconds 2
+ Keyword timeout should have been active ${tc[1, 0]} 5 seconds 2
${tc} = Check Test Case Timeouted Keyword Fails Before Timeout
- Keyword timeout should have been active ${tc.kws[0].kws[0]} 2 hours 30 minutes 3
+ Keyword timeout should have been active ${tc[0, 0]} 2 hours 30 minutes 3
${tc} = Check Test Case Timeouted Keyword Timeouts
- Keyword timeout should have been active ${tc.kws[0].kws[0]} 99 milliseconds 2 exceeded=True
+ Keyword timeout should have been active ${tc[0, 0]} 99 milliseconds 2 exceeded=True
Zero timeout is ignored
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.timeout} 0 seconds
- Should Be Equal ${tc.kws[0].timeout} 0 seconds
- Elapsed Time Should Be Valid ${tc.kws[0].elapsed_time} minimum=0.099
+ Should Be Equal ${tc.timeout} ${None}
+ Should Be Equal ${tc[0].timeout} ${None}
+ Elapsed Time Should Be Valid ${tc[0].elapsed_time} minimum=0.099
Negative timeout is ignored
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].timeout} - 1 second
- Should Be Equal ${tc.kws[0].timeout} - 1 second
- Elapsed Time Should Be Valid ${tc.kws[0].elapsed_time} minimum=0.099
+ Should Be Equal ${tc.timeout} ${None}
+ Should Be Equal ${tc[0].timeout} ${None}
+ Elapsed Time Should Be Valid ${tc[0].elapsed_time} minimum=0.099
Invalid test timeout
Check Test Case ${TEST NAME}
@@ -179,8 +179,8 @@ Invalid keyword timeout
*** Keywords ***
Timeout should have been active
[Arguments] ${kw} ${timeout} ${msg count} ${exceeded}=False ${type}=Test
- Check Log Message ${kw.msgs[0]} ${type} timeout ${timeout} active. * left. DEBUG pattern=True
- Length Should Be ${kw.msgs} ${msg count}
+ Check Log Message ${kw[0]} ${type} timeout ${timeout} active. * left. DEBUG pattern=True
+ Length Should Be ${kw.body} ${msg count}
IF ${exceeded} Timeout should have exceeded ${kw} ${timeout} ${type}
Keyword timeout should have been active
@@ -189,4 +189,4 @@ Keyword timeout should have been active
Timeout should have exceeded
[Arguments] ${kw} ${timeout} ${type}=Test
- Check Log Message ${kw.msgs[1]} ${type} timeout ${timeout} exceeded. FAIL
+ Check Log Message ${kw[1]} ${type} timeout ${timeout} exceeded. FAIL
diff --git a/atest/robot/running/try_except/try_except.robot b/atest/robot/running/try_except/try_except.robot
index 1b599b5c98f..8d074cd6446 100644
--- a/atest/robot/running/try_except/try_except.robot
+++ b/atest/robot/running/try_except/try_except.robot
@@ -40,16 +40,16 @@ Syntax errors cannot be caught
Finally block executed when no failures
[Template] None
${tc}= Verify try except and block statuses PASS NOT RUN PASS PASS
- Check Log Message ${tc.body[0].body[0].body[0].msgs[0]} all good
- Check Log Message ${tc.body[0].body[2].body[0].msgs[0]} in the else
- Check Log Message ${tc.body[0].body[3].body[0].msgs[0]} Hello from finally!
+ Check Log Message ${tc[0, 0, 0, 0]} all good
+ Check Log Message ${tc[0, 2, 0, 0]} in the else
+ Check Log Message ${tc[0, 3, 0, 0]} Hello from finally!
Finally block executed after catch
[Template] None
${tc}= Verify try except and block statuses FAIL PASS PASS
- Check Log Message ${tc.body[0].body[0].body[0].msgs[0]} all not good FAIL
- Check Log Message ${tc.body[0].body[1].body[0].msgs[0]} we are safe now
- Check Log Message ${tc.body[0].body[2].body[0].msgs[0]} Hello from finally!
+ Check Log Message ${tc[0, 0, 0, 0]} all not good FAIL
+ Check Log Message ${tc[0, 1, 0, 0]} we are safe now
+ Check Log Message ${tc[0, 2, 0, 0]} Hello from finally!
Finally block executed after failure in except
FAIL FAIL NOT RUN PASS
diff --git a/atest/robot/running/while/invalid_while.robot b/atest/robot/running/while/invalid_while.robot
index b0ec2f3a5aa..e2526405943 100644
--- a/atest/robot/running/while/invalid_while.robot
+++ b/atest/robot/running/while/invalid_while.robot
@@ -5,7 +5,7 @@ Suite Setup Run Tests --log test_result_model_as_well running/while/
*** Test Cases ***
Multiple conditions
${tc} = Check Invalid WHILE Test Case
- Should Be Equal ${tc.body[0].condition} Too, many, conditions, !
+ Should Be Equal ${tc[0].condition} Too, many, conditions, !
Invalid condition
Check Invalid WHILE Test Case
@@ -37,16 +37,25 @@ Invalid condition causes normal error
Non-existing variable in condition causes normal error
Check Test Case ${TEST NAME}
+Templatest are not supported
+ ${tc} = Check Test Case ${TEST NAME}
+ Should Be Equal ${tc[0].type} WHILE
+ Should Be Equal ${tc[0].status} FAIL
+ Should Be Equal ${tc[0, 0].type} ITERATION
+ Should Be Equal ${tc[0, 0].status} NOT RUN
+ Check Keyword Data ${tc[0, 0, 0]} ${EMPTY} args=1 status=NOT RUN
+ Check Keyword Data ${tc[0, 0, 1]} ${EMPTY} args=2 status=NOT RUN
+
*** Keywords ***
Check Invalid WHILE Test Case
[Arguments] ${body}=True
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].type} WHILE
- Should Be Equal ${tc.body[0].status} FAIL
- Should Be Equal ${tc.body[0].body[0].type} ITERATION
- Should Be Equal ${tc.body[0].body[0].status} NOT RUN
+ Should Be Equal ${tc[0].type} WHILE
+ Should Be Equal ${tc[0].status} FAIL
+ Should Be Equal ${tc[0, 0].type} ITERATION
+ Should Be Equal ${tc[0, 0].status} NOT RUN
IF ${body}
- Should Be Equal ${tc.body[0].body[0].body[0].full_name} BuiltIn.Fail
- Should Be Equal ${tc.body[0].body[0].body[0].status} NOT RUN
+ Should Be Equal ${tc[0, 0, 0].full_name} BuiltIn.Fail
+ Should Be Equal ${tc[0, 0, 0].status} NOT RUN
END
RETURN ${tc}
diff --git a/atest/robot/running/while/nested_while.robot b/atest/robot/running/while/nested_while.robot
index 96e08c15726..e745c002619 100644
--- a/atest/robot/running/while/nested_while.robot
+++ b/atest/robot/running/while/nested_while.robot
@@ -5,24 +5,24 @@ Suite Setup Run Tests ${EMPTY} running/while/nested_while.robot
*** Test Cases ***
Inside FOR
${tc}= Check test case ${TEST NAME}
- Check loop attributes ${tc.body[0].body[0].body[0]} PASS 4
- Check loop attributes ${tc.body[0].body[1].body[0]} PASS 3
- Check loop attributes ${tc.body[0].body[2].body[0]} PASS 2
- Length should be ${tc.body[0].body} 3
+ Check loop attributes ${tc[0, 0, 0]} PASS 4
+ Check loop attributes ${tc[0, 1, 0]} PASS 3
+ Check loop attributes ${tc[0, 2, 0]} PASS 2
+ Length should be ${tc[0].body} 3
Failing inside FOR
${tc}= Check test case ${TEST NAME}
- Check loop attributes ${tc.body[0].body[0].body[0]} FAIL 2
- Length should be ${tc.body[0].body} 1
+ Check loop attributes ${tc[0, 0, 0]} FAIL 2
+ Length should be ${tc[0].body} 1
Inside IF
${tc}= Check test case ${TEST NAME}
- Check loop attributes ${tc.body[0].body[0].body[1]} PASS 4
+ Check loop attributes ${tc[0, 0, 1]} PASS 4
In suite setup
${suite}= Get Test Suite Nested While
- Check loop attributes ${suite.setup.body[1]} PASS 4
+ Check loop attributes ${suite.setup[1]} PASS 4
In suite teardown
${suite}= Get Test Suite Nested While
- Check loop attributes ${suite.teardown.body[1]} PASS 4
+ Check loop attributes ${suite.teardown[1]} PASS 4
diff --git a/atest/robot/running/while/on_limit.robot b/atest/robot/running/while/on_limit.robot
index 6d69d51bc65..91415d27cb9 100644
--- a/atest/robot/running/while/on_limit.robot
+++ b/atest/robot/running/while/on_limit.robot
@@ -4,58 +4,56 @@ Resource while.resource
*** Test Cases ***
On limit pass with time limit defined
- Check Test Case ${TESTNAME}
+ Check WHILE Loop PASS not known
On limit pass with iteration limit defined
Check WHILE loop PASS 5
-On limit message without limit
- Check Test Case ${TESTNAME}
-
On limit fail
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 5
On limit pass with failures in loop
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 1
On limit pass with continuable failure
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 2
On limit fail with continuable failure
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 2
Invalid on_limit
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 1 not_run=True
Invalid on_limit from variable
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 1 not_run=True
-On limit without limit defined
- Check Test Case ${TESTNAME}
+On limit without limit
+ Check WHILE Loop FAIL 1 not_run=True
On limit with invalid variable
- Check Test Case ${TESTNAME}
-
-Wrong WHILE argument
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 1 not_run=True
On limit message
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 11
+
+On limit message without limit
+ Check WHILE Loop FAIL 10000
On limit message from variable
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 5
Part of on limit message from variable
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 5
-No on limit message
- Check Test Case ${TESTNAME}
+On limit message is not used if limit is not hit
+ Check WHILE Loop PASS 2
Nested while on limit message
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 1 path=body[0]
+ Check WHILE Loop FAIL 5 path=body[0].body[0].body[0]
On limit message before limit
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 5
On limit message with invalid variable
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 1 not_run=True
diff --git a/atest/robot/running/while/while.resource b/atest/robot/running/while/while.resource
index f0c49be600f..392399f1bb6 100644
--- a/atest/robot/running/while/while.resource
+++ b/atest/robot/running/while/while.resource
@@ -3,14 +3,19 @@ Resource atest_resource.robot
*** Keywords ***
Check WHILE loop
- [Arguments] ${status} ${iterations} ${path}=body[0]
- ${tc}= Check test case ${TEST NAME}
- ${loop}= Check loop attributes ${tc.${path}} ${status} ${iterations}
+ [Arguments] ${status} ${iterations} ${path}=body[0] ${not_run}=False
+ ${tc}= Check Test Case ${TEST NAME}
+ ${loop}= Check Loop Attributes ${tc.${path}} ${status} ${iterations}
+ IF ${not_run}
+ Should Be Equal ${loop.body[0].status} NOT RUN
+ END
RETURN ${loop}
-Check loop attributes
+Check Loop Attributes
[Arguments] ${loop} ${status} ${iterations}
- Should be equal ${loop.type} WHILE
- Should be equal ${loop.status} ${status}
- Length Should Be ${loop.kws} ${iterations}
+ Should Be Equal ${loop.type} WHILE
+ Should Be Equal ${loop.status} ${status}
+ IF '${iterations}' != 'not known'
+ Length Should Be ${loop.non_messages} ${iterations}
+ END
RETURN ${loop}
diff --git a/atest/robot/running/while/while.robot b/atest/robot/running/while/while.robot
index 899d6881da6..76580a70e04 100644
--- a/atest/robot/running/while/while.robot
+++ b/atest/robot/running/while/while.robot
@@ -5,7 +5,7 @@ Suite Setup Run Tests ${EMPTY} running/while/while.robot
*** Test Cases ***
Loop executed once
${loop}= Check While Loop PASS 1
- Check Log Message ${loop.body[0].body[0].msgs[0]} 1
+ Check Log Message ${loop[0, 0, 0]} 1
Loop executed multiple times
Check While Loop PASS 5
diff --git a/atest/robot/running/while/while_limit.robot b/atest/robot/running/while/while_limit.robot
index b7260521114..22185673eee 100644
--- a/atest/robot/running/while/while_limit.robot
+++ b/atest/robot/running/while/while_limit.robot
@@ -4,59 +4,63 @@ Resource while.resource
*** Test Cases ***
Default limit is 10000 iterations
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 10000
Limit with iteration count
- Check while loop FAIL 5
+ Check WHILE Loop FAIL 5
Iteration count with 'times' suffix
- Check while loop FAIL 3
+ Check WHILE Loop FAIL 3
Iteration count with 'x' suffix
- Check while loop FAIL 4
+ Check WHILE Loop FAIL 4
Iteration count normalization
- ${tc}= Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].limit} 1_000
- Should Be Equal ${tc.body[1].limit} 3 0 T i m e S
+ ${loop}= Check WHILE Loop PASS 1 body[0]
+ Should Be Equal ${loop.limit} 1_000
+ ${loop}= Check WHILE Loop FAIL 30 body[1]
+ Should Be Equal ${loop.limit} 3 0 T i m e S
Limit as timestr
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL not known
Limit from variable
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 11
Part of limit from variable
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL not known
Limit can be disabled
- Check Test Case ${TESTNAME}
+ Check WHILE Loop PASS 10041
-No Condition With Limit
- Check Test Case ${TESTNAME}
+No condition with limit
+ Check WHILE Loop FAIL 2
Limit exceeds in teardown
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL not known teardown.body[0]
Limit exceeds after failures in teardown
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 2 teardown.body[0]
Continue after limit in teardown
- Check Test Case ${TESTNAME}
+ Check WHILE Loop PASS not known teardown.body[0]
Invalid limit invalid suffix
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 1 not_run=True
Invalid limit invalid value
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 1 not_run=True
Invalid limit mistyped prefix
- Check Test Case ${TESTNAME}
+ Check WHILE Loop FAIL 1 not_run=True
+
+Limit with non-existing variable
+ Check WHILE Loop FAIL 1 not_run=True
Limit used multiple times
- ${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].limit} 2
+ ${loop}= Check WHILE Loop FAIL 1 not_run=True
+ Should Be Equal ${loop.limit} 2
Invalid values after limit
- ${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.body[0].condition} $variable < 2, limit=2, invalid
+ ${loop}= Check WHILE Loop FAIL 1 not_run=True
+ Should Be Equal ${loop.condition} $variable < 2, limit=2, invalid
diff --git a/atest/robot/standard_libraries/builtin/call_method.robot b/atest/robot/standard_libraries/builtin/call_method.robot
index 86e02487518..8e34ce4d981 100644
--- a/atest/robot/standard_libraries/builtin/call_method.robot
+++ b/atest/robot/standard_libraries/builtin/call_method.robot
@@ -4,32 +4,32 @@ Resource atest_resource.robot
*** Test Cases ***
Call Method
- Check Test Case ${TEST NAME}
+ Check Test Case ${TEST NAME}
Call Method Returns
- Check Test Case ${TEST NAME}
+ Check Test Case ${TEST NAME}
Called Method Fails
- ${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[0].msgs[0]} Calling method 'my_method' failed: Expected failure FAIL
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Log Message ${tc[0, 0]} Calling method 'my_method' failed: Expected failure FAIL
${error} = Catenate SEPARATOR=\n
... RuntimeError: Expected failure
...
... The above exception was the direct cause of the following exception:
...
... RuntimeError: Calling method 'my_method' failed: Expected failure
- Traceback Should Be ${tc.body[0].msgs[1]}
- ... standard_libraries/builtin/objects_for_call_method.py my_method raise RuntimeError('Expected failure')
+ Traceback Should Be ${tc[0, 1]}
+ ... standard_libraries/builtin/objects_for_call_method.py my_method raise RuntimeError("Expected failure")
... error=${error}
Call Method With Kwargs
- Check Test Case ${TEST NAME}
+ Check Test Case ${TEST NAME}
Equals in non-kwargs must be escaped
- Check Test Case ${TEST NAME}
+ Check Test Case ${TEST NAME}
Call Method From Module
- Check Test Case ${TEST NAME}
+ Check Test Case ${TEST NAME}
Call Non Existing Method
- Check Test Case ${TEST NAME}
+ Check Test Case ${TEST NAME}
diff --git a/atest/robot/standard_libraries/builtin/converter.robot b/atest/robot/standard_libraries/builtin/converter.robot
index 632e676d759..4911659cec2 100644
--- a/atest/robot/standard_libraries/builtin/converter.robot
+++ b/atest/robot/standard_libraries/builtin/converter.robot
@@ -5,7 +5,7 @@ Resource atest_resource.robot
*** Test Cases ***
Convert To Integer
${tc}= Check Test Case ${TEST NAME}
- Verify argument type message ${tc.kws[0].kws[0].msgs[0]}
+ Verify argument type message ${tc[0, 0, 0]}
Convert To Integer With Base
Check Test Case ${TEST NAME}
@@ -18,19 +18,19 @@ Convert To Integer With Embedded Base
Convert To Binary
${tc}= Check Test Case ${TEST NAME}
- Verify argument type message ${tc.kws[0].kws[0].msgs[0]}
+ Verify argument type message ${tc[0, 0, 0]}
Convert To Octal
${tc}= Check Test Case ${TEST NAME}
- Verify argument type message ${tc.kws[0].kws[0].msgs[0]}
+ Verify argument type message ${tc[0, 0, 0]}
Convert To Hex
${tc}= Check Test Case ${TEST NAME}
- Verify argument type message ${tc.kws[0].kws[0].msgs[0]}
+ Verify argument type message ${tc[0, 0, 0]}
Convert To Number
${tc}= Check Test Case ${TEST NAME}
- Verify argument type message ${tc.kws[0].kws[0].msgs[0]}
+ Verify argument type message ${tc[0, 0, 0]}
Convert To Number With Precision
Check Test Case ${TEST NAME}
@@ -40,11 +40,11 @@ Numeric conversions with long types
Convert To String
${tc}= Check Test Case ${TEST NAME}
- Verify argument type message ${tc.kws[0].msgs[0]}
+ Verify argument type message ${tc[0, 0]}
Convert To Boolean
${tc}= Check Test Case ${TEST NAME}
- Verify argument type message ${tc.kws[0].msgs[0]}
+ Verify argument type message ${tc[0, 0]}
Create List
Check Test Case ${TEST NAME}
diff --git a/atest/robot/standard_libraries/builtin/count.robot b/atest/robot/standard_libraries/builtin/count.robot
index 91acc6c8fe5..43122824093 100644
--- a/atest/robot/standard_libraries/builtin/count.robot
+++ b/atest/robot/standard_libraries/builtin/count.robot
@@ -6,24 +6,24 @@ Resource builtin_resource.robot
Get Count
[Documentation] Tested also by Should Contain X Times keyword that uses this intenally.
${tc} = Check test case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} Item found from container 2 times.
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} Item found from container 2 times.
- Check Log Message ${tc.kws[2].kws[0].msgs[0]} Item found from container 1 time.
- Check Log Message ${tc.kws[3].kws[0].msgs[0]} Item found from container 1 time.
- Check Log Message ${tc.kws[4].kws[0].msgs[0]} Item found from container 50 times.
- Check Log Message ${tc.kws[5].kws[0].msgs[0]} Item found from container 0 times.
+ Check Log Message ${tc[0, 0, 0]} Item found from container 2 times.
+ Check Log Message ${tc[1, 0, 0]} Item found from container 2 times.
+ Check Log Message ${tc[2, 0, 0]} Item found from container 1 time.
+ Check Log Message ${tc[3, 0, 0]} Item found from container 1 time.
+ Check Log Message ${tc[4, 0, 0]} Item found from container 50 times.
+ Check Log Message ${tc[5, 0, 0]} Item found from container 0 times.
Should Contain X Times with strings
${tc} = Check test case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Item found from container 2 times.
- Check Log Message ${tc.kws[1].msgs[0]} Item found from container 1 time.
- Check Log Message ${tc.kws[3].msgs[0]} Item found from container 0 times.
+ Check Log Message ${tc[0, 0]} Item found from container 2 times.
+ Check Log Message ${tc[1, 0]} Item found from container 1 time.
+ Check Log Message ${tc[3, 0]} Item found from container 0 times.
Should Contain X Times with containers
${tc} = Check test case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Item found from container 1 time.
- Check Log Message ${tc.kws[1].msgs[0]} Item found from container 2 times.
- Check Log Message ${tc.kws[3].msgs[0]} Item found from container 0 times.
+ Check Log Message ${tc[0, 0]} Item found from container 1 time.
+ Check Log Message ${tc[1, 0]} Item found from container 2 times.
+ Check Log Message ${tc[3, 0]} Item found from container 0 times.
Should Contain X Times failing
Check test case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/builtin/evaluate.robot b/atest/robot/standard_libraries/builtin/evaluate.robot
index 7454e955e1e..02696b60849 100644
--- a/atest/robot/standard_libraries/builtin/evaluate.robot
+++ b/atest/robot/standard_libraries/builtin/evaluate.robot
@@ -9,6 +9,9 @@ Resource atest_resource.robot
Evaluate
Check Test Case ${TESTNAME}
+Custom additions to builtins are supported
+ Check Test Case ${TESTNAME}
+
Modules are imported automatically
Check Test Case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/builtin/fail.robot b/atest/robot/standard_libraries/builtin/fail.robot
index 13e54fa4761..c78ede1bbe6 100644
--- a/atest/robot/standard_libraries/builtin/fail.robot
+++ b/atest/robot/standard_libraries/builtin/fail.robot
@@ -5,11 +5,11 @@ Resource atest_resource.robot
*** Test Cases ***
Fail
${tc}= Check Test Tags ${TESTNAME} force1 force2
- Length Should Be ${tc.kws[0].msgs} 1
+ Length Should Be ${tc[0].body} 1
Fail with message
${tc}= Check Test Tags ${TESTNAME} force1 force2
- Length Should Be ${tc.kws[0].msgs} 1
+ Length Should Be ${tc[0].body} 1
Fail with non-string message
Check Test Case ${TESTNAME}
@@ -19,37 +19,37 @@ Fail with non-true message having non-empty string representation
Set one tag
${tc}= Check Test Tags ${TESTNAME} force1 force2 tag
- Length Should Be ${tc.kws[0].msgs} 2
- Check Log Message ${tc.kws[0].msgs[0]} Set tag 'tag'.
+ Length Should Be ${tc[0].body} 2
+ Check Log Message ${tc[0, 0]} Set tag 'tag'.
Set multiple tags
${tc}= Check Test Tags ${TESTNAME} force1 force2 tag1 tag2
- Length Should Be ${tc.kws[0].msgs} 2
- Check Log Message ${tc.kws[0].msgs[0]} Set tags 'tag1' and 'tag2'.
+ Length Should Be ${tc[0].body} 2
+ Check Log Message ${tc[0, 0]} Set tags 'tag1' and 'tag2'.
Remove one tag
${tc}= Check Test Tags ${TESTNAME} force2
- Length Should Be ${tc.kws[0].msgs} 2
- Check Log Message ${tc.kws[0].msgs[0]} Removed tag 'force1'.
+ Length Should Be ${tc[0].body} 2
+ Check Log Message ${tc[0, 0]} Removed tag 'force1'.
Remove multiple tags
${tc}= Check Test Tags ${TESTNAME}
- Length Should Be ${tc.kws[0].msgs} 2
- Check Log Message ${tc.kws[0].msgs[0]} Removed tags 'force1' and 'force2'.
+ Length Should Be ${tc[0].body} 2
+ Check Log Message ${tc[0, 0]} Removed tags 'force1' and 'force2'.
Remove multiple tags with pattern
${tc}= Check Test Tags ${TESTNAME}
- Length Should Be ${tc.kws[0].msgs} 2
- Check Log Message ${tc.kws[0].msgs[0]} Removed tag 'force?'.
+ Length Should Be ${tc[0].body} 2
+ Check Log Message ${tc[0, 0]} Removed tag 'force?'.
Set and remove tags
${tc}= Check Test Tags ${TESTNAME} force2 tag1 tag2
- Length Should Be ${tc.kws[0].msgs} 3
- Check Log Message ${tc.kws[0].msgs[0]} Removed tags 'force1' and 'nonEx'.
- Check Log Message ${tc.kws[0].msgs[1]} Set tags 'tag1' and 'tag2'.
+ Length Should Be ${tc[0].body} 3
+ Check Log Message ${tc[0, 0]} Removed tags 'force1' and 'nonEx'.
+ Check Log Message ${tc[0, 1]} Set tags 'tag1' and 'tag2'.
Set tags should not be removed
${tc}= Check Test Tags ${TESTNAME} fii foo
- Length Should Be ${tc.kws[0].msgs} 3
- Check Log Message ${tc.kws[0].msgs[0]} Removed tag 'f*'.
- Check Log Message ${tc.kws[0].msgs[1]} Set tags 'foo' and 'fii'.
+ Length Should Be ${tc[0].body} 3
+ Check Log Message ${tc[0, 0]} Removed tag 'f*'.
+ Check Log Message ${tc[0, 1]} Set tags 'foo' and 'fii'.
diff --git a/atest/robot/standard_libraries/builtin/fatal_error.robot b/atest/robot/standard_libraries/builtin/fatal_error.robot
index a840ddb8f20..009dcd947f3 100644
--- a/atest/robot/standard_libraries/builtin/fatal_error.robot
+++ b/atest/robot/standard_libraries/builtin/fatal_error.robot
@@ -10,4 +10,4 @@ Subsequent tests are not executed after `Fatal Error` keyword has been used
Check Test Case ${TESTNAME}
Suite teardown is executed after `Fatal Error` keyword
- Check Log Message ${SUITE.teardown.msgs[0]} AssertionError FAIL
+ Check Log Message ${SUITE.teardown[0]} AssertionError FAIL
diff --git a/atest/robot/standard_libraries/builtin/length.robot b/atest/robot/standard_libraries/builtin/length.robot
index 4c111a8fd9b..7825b0c8ff7 100644
--- a/atest/robot/standard_libraries/builtin/length.robot
+++ b/atest/robot/standard_libraries/builtin/length.robot
@@ -5,19 +5,19 @@ Resource builtin_resource.robot
*** Test Cases ***
Get Length
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} Length is 0.
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} Length is 1.
- Check Log Message ${tc.kws[2].kws[0].msgs[0]} Length is 2.
- Check Log Message ${tc.kws[3].kws[0].msgs[0]} Length is 3.
- Check Log Message ${tc.kws[4].kws[0].msgs[0]} Length is 11.
- Check Log Message ${tc.kws[5].kws[0].msgs[0]} Length is 0.
+ Check Log Message ${tc[0, 0, 0]} Length is 0.
+ Check Log Message ${tc[1, 0, 0]} Length is 1.
+ Check Log Message ${tc[2, 0, 0]} Length is 2.
+ Check Log Message ${tc[3, 0, 0]} Length is 3.
+ Check Log Message ${tc[4, 0, 0]} Length is 11.
+ Check Log Message ${tc[5, 0, 0]} Length is 0.
Length Should Be
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[-1].msgs[0]} Length is 2.
- Check Log Message ${tc.kws[-1].msgs[1]} Length of '*' should be 3 but is 2. FAIL pattern=yep
- Check Log Message ${tc.kws[-1].msgs[2]} Traceback* DEBUG pattern=yep
- Length Should Be ${tc.kws[-1].msgs} 3
+ Check Log Message ${tc[-1, 0]} Length is 2.
+ Check Log Message ${tc[-1, 1]} Length of '*' should be 3 but is 2. FAIL pattern=yep
+ Check Log Message ${tc[-1, 2]} Traceback* DEBUG pattern=yep
+ Length Should Be ${tc[-1].body} 3
Length Should Be with custom message
Check Test Case ${TESTNAME}
@@ -26,25 +26,25 @@ Length Should Be with invalid length
Check Test Case ${TESTNAME}
Should Be Empty
- Check test case ${TESTNAME} 1
- Check test case ${TESTNAME} 2
- Check test case ${TESTNAME} 3
+ Check Test Case ${TESTNAME} 1
+ Check Test Case ${TESTNAME} 2
+ Check Test Case ${TESTNAME} 3
Should Be Empty with custom message
- Check test case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Should Not Be Empty
- Check test case ${TESTNAME} 1
- Check test case ${TESTNAME} 2
+ Check Test Case ${TESTNAME} 1
+ Check Test Case ${TESTNAME} 2
Should Not Be Empty with custom message
- Check test case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Getting length with `length` method
- Check test case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Getting length with `size` method
- Check test case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Getting length with `length` attribute
- Check test case ${TESTNAME}
+ Check Test Case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/builtin/listener_printing_start_end_kw.py b/atest/robot/standard_libraries/builtin/listener_printing_start_end_kw.py
index 9a91451a5bc..a4431f0123e 100644
--- a/atest/robot/standard_libraries/builtin/listener_printing_start_end_kw.py
+++ b/atest/robot/standard_libraries/builtin/listener_printing_start_end_kw.py
@@ -1,14 +1,13 @@
import sys
-
ROBOT_LISTENER_API_VERSION = 2
def start_keyword(name, attrs):
- sys.stdout.write('start keyword %s\n' % name)
- sys.stderr.write('start keyword %s\n' % name)
+ sys.stdout.write(f"start keyword {name}\n")
+ sys.stderr.write(f"start keyword {name}\n")
def end_keyword(name, attrs):
- sys.stdout.write('end keyword %s\n' % name)
- sys.stderr.write('end keyword %s\n' % name)
+ sys.stdout.write(f"end keyword {name}\n")
+ sys.stderr.write(f"end keyword {name}\n")
diff --git a/atest/robot/standard_libraries/builtin/listener_using_builtin.py b/atest/robot/standard_libraries/builtin/listener_using_builtin.py
index 07b83c0001c..22fe1ba767d 100644
--- a/atest/robot/standard_libraries/builtin/listener_using_builtin.py
+++ b/atest/robot/standard_libraries/builtin/listener_using_builtin.py
@@ -5,5 +5,5 @@
def start_keyword(*args):
- if BIN.get_variables()['${TESTNAME}'] == 'Listener Using BuiltIn':
- BIN.set_test_variable('${SET BY LISTENER}', 'quux')
+ if BIN.get_variables()["${TESTNAME}"] == "Listener Using BuiltIn":
+ BIN.set_test_variable("${SET BY LISTENER}", "quux")
diff --git a/atest/robot/standard_libraries/builtin/log.robot b/atest/robot/standard_libraries/builtin/log.robot
index 46867ea77b8..d714149f292 100644
--- a/atest/robot/standard_libraries/builtin/log.robot
+++ b/atest/robot/standard_libraries/builtin/log.robot
@@ -8,187 +8,191 @@ ${HTML} Robot Framework
*** Test Cases ***
Log
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Hello, world!
- Check Log Message ${tc.kws[1].msgs[0]} 42
- Check Log Message ${tc.kws[2].msgs[0]} None
- Check Log Message ${tc.kws[3].msgs[0]} String presentation of MyObject
+ Check Log Message ${tc[0, 0]} Hello, world!
+ Check Log Message ${tc[1, 0]} 42
+ Check Log Message ${tc[2, 0]} None
+ Check Log Message ${tc[3, 0]} String presentation of MyObject
Log with different levels
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[1]} Log says: Hello from tests! INFO
- Check Log Message ${tc.kws[1].msgs[1]} Trace level TRACE
- Check Log Message ${tc.kws[2].msgs[1]} Debug level DEBUG
- Check Log Message ${tc.kws[3].msgs[1]} Info level INFO
- Check Log Message ${tc.kws[4].msgs[1]} Warn level WARN
- Check Log Message ${tc.kws[5].msgs[1]} Error level ERROR
- Check Log Message ${ERRORS[0]} Warn level WARN
- Check Log Message ${ERRORS[1]} Error level ERROR
- Length Should Be ${ERRORS} 4 # Two deprecation warnings from `repr`.
+ Check Log Message ${tc[0, 1]} Log says: Hello from tests! INFO
+ Check Log Message ${tc[1, 1]} Trace level TRACE
+ Check Log Message ${tc[2, 1]} Debug level DEBUG
+ Check Log Message ${tc[3, 1]} Info level INFO
+ Check Log Message ${tc[4, 1]} Warn level WARN
+ Check Log Message ${tc[5, 1]} Error level ERROR
+ Check Log Message ${ERRORS[0]} Warn level WARN
+ Check Log Message ${ERRORS[1]} Error level ERROR
+ Length Should Be ${ERRORS} 4 # Two deprecation warnings from `repr`.
Invalid log level failure is catchable
Check Test Case ${TEST NAME}
HTML is escaped by default
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} not bold
- Check Log Message ${tc.kws[1].msgs[0]} ${HTML}
+ Check Log Message ${tc[0, 0]} not bold
+ Check Log Message ${tc[1, 0]} ${HTML}
HTML pseudo level
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} bold html=True
- Check Log Message ${tc.kws[1].msgs[0]} ${HTML} html=True
+ Check Log Message ${tc[0, 0]} bold html=True
+ Check Log Message ${tc[1, 0]} ${HTML} html=True
Explicit HTML
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} bold html=True
- Check Log Message ${tc.kws[1].msgs[0]} ${HTML} DEBUG html=True
- Check Log Message ${tc.kws[2].msgs[0]} ${HTML} DEBUG
+ Check Log Message ${tc[0, 0]} bold html=True
+ Check Log Message ${tc[1, 0]} ${HTML} DEBUG html=True
+ Check Log Message ${tc[2, 0]} ${HTML} DEBUG
FAIL is not valid log level
Check Test Case ${TEST NAME}
Log also to console
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Hello, console!
- Check Log Message ${tc.kws[1].msgs[0]} ${HTML} DEBUG html=True
+ Check Log Message ${tc[0, 0]} Hello, console!
+ Check Log Message ${tc[1, 0]} ${HTML} DEBUG html=True
Stdout Should Contain Hello, console!\n
Stdout Should Contain ${HTML}\n
CONSOLE pseudo level
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Hello, info and console!
+ Check Log Message ${tc[0, 0]} Hello, info and console!
Stdout Should Contain Hello, info and console!\n
repr=True
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} The 'repr' argument of 'BuiltIn.Log' is deprecated. Use 'formatter=repr' instead. WARN
- Check Log Message ${tc.kws[0].msgs[1]} Nothing special here
- Check Log Message ${tc.kws[1].msgs[0]} The 'repr' argument of 'BuiltIn.Log' is deprecated. Use 'formatter=repr' instead. WARN
- Check Log Message ${tc.kws[1].msgs[1]} 'Hyvää yötä ☃!'
+ Check Log Message ${tc[0, 0]} The 'repr' argument of 'BuiltIn.Log' is deprecated. Use 'formatter=repr' instead. WARN
+ Check Log Message ${tc[0, 1]} Nothing special here
+ Check Log Message ${tc[1, 0]} The 'repr' argument of 'BuiltIn.Log' is deprecated. Use 'formatter=repr' instead. WARN
+ Check Log Message ${tc[1, 1]} 'Hyvää yötä ☃!'
formatter=repr
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} 'Nothing special here'
- Check Log Message ${tc.kws[1].msgs[0]} 'Hyvää yötä ☃!'
- Check Log Message ${tc.kws[2].msgs[0]} 42 DEBUG
- Check Log Message ${tc.kws[4].msgs[0]} b'\\x00abc\\xff (formatter=repr)'
- Check Log Message ${tc.kws[6].msgs[0]} 'hyvä'
+ Check Log Message ${tc[0, 0]} 'Nothing special here'
+ Check Log Message ${tc[1, 0]} 'Hyvää yötä ☃!'
+ Check Log Message ${tc[2, 0]} 42 DEBUG
+ Check Log Message ${tc[4, 0]} b'\\x00abc\\xff (formatter=repr)'
+ Check Log Message ${tc[6, 0]} 'hyvä'
Stdout Should Contain b'\\x00abc\\xff (formatter=repr)'
formatter=ascii
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} 'Nothing special here'
- Check Log Message ${tc.kws[1].msgs[0]} 'Hyv\\xe4\\xe4 y\\xf6t\\xe4 \\u2603!'
- Check Log Message ${tc.kws[2].msgs[0]} 42 DEBUG
- Check Log Message ${tc.kws[4].msgs[0]} b'\\x00abc\\xff (formatter=ascii)'
- Check Log Message ${tc.kws[6].msgs[0]} 'hyva\\u0308'
+ Check Log Message ${tc[0, 0]} 'Nothing special here'
+ Check Log Message ${tc[1, 0]} 'Hyv\\xe4\\xe4 y\\xf6t\\xe4 \\u2603!'
+ Check Log Message ${tc[2, 0]} 42 DEBUG
+ Check Log Message ${tc[4, 0]} b'\\x00abc\\xff (formatter=ascii)'
+ Check Log Message ${tc[6, 0]} 'hyva\\u0308'
Stdout Should Contain b'\\x00abc\\xff (formatter=ascii)'
formatter=str
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Nothing special here
- Check Log Message ${tc.kws[1].msgs[0]} Hyvää yötä ☃!
- Check Log Message ${tc.kws[2].msgs[0]} 42 DEBUG
- Check Log Message ${tc.kws[4].msgs[0]} abc\\xff (formatter=str)
- Check Log Message ${tc.kws[6].msgs[0]} hyvä
- Stdout Should Contain abc\\xff (formatter=str)
+ Check Log Message ${tc[0, 0]} Nothing special here
+ Check Log Message ${tc[1, 0]} Hyvää yötä ☃!
+ Check Log Message ${tc[2, 0]} 42 DEBUG
+ Check Log Message ${tc[4, 0]} abc\xff (formatter=str)
+ Check Log Message ${tc[6, 0]} hyvä
+ Stdout Should Contain abc\xff (formatter=str)
formatter=repr pretty prints
${tc} = Check Test Case ${TEST NAME}
${long string} = Evaluate ' '.join(['Robot Framework'] * 1000)
${small dict} = Set Variable {'small': 'dict', 3: b'items', 'NOT': 'sorted'}
${small list} = Set Variable ['small', b'list', 'not sorted', 4]
- Check Log Message ${tc.kws[1].msgs[0]} '${long string}'
- Check Log Message ${tc.kws[3].msgs[0]} ${small dict}
- Check Log Message ${tc.kws[5].msgs[0]} {'big': 'dict',\n 'long': '${long string}',\n 'nested': ${small dict},\n 'list': [1, 2, 3],\n 'sorted': False}
- Check Log Message ${tc.kws[7].msgs[0]} ${small list}
- Check Log Message ${tc.kws[9].msgs[0]} ['big',\n 'list',\n '${long string}',\n b'${long string}',\n ['nested', ('tuple', 2)],\n ${small dict}]
- Check Log Message ${tc.kws[11].msgs[0]} ['hyvä', b'hyv\\xe4', {'☃': b'\\x00\\xff'}]
+ Check Log Message ${tc[1, 0]} '${long string}'
+ Check Log Message ${tc[3, 0]} ${small dict}
+ Check Log Message ${tc[5, 0]} {'big': 'dict',\n 'long': '${long string}',\n 'nested': ${small dict},\n 'list': [1, 2, 3],\n 'sorted': False}
+ Check Log Message ${tc[7, 0]} ${small list}
+ Check Log Message ${tc[9, 0]} ['big',\n 'list',\n '${long string}',\n b'${long string}',\n ['nested', ('tuple', 2)],\n ${small dict}]
+ Check Log Message ${tc[11, 0]} ['hyvä', b'hyv\\xe4', {'☃': b'\\x00\\xff'}]
Stdout Should Contain ${small dict}
Stdout Should Contain ${small list}
formatter=len
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} 20
- Check Log Message ${tc.kws[1].msgs[0]} 13 DEBUG
- Check Log Message ${tc.kws[3].msgs[0]} 21
- Check Log Message ${tc.kws[5].msgs[0]} 5
+ Check Log Message ${tc[0, 0]} 20
+ Check Log Message ${tc[1, 0]} 13 DEBUG
+ Check Log Message ${tc[3, 0]} 21
+ Check Log Message ${tc[5, 0]} 5
formatter=type
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} str
- Check Log Message ${tc.kws[1].msgs[0]} str
- Check Log Message ${tc.kws[2].msgs[0]} int DEBUG
- Check Log Message ${tc.kws[4].msgs[0]} bytes
- Check Log Message ${tc.kws[6].msgs[0]} datetime
+ Check Log Message ${tc[0, 0]} str
+ Check Log Message ${tc[1, 0]} str
+ Check Log Message ${tc[2, 0]} int DEBUG
+ Check Log Message ${tc[4, 0]} bytes
+ Check Log Message ${tc[6, 0]} datetime
formatter=invalid
Check Test Case ${TEST NAME}
Log callable
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} *objects_for_call_method.MyObject* pattern=yes
- Check Log Message ${tc.kws[2].msgs[0]} at *> pattern=yes
+ Check Log Message ${tc[0, 0]} *objects_for_call_method.MyObject* pattern=yes
+ Check Log Message ${tc[2, 0]} at *> pattern=yes
Log Many
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Log Many says:
- Check Log Message ${tc.kws[0].msgs[1]} 1
- Check Log Message ${tc.kws[0].msgs[2]} 2
- Check Log Message ${tc.kws[0].msgs[3]} 3
- Check Log Message ${tc.kws[0].msgs[4]} String presentation of MyObject
- Check Log Message ${tc.kws[1].msgs[0]} Log Many says: Hi!!
- Check Log Message ${tc.kws[2].msgs[0]} 1
- Check Log Message ${tc.kws[2].msgs[1]} 2
- Check Log Message ${tc.kws[2].msgs[2]} 3
- Check Log Message ${tc.kws[2].msgs[3]} String presentation of MyObject
- Should Be Empty ${tc.kws[3].msgs}
- Should Be Empty ${tc.kws[4].msgs}
- Check Log Message ${tc.kws[5].msgs[0]} --
- Check Log Message ${tc.kws[5].msgs[1]} -[]-
- Check Log Message ${tc.kws[5].msgs[2]} -{}-
- Check Log Message ${tc.kws[6].msgs[0]} 1
- Check Log Message ${tc.kws[6].msgs[1]} 2
+ Check Log Message ${tc[0, 0]} Log Many says:
+ Check Log Message ${tc[0, 1]} 1
+ Check Log Message ${tc[0, 2]} 2
+ Check Log Message ${tc[0, 3]} 3
+ Check Log Message ${tc[0, 4]} String presentation of MyObject
+ Check Log Message ${tc[1, 0]} Log Many says: Hi!!
+ Check Log Message ${tc[2, 0]} 1
+ Check Log Message ${tc[2, 1]} 2
+ Check Log Message ${tc[2, 2]} 3
+ Check Log Message ${tc[2, 3]} String presentation of MyObject
+ Should Be Empty ${tc[3].body}
+ Should Be Empty ${tc[4].body}
+ Check Log Message ${tc[5, 0]} preserve
+ Check Log Message ${tc[5, 1]} ${EMPTY}
+ Check Log Message ${tc[5, 2]} empty
+ Check Log Message ${tc[5, 3]} ${EMPTY}
+ Check Log Message ${tc[6, 0]} --
+ Check Log Message ${tc[6, 1]} -[]-
+ Check Log Message ${tc[6, 2]} -{}-
+ Check Log Message ${tc[7, 0]} 1
+ Check Log Message ${tc[7, 1]} 2
Log Many with named and dict arguments
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} a=1
- Check Log Message ${tc.kws[0].msgs[1]} b=2
- Check Log Message ${tc.kws[0].msgs[2]} 3=c
- Check Log Message ${tc.kws[0].msgs[3]} obj=String presentation of MyObject
- Check Log Message ${tc.kws[1].msgs[0]} a=1
- Check Log Message ${tc.kws[1].msgs[1]} b=2
- Check Log Message ${tc.kws[1].msgs[2]} 3=c
- Check Log Message ${tc.kws[1].msgs[3]} obj=String presentation of MyObject
- Check Log Message ${tc.kws[2].msgs[0]} a=1
- Check Log Message ${tc.kws[2].msgs[1]} b=2
- Check Log Message ${tc.kws[2].msgs[2]} 3=c
- Check Log Message ${tc.kws[2].msgs[3]} obj=String presentation of MyObject
- Check Log Message ${tc.kws[2].msgs[4]} b=no override
- Check Log Message ${tc.kws[2].msgs[5]} 3=three
+ Check Log Message ${tc[0, 0]} a=1
+ Check Log Message ${tc[0, 1]} b=2
+ Check Log Message ${tc[0, 2]} 3=c
+ Check Log Message ${tc[0, 3]} obj=String presentation of MyObject
+ Check Log Message ${tc[1, 0]} a=1
+ Check Log Message ${tc[1, 1]} b=2
+ Check Log Message ${tc[1, 2]} 3=c
+ Check Log Message ${tc[1, 3]} obj=String presentation of MyObject
+ Check Log Message ${tc[2, 0]} a=1
+ Check Log Message ${tc[2, 1]} b=2
+ Check Log Message ${tc[2, 2]} 3=c
+ Check Log Message ${tc[2, 3]} obj=String presentation of MyObject
+ Check Log Message ${tc[2, 4]} b=no override
+ Check Log Message ${tc[2, 5]} 3=three
Log Many with positional, named and dict arguments
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} 1
- Check Log Message ${tc.kws[0].msgs[1]} 2
- Check Log Message ${tc.kws[0].msgs[2]} three=3
- Check Log Message ${tc.kws[0].msgs[3]} 4=four
- Check Log Message ${tc.kws[1].msgs[0]} 1
- Check Log Message ${tc.kws[1].msgs[1]} 2
- Check Log Message ${tc.kws[1].msgs[2]} 3
- Check Log Message ${tc.kws[1].msgs[3]} String presentation of MyObject
- Check Log Message ${tc.kws[1].msgs[4]} a=1
- Check Log Message ${tc.kws[1].msgs[5]} b=2
- Check Log Message ${tc.kws[1].msgs[6]} 3=c
- Check Log Message ${tc.kws[1].msgs[7]} obj=String presentation of MyObject
- Check Log Message ${tc.kws[1].msgs[8]} 1
- Check Log Message ${tc.kws[1].msgs[9]} 2
- Check Log Message ${tc.kws[1].msgs[10]} 3
- Check Log Message ${tc.kws[1].msgs[11]} String presentation of MyObject
- Check Log Message ${tc.kws[1].msgs[12]} a=1
- Check Log Message ${tc.kws[1].msgs[13]} b=2
- Check Log Message ${tc.kws[1].msgs[14]} 3=c
- Check Log Message ${tc.kws[1].msgs[15]} obj=String presentation of MyObject
+ Check Log Message ${tc[0, 0]} 1
+ Check Log Message ${tc[0, 1]} 2
+ Check Log Message ${tc[0, 2]} three=3
+ Check Log Message ${tc[0, 3]} 4=four
+ Check Log Message ${tc[1, 0]} 1
+ Check Log Message ${tc[1, 1]} 2
+ Check Log Message ${tc[1, 2]} 3
+ Check Log Message ${tc[1, 3]} String presentation of MyObject
+ Check Log Message ${tc[1, 4]} a=1
+ Check Log Message ${tc[1, 5]} b=2
+ Check Log Message ${tc[1, 6]} 3=c
+ Check Log Message ${tc[1, 7]} obj=String presentation of MyObject
+ Check Log Message ${tc[1, 8]} 1
+ Check Log Message ${tc[1, 9]} 2
+ Check Log Message ${tc[1, 10]} 3
+ Check Log Message ${tc[1, 11]} String presentation of MyObject
+ Check Log Message ${tc[1, 12]} a=1
+ Check Log Message ${tc[1, 13]} b=2
+ Check Log Message ${tc[1, 14]} 3=c
+ Check Log Message ${tc[1, 15]} obj=String presentation of MyObject
Log Many with non-existing variable
Check Test Case ${TEST NAME}
@@ -202,7 +206,7 @@ Log Many with dict variable containing non-dict
Log To Console
${tc} = Check Test Case ${TEST NAME}
FOR ${i} IN RANGE 4
- Should Be Empty ${tc.kws[${i}].msgs}
+ Should Be Empty ${tc[${i}].body}
END
Stdout Should Contain stdout äö w/ newline\n
Stdout Should Contain stdout äö w/o new......line äö
diff --git a/atest/robot/standard_libraries/builtin/log_variables.robot b/atest/robot/standard_libraries/builtin/log_variables.robot
index e1cfe47a2d8..3d58d5affbb 100644
--- a/atest/robot/standard_libraries/builtin/log_variables.robot
+++ b/atest/robot/standard_libraries/builtin/log_variables.robot
@@ -5,7 +5,7 @@ Resource atest_resource.robot
*** Test Cases ***
Log Variables In Suite Setup
- Set Test Variable ${KW} ${SUITE.setup.body[7]}
+ Set Test Variable ${KW} ${SUITE.setup[7]}
Set Test Variable ${INDEX} ${0}
Check Variable Message \${/} = * pattern=yes
Check Variable Message \${:} = ${:}
@@ -24,7 +24,7 @@ Log Variables In Suite Setup
Check Variable Message \${LOG_LEVEL} = INFO
Check Variable Message \${None} = None
Check Variable Message \${null} = None
- Check Variable Message \&{OPTIONS} = { include=[] | exclude=[] | skip=[] | skip_on_failure=[] }
+ Check Variable Message \&{OPTIONS} = { rpa=False | include=[] | exclude=[] | skip=[] | skip_on_failure=[] | console_width=78 }
Check Variable Message \${OUTPUT_DIR} = * pattern=yes
Check Variable Message \${OUTPUT_FILE} = * pattern=yes
Check Variable Message \${PREV_TEST_MESSAGE} =
@@ -48,7 +48,7 @@ Log Variables In Suite Setup
Log Variables In Test
${test} = Check Test Case Log Variables
- Set Test Variable ${KW} ${test.body[0]}
+ Set Test Variable ${KW} ${test[0]}
Set Test Variable ${INDEX} ${1}
Check Variable Message \${/} = * pattern=yes
Check Variable Message \${:} = ${:}
@@ -67,7 +67,7 @@ Log Variables In Test
Check Variable Message \${LOG_LEVEL} = TRACE
Check Variable Message \${None} = None
Check Variable Message \${null} = None
- Check Variable Message \&{OPTIONS} = { include=[] | exclude=[] | skip=[] | skip_on_failure=[] }
+ Check Variable Message \&{OPTIONS} = { rpa=False | include=[] | exclude=[] | skip=[] | skip_on_failure=[] | console_width=78 }
Check Variable Message \${OUTPUT_DIR} = * pattern=yes
Check Variable Message \${OUTPUT_FILE} = * pattern=yes
Check Variable Message \${PREV_TEST_MESSAGE} =
@@ -93,7 +93,7 @@ Log Variables In Test
Log Variables After Setting New Variables
${test} = Check Test Case Log Variables
- Set Test Variable ${KW} ${test.body[4]}
+ Set Test Variable ${KW} ${test[4]}
Set Test Variable ${INDEX} ${1}
Check Variable Message \${/} = * DEBUG pattern=yes
Check Variable Message \${:} = ${:} DEBUG
@@ -114,7 +114,7 @@ Log Variables After Setting New Variables
Check Variable Message \${LOG_LEVEL} = TRACE DEBUG
Check Variable Message \${None} = None DEBUG
Check Variable Message \${null} = None DEBUG
- Check Variable Message \&{OPTIONS} = { include=[] | exclude=[] | skip=[] | skip_on_failure=[] } DEBUG
+ Check Variable Message \&{OPTIONS} = { rpa=False | include=[] | exclude=[] | skip=[] | skip_on_failure=[] | console_width=78 } DEBUG
Check Variable Message \${OUTPUT_DIR} = * DEBUG pattern=yes
Check Variable Message \${OUTPUT_FILE} = * DEBUG pattern=yes
Check Variable Message \${PREV_TEST_MESSAGE} = DEBUG
@@ -141,7 +141,7 @@ Log Variables After Setting New Variables
Log Variables In User Keyword
${test} = Check Test Case Log Variables
- Set Test Variable ${KW} ${test.body[5].body[2]}
+ Set Test Variable ${KW} ${test[5, 2]}
Set Test Variable ${INDEX} ${1}
Check Variable Message \${/} = * pattern=yes
Check Variable Message \${:} = ${:}
@@ -160,7 +160,7 @@ Log Variables In User Keyword
Check Variable Message \${LOG_LEVEL} = TRACE
Check Variable Message \${None} = None
Check Variable Message \${null} = None
- Check Variable Message \&{OPTIONS} = { include=[] | exclude=[] | skip=[] | skip_on_failure=[] }
+ Check Variable Message \&{OPTIONS} = { rpa=False | include=[] | exclude=[] | skip=[] | skip_on_failure=[] | console_width=78 }
Check Variable Message \${OUTPUT_DIR} = * pattern=yes
Check Variable Message \${OUTPUT_FILE} = * pattern=yes
Check Variable Message \${PREV_TEST_MESSAGE} =
@@ -191,5 +191,5 @@ List and dict variables failing during iteration
*** Keywords ***
Check Variable Message
[Arguments] ${expected} ${level}=INFO ${pattern}=
- Check Log Message ${KW.msgs[${INDEX}]} ${expected} ${level} pattern=${pattern}
+ Check Log Message ${KW[${INDEX}]} ${expected} ${level} pattern=${pattern}
Set Test Variable ${INDEX} ${INDEX + 1}
diff --git a/atest/robot/standard_libraries/builtin/misc.robot b/atest/robot/standard_libraries/builtin/misc.robot
index 38994c9afac..a7af9cba20c 100644
--- a/atest/robot/standard_libraries/builtin/misc.robot
+++ b/atest/robot/standard_libraries/builtin/misc.robot
@@ -11,9 +11,9 @@ Catenate
Comment
${tc} = Check Test Case ${TEST NAME}
- Should Be Empty ${tc.kws[0].msgs}
- Should Be Empty ${tc.kws[1].msgs}
- Should Be Empty ${tc.kws[2].msgs}
+ Should Be Empty ${tc[0].body}
+ Should Be Empty ${tc[1].body}
+ Should Be Empty ${tc[2].body}
Regexp Escape
Check Test Case ${TEST NAME}
diff --git a/atest/robot/standard_libraries/builtin/reload_library.robot b/atest/robot/standard_libraries/builtin/reload_library.robot
index 25cb84aad6a..97bf6e4d58e 100644
--- a/atest/robot/standard_libraries/builtin/reload_library.robot
+++ b/atest/robot/standard_libraries/builtin/reload_library.robot
@@ -5,12 +5,12 @@ Resource atest_resource.robot
*** Test Cases ***
Reload and add keyword
${tc}= Check Test Case ${TESTNAME}
- Check log message ${tc.kws[2].msgs[0]} Reloaded library Reloadable with 7 keywords.
+ Check log message ${tc[2, 0]} Reloaded library Reloadable with 7 keywords.
Reloading changes args
${tc}= Check Test Case ${TESTNAME}
- Should be equal ${tc.kws[0].doc} Doc for original 1 with args arg
- Should be equal ${tc.kws[3].doc} Doc for original 1 with args arg1, arg2
+ Should be equal ${tc[0].doc} Doc for original 1 with args arg
+ Should be equal ${tc[3].doc} Doc for original 1 with args arg1, arg2
Reloading can remove a keyword
Check Test Case ${TESTNAME}
@@ -32,8 +32,8 @@ Reloading None fails
Static library
${tc}= Check Test Case ${TESTNAME}
- Should be equal ${tc.kws[2].doc} This doc for static
+ Should be equal ${tc[2].doc} This doc for static
Module library
${tc}= Check Test Case ${TESTNAME}
- Should be equal ${tc.kws[3].doc} This doc for module
+ Should be equal ${tc[3].doc} This doc for module
diff --git a/atest/robot/standard_libraries/builtin/reload_with_name.robot b/atest/robot/standard_libraries/builtin/reload_with_name.robot
index 7b04683ff74..dcabc6ea7f6 100644
--- a/atest/robot/standard_libraries/builtin/reload_with_name.robot
+++ b/atest/robot/standard_libraries/builtin/reload_with_name.robot
@@ -5,7 +5,7 @@ Resource atest_resource.robot
*** Test Cases ***
Reload with name
${tc}= Check Test Case ${TESTNAME}
- Check log message ${tc.kws[1].msgs[0]} Reloaded library foo with 7 keywords.
+ Check log message ${tc[1, 0]} Reloaded library foo with 7 keywords.
Reload with instance
Check Test Case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/builtin/repeat_keyword.robot b/atest/robot/standard_libraries/builtin/repeat_keyword.robot
index 5c0e3ea1e9e..b4cfbae94c2 100644
--- a/atest/robot/standard_libraries/builtin/repeat_keyword.robot
+++ b/atest/robot/standard_libraries/builtin/repeat_keyword.robot
@@ -5,27 +5,27 @@ Resource atest_resource.robot
*** Test Cases ***
Times As String
${tc} = Check Test Case ${TEST NAME}
- Check Repeated Messages ${tc.kws[0]} 2 Hello, repeating world!
+ Check Repeated Messages ${tc[0]} 2 Hello, repeating world!
Times As Integer
${tc} = Check Test Case ${TEST NAME}
- Check Repeated Messages ${tc.kws[0]} 42 This works too!!
+ Check Repeated Messages ${tc[0]} 42 This works too!!
Times With 'times' Postfix
${tc} = Check Test Case ${TEST NAME}
- Check Repeated Messages ${tc.kws[0]} 3 This is done 3 times
- Check Repeated Messages ${tc.kws[1]} 2 Case and space insensitive
+ Check Repeated Messages ${tc[0]} 3 This is done 3 times
+ Check Repeated Messages ${tc[1]} 2 Case and space insensitive
Times With 'x' Postfix
${tc} = Check Test Case ${TEST NAME}
- Check Repeated Messages ${tc.kws[0]} 10 Close to old repeating syntax
- Check Repeated Messages ${tc.kws[1]} 1 Case and space
+ Check Repeated Messages ${tc[0]} 10 Close to old repeating syntax
+ Check Repeated Messages ${tc[1]} 1 Case and space
Zero And Negative Times
${tc} = Check Test Case ${TEST NAME}
- Check Repeated Messages ${tc.kws[0]} 0 name=This is not executed
- Check Repeated Messages ${tc.kws[2]} 0 name=\${name}
- Check Repeated Messages ${tc.kws[3]} 0 name=This is not executed
+ Check Repeated Messages ${tc[0]} 0 name=This is not executed
+ Check Repeated Messages ${tc[2]} 0 name=\${name}
+ Check Repeated Messages ${tc[3]} 0 name=This is not executed
Invalid Times
Check Test Case Invalid Times 1
@@ -33,16 +33,16 @@ Invalid Times
Repeat Keyword With Time String
${tc} = Check Test Case ${TEST NAME}
- Check Repeated Messages With Time ${tc.kws[0]} This is done for 00:00:00.003
- Check Repeated Messages With Time ${tc.kws[1]} This is done for 3 milliseconds
- Check Repeated Messages With Time ${tc.kws[2]} This is done for 3ms
+ Check Repeated Messages With Time ${tc[0]} This is done for 00:00:00.003
+ Check Repeated Messages With Time ${tc[1]} This is done for 3 milliseconds
+ Check Repeated Messages With Time ${tc[2]} This is done for 3ms
Repeat Keyword Arguments As Variables
${tc} = Check Test Case ${TEST_NAME}
- Check Repeated Keyword Name ${tc.kws[1]} 2 BuiltIn.Should Be Equal
- Check Repeated Keyword Name ${tc.kws[3]} 42 BuiltIn.Should Be Equal
- Check Repeated Keyword Name ${tc.kws[5]} 10 BuiltIn.No Operation
- Check Repeated Keyword Name ${tc.kws[7]} 1 BuiltIn.Should Be Equal
+ Check Repeated Keyword Name ${tc[1]} 2 BuiltIn.Should Be Equal
+ Check Repeated Keyword Name ${tc[3]} 42 BuiltIn.Should Be Equal
+ Check Repeated Keyword Name ${tc[5]} 10 BuiltIn.No Operation
+ Check Repeated Keyword Name ${tc[7]} 1 BuiltIn.Should Be Equal
Repeated Keyword As Non-existing Variable
Check Test Case ${TEST_NAME}
@@ -56,47 +56,52 @@ Repeated Keyword Failing
Repeat Keyword With Continuable Failure
${tc} = Check Test Case ${TEST_NAME}
- Length Should Be ${tc.kws[0].kws} 3
+ Length Should Be ${tc[0].body} 6
+ Length Should Be ${tc[0].messages} 3
Repeat Keyword With Failure After Continuable Failure
${tc} = Check Test Case ${TEST_NAME}
- Length Should Be ${tc.kws[0].kws} 2
+ Length Should Be ${tc[0].body} 4
+ Length Should Be ${tc[0].messages} 2
Repeat Keyword With Pass Execution
${tc} = Check Test Case ${TEST_NAME}
- Length Should Be ${tc.kws[0].kws} 1
+ Length Should Be ${tc[0].body} 2
+ Length Should Be ${tc[0].messages} 1
Repeat Keyword With Pass Execution After Continuable Failure
${tc} = Check Test Case ${TEST_NAME}
- Length Should Be ${tc.kws[0].kws} 2
+ Length Should Be ${tc[0].body} 4
+ Length Should Be ${tc[0].messages} 2
*** Keywords ***
Check Repeated Messages
- [Arguments] ${kw} ${count} ${msg}= ${name}=
- Length Should Be ${kw.kws} ${count}
- FOR ${i} IN RANGE ${count}
- Check Log Message ${kw.msgs[${i}]} Repeating keyword, round ${i+1}/${count}.
- Check Log Message ${kw.kws[${i}].msgs[0]} ${msg}
- END
- IF ${count} != 0
- Length Should Be ${kw.msgs} ${count}
+ [Arguments] ${kw} ${rounds} ${msg}= ${name}=
+ IF ${rounds} == 0
+ Length Should Be ${kw.body} 1
+ Check Log Message ${kw[0]} Keyword '${name}' repeated zero times.
ELSE
- Check Log Message ${kw.msgs[0]} Keyword '${name}' repeated zero times.
+ Length Should Be ${kw.body} ${{int($rounds) * 2}}
+ Length Should Be ${kw.messages} ${rounds}
+ END
+ FOR ${i} IN RANGE ${rounds}
+ Check Log Message ${kw[${i * 2}]} Repeating keyword, round ${i+1}/${rounds}.
+ Check Log Message ${kw[${i * 2 + 1}, 0]} ${msg}
END
Check Repeated Messages With Time
[Arguments] ${kw} ${msg}=${None}
- Should Not Be Empty ${kw.kws}
- FOR ${i} IN RANGE ${{len($kw.kws)}}
- Check Log Message ${kw.msgs[${i}]}
+ Should Be True len($kw.body) / 2 == len($kw.messages) and len($kw.body) > 0
+ FOR ${i} IN RANGE ${{len($kw.messages)}}
+ Check Log Message ${kw[${i * 2}]}
... Repeating keyword, round ${i+1}, *remaining. pattern=yes
- Check Log Message ${kw.kws[${i}].msgs[0]} ${msg}
+ Check Log Message ${kw[${i * 2 + 1}, 0]} ${msg}
END
- Should Be Equal ${{len($kw.msgs)}} ${{len($kw.kws)}}
+ Should Be Equal ${{len($kw.messages) * 2}} ${{len($kw.body)}}
Check Repeated Keyword Name
[Arguments] ${kw} ${count} ${name}=${None}
- Length Should Be ${kw.kws} ${count}
- FOR ${i} IN RANGE ${count}
- Should Be Equal ${kw.kws[${i}].full_name} ${name}
+ Should Be True len($kw.body) / 2 == len($kw.messages) == ${count}
+ FOR ${i} IN RANGE 1 ${count} * 2 2
+ Should Be Equal ${kw[${i}].full_name} ${name}
END
diff --git a/atest/robot/standard_libraries/builtin/run_keyword.robot b/atest/robot/standard_libraries/builtin/run_keyword.robot
index a887910bc04..faa8580d011 100644
--- a/atest/robot/standard_libraries/builtin/run_keyword.robot
+++ b/atest/robot/standard_libraries/builtin/run_keyword.robot
@@ -4,80 +4,80 @@ Resource atest_resource.robot
*** Test Cases ***
Run Keyword
- ${tc} = Check test Case ${TEST NAME}
- Check Run Keyword ${tc.kws[0]} BuiltIn.Log This is logged with Run Keyword
- Check Keyword Data ${tc.kws[1].kws[0]} BuiltIn.No Operation
- Check Run Keyword ${tc.kws[2]} BuiltIn.Log Many 1 2 3 4 5
- Check Run Keyword ${tc.kws[4]} BuiltIn.Log Run keyword with variable: Log
- Check Run Keyword ${tc.kws[6]} BuiltIn.Log Many one two
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Run Keyword ${tc[0]} BuiltIn.Log This is logged with Run Keyword
+ Check Keyword Data ${tc[1, 0]} BuiltIn.No Operation
+ Check Run Keyword ${tc[2]} BuiltIn.Log Many 1 2 3 4 5
+ Check Run Keyword ${tc[4]} BuiltIn.Log Run keyword with variable: Log
+ Check Run Keyword ${tc[6]} BuiltIn.Log Many one two
Run Keyword Returning Value
- ${tc} = Check test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0]} BuiltIn.Run Keyword \${ret} Set Variable, hello world
- Check Keyword Data ${tc.kws[0].kws[0]} BuiltIn.Set Variable args=hello world
- Check Keyword Data ${tc.kws[2]} BuiltIn.Run Keyword \${ret} Evaluate, 1+2
- Check Keyword Data ${tc.kws[2].kws[0]} BuiltIn.Evaluate args=1+2
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Keyword Data ${tc[0]} BuiltIn.Run Keyword \${ret} Set Variable, hello world
+ Check Keyword Data ${tc[0, 0]} BuiltIn.Set Variable args=hello world
+ Check Keyword Data ${tc[2]} BuiltIn.Run Keyword \${ret} Evaluate, 1+2
+ Check Keyword Data ${tc[2, 0]} BuiltIn.Evaluate args=1+2
Run Keyword With Arguments That Needs To Be Escaped
- ${tc} = Check test Case ${TEST NAME}
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} c:\\temp\\foo
- Check Log Message ${tc.kws[1].kws[0].msgs[1]} \${notvar}
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Log Message ${tc[1, 0, 0]} c:\\temp\\foo
+ Check Log Message ${tc[1, 0, 1]} \${notvar}
Escaping Arguments From Opened List Variable
- ${tc} = Check test Case ${TEST NAME}
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} message=foo
- Check Log Message ${tc.kws[3].kws[0].msgs[0]} 42
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Log Message ${tc[1, 0, 0]} message=foo
+ Check Log Message ${tc[3, 0, 0]} 42
Run Keyword With UK
- ${tc} = Check test Case ${TEST NAME}
- Check Run Keyword In UK ${tc.kws[0]} BuiltIn.Log Using UK
- Check Run Keyword In UK ${tc.kws[1]} BuiltIn.Log Many yksi kaksi
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Run Keyword In UK ${tc[0]} BuiltIn.Log Using UK
+ Check Run Keyword In UK ${tc[1]} BuiltIn.Log Many yksi kaksi
Run Keyword In Multiple Levels And With UK
- Check test Case ${TEST NAME}
+ Check Test Case ${TEST NAME}
With keyword accepting embedded arguments
- ${tc} = Check test Case ${TEST NAME}
- Check Run Keyword With Embedded Args ${tc.kws[0]} Embedded "arg" arg
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Run Keyword With Embedded Args ${tc[0]} Embedded "arg" arg
With library keyword accepting embedded arguments
- ${tc} = Check test Case ${TEST NAME}
- Check Run Keyword With Embedded Args ${tc.kws[0]} Embedded "arg" in library arg
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Run Keyword With Embedded Args ${tc[0]} Embedded "arg" in library arg
With keyword accepting embedded arguments as variables
- ${tc} = Check test Case ${TEST NAME}
- Check Run Keyword With Embedded Args ${tc.kws[0]} Embedded "\${VARIABLE}" value
- Check Run Keyword With Embedded Args ${tc.kws[1]} Embedded "\${1}" 1
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Run Keyword With Embedded Args ${tc[0]} Embedded "\${VARIABLE}" value
+ Check Run Keyword With Embedded Args ${tc[1]} Embedded "\${1}" 1
With library keyword accepting embedded arguments as variables
- ${tc} = Check test Case ${TEST NAME}
- Check Run Keyword With Embedded Args ${tc.kws[0]} Embedded "\${VARIABLE}" in library value
- Check Run Keyword With Embedded Args ${tc.kws[1]} Embedded "\${1}" in library 1
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Run Keyword With Embedded Args ${tc[0]} Embedded "\${VARIABLE}" in library value
+ Check Run Keyword With Embedded Args ${tc[1]} Embedded "\${1}" in library 1
With keyword accepting embedded arguments as variables containing objects
- ${tc} = Check test Case ${TEST NAME}
- Check Run Keyword With Embedded Args ${tc.kws[0]} Embedded "\${OBJECT}" Robot
- Check Run Keyword With Embedded Args ${tc.kws[1]} Embedded object "\${OBJECT}" Robot
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Run Keyword With Embedded Args ${tc[0]} Embedded "\${OBJECT}" Robot
+ Check Run Keyword With Embedded Args ${tc[1]} Embedded object "\${OBJECT}" Robot
With library keyword accepting embedded arguments as variables containing objects
- ${tc} = Check test Case ${TEST NAME}
- Check Run Keyword With Embedded Args ${tc.kws[0]} Embedded "\${OBJECT}" in library Robot
- Check Run Keyword With Embedded Args ${tc.kws[1]} Embedded object "\${OBJECT}" in library Robot
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Run Keyword With Embedded Args ${tc[0]} Embedded "\${OBJECT}" in library Robot
+ Check Run Keyword With Embedded Args ${tc[1]} Embedded object "\${OBJECT}" in library Robot
Run Keyword In For Loop
- ${tc} = Check test Case ${TEST NAME}
- Check Run Keyword ${tc.kws[0].kws[0].kws[0]} BuiltIn.Log hello from for loop
- Check Run Keyword In UK ${tc.kws[0].kws[2].kws[0]} BuiltIn.Log hei maailma
- Check Run Keyword ${tc.kws[1].kws[0].kws[0]} BuiltIn.Log hello from second for loop
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Run Keyword ${tc[0, 0, 0]} BuiltIn.Log hello from for loop
+ Check Run Keyword In UK ${tc[0, 2, 0]} BuiltIn.Log hei maailma
+ Check Run Keyword ${tc[1, 0, 0]} BuiltIn.Log hello from second for loop
Run Keyword With Test Timeout
Check Test Case ${TEST NAME} Passing
${tc} = Check Test Case ${TEST NAME} Exceeded
- Check Run Keyword ${tc.kws[0]} BuiltIn.Log Before Timeout
+ Check Run Keyword ${tc[0]} BuiltIn.Log Before Timeout
Run Keyword With KW Timeout
- Check test Case ${TEST NAME} Passing
- Check test Case ${TEST NAME} Exceeded
+ Check Test Case ${TEST NAME} Passing
+ Check Test Case ${TEST NAME} Exceeded
Run Keyword With Invalid Keyword Name
Check Test Case ${TEST NAME}
@@ -97,27 +97,27 @@ Stdout and stderr are not captured when running Run Keyword
*** Keywords ***
Check Run Keyword
- [Arguments] ${kw} ${subkw_name} @{msgs}
- Should Be Equal ${kw.full_name} BuiltIn.Run Keyword
- Should Be Equal ${kw.kws[0].full_name} ${subkw_name}
+ [Arguments] ${kw} ${name} @{msgs}
+ Should Be Equal ${kw.full_name} BuiltIn.Run Keyword
+ Should Be Equal ${kw[0].full_name} ${name}
FOR ${index} ${msg} IN ENUMERATE @{msgs}
- Check Log Message ${kw.kws[0].msgs[${index}]} ${msg}
+ Check Log Message ${kw[0, ${index}]} ${msg}
END
Check Run Keyword In Uk
[Arguments] ${kw} ${subkw_name} @{msgs}
- Should Be Equal ${kw.full_name} BuiltIn.Run Keyword
- Should Be Equal ${kw.kws[0].full_name} My UK
- Check Run Keyword ${kw.kws[0].kws[0]} ${subkw_name} @{msgs}
+ Should Be Equal ${kw.full_name} BuiltIn.Run Keyword
+ Should Be Equal ${kw[0].full_name} My UK
+ Check Run Keyword ${kw[0, 0]} ${subkw_name} @{msgs}
Check Run Keyword With Embedded Args
[Arguments] ${kw} ${subkw_name} ${msg}
Should Be Equal ${kw.full_name} BuiltIn.Run Keyword
IF ${subkw_name.endswith('library')}
- Should Be Equal ${kw.kws[0].full_name} embedded_args.${subkw_name}
- Check Log Message ${kw.kws[0].msgs[0]} ${msg}
+ Should Be Equal ${kw[0].full_name} embedded_args.${subkw_name}
+ Check Log Message ${kw[0, 0]} ${msg}
ELSE
- Should Be Equal ${kw.kws[0].full_name} ${subkw_name}
- Should Be Equal ${kw.kws[0].kws[0].full_name} BuiltIn.Log
- Check Log Message ${kw.kws[0].kws[0].msgs[0]} ${msg}
+ Should Be Equal ${kw[0].full_name} ${subkw_name}
+ Should Be Equal ${kw[0, 0].full_name} BuiltIn.Log
+ Check Log Message ${kw[0, 0, 0]} ${msg}
END
diff --git a/atest/robot/standard_libraries/builtin/run_keyword_and_continue_on_failure.robot b/atest/robot/standard_libraries/builtin/run_keyword_and_continue_on_failure.robot
index 3f83802c905..2af70af225d 100644
--- a/atest/robot/standard_libraries/builtin/run_keyword_and_continue_on_failure.robot
+++ b/atest/robot/standard_libraries/builtin/run_keyword_and_continue_on_failure.robot
@@ -5,16 +5,16 @@ Resource atest_resource.robot
*** Test Cases ***
Run Keyword And Continue On Failure
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} Expected Failure FAIL
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} Expected Failure 2 FAIL
- Check Log Message ${tc.kws[2].msgs[0]} This should be executed
+ Check Log Message ${tc[0, 0, 0]} Expected Failure FAIL
+ Check Log Message ${tc[1, 0, 0]} Expected Failure 2 FAIL
+ Check Log Message ${tc[2, 0]} This should be executed
Run Keyword And Continue On Failure In For Loop
Check Test Case ${TESTNAME}
Run User keyword And Continue On Failure
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[1].msgs[0]} This should be executed
+ Check Log Message ${tc[1, 0]} This should be executed
Run Keyword And Continue On Failure With For Loops
Check Test Case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/builtin/run_keyword_and_return.robot b/atest/robot/standard_libraries/builtin/run_keyword_and_return.robot
index b0fbeccc939..9e345446a7f 100644
--- a/atest/robot/standard_libraries/builtin/run_keyword_and_return.robot
+++ b/atest/robot/standard_libraries/builtin/run_keyword_and_return.robot
@@ -5,15 +5,15 @@ Resource atest_resource.robot
*** Test Cases ***
Return one value
${tc} = Check Test Case ${TESTNAME}
- Check log message ${tc.kws[0].kws[0].msgs[0]} Returning from the enclosing user keyword.
+ Check Log Message ${tc[0, 0, 1]} Returning from the enclosing user keyword.
Return multiple values
Check Test Case ${TESTNAME}
Return nothing
${tc} = Check Test Case ${TESTNAME}
- Check log message ${tc.kws[0].kws[0].kws[0].msgs[0]} No return value
- Check log message ${tc.kws[0].kws[0].msgs[0]} Returning from the enclosing user keyword.
+ Check Log Message ${tc[0, 0, 0, 0]} No return value
+ Check Log Message ${tc[0, 0, 1]} Returning from the enclosing user keyword.
Nested usage
Check Test Case ${TESTNAME}
@@ -23,13 +23,13 @@ Keyword fails
Inside Run Keyword variants
${tc} = Check Test Case ${TESTNAME}
- Check log message ${tc.kws[2].kws[0].kws[0].msgs[0]} First keyword
- Check log message ${tc.kws[2].kws[0].kws[2].msgs[0]} Returning from the enclosing user keyword.
+ Check Log Message ${tc[2, 0, 0, 0]} First keyword
+ Check Log Message ${tc[2, 0, 2, 1]} Returning from the enclosing user keyword.
Using Run Keyword variants
${tc} = Check Test Case ${TESTNAME}
- Check log message ${tc.kws[2].kws[0].kws[0].kws[1].msgs[0]} Second keyword
- Check log message ${tc.kws[2].kws[0].kws[0].kws[2].msgs[0]} Returning from the enclosing user keyword.
+ Check Log Message ${tc[2, 0, 0, 1, 0]} Second keyword
+ Check Log Message ${tc[2, 0, 0, 2, 1]} Returning from the enclosing user keyword.
Outside user keyword
Check Test Case ${TESTNAME}
@@ -42,9 +42,9 @@ Return strings that needs to be escaped
Run Keyword And Return If
${tc} = Check Test Case ${TESTNAME}
- Check log message ${tc.kws[0].kws[1].msgs[0]} Returning from the enclosing user keyword.
- Check log message ${tc.kws[2].kws[1].msgs[0]} Returning from the enclosing user keyword.
- Check log message ${tc.kws[4].kws[0].kws[2].kws[0].msgs[0]} Returning from the enclosing user keyword.
+ Check Log Message ${tc[0, 1, 1]} Returning from the enclosing user keyword.
+ Check Log Message ${tc[2, 1, 1]} Returning from the enclosing user keyword.
+ Check Log Message ${tc[4, 0, 2, 0, 1]} Returning from the enclosing user keyword.
Run Keyword And Return If can have non-existing keywords and variables if condition is not true
Check Test Case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/builtin/run_keyword_and_warn_on_failure.robot b/atest/robot/standard_libraries/builtin/run_keyword_and_warn_on_failure.robot
index 721feb89810..442c10ac1c5 100644
--- a/atest/robot/standard_libraries/builtin/run_keyword_and_warn_on_failure.robot
+++ b/atest/robot/standard_libraries/builtin/run_keyword_and_warn_on_failure.robot
@@ -5,16 +5,16 @@ Resource atest_resource.robot
*** Test Cases ***
Run Keyword And Warn On Failure
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Executing keyword 'FAIL' failed:\nExpected Warn WARN
+ Check Log Message ${tc[0, 1]} Executing keyword 'FAIL' failed:\nExpected Warn WARN
Run Keyword And Warn On Failure For Keyword Teardown
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]}
+ Check Log Message ${tc[0, 1]}
... Executing keyword 'Failing Keyword Teardown' failed:\nKeyword teardown failed:\nExpected WARN
Run User keyword And Warn On Failure
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]}
+ Check Log Message ${tc[0, 1]}
... Executing keyword 'Exception In User Defined Keyword' failed:\nExpected Warn In User Keyword WARN
Run Keyword And Warn On Failure With Syntax Error
@@ -22,7 +22,7 @@ Run Keyword And Warn On Failure With Syntax Error
Run Keyword And Warn On Failure With Failure On Test Teardown
${tc}= Check Test Case ${TESTNAME}
- Check Log Message ${tc.teardown.msgs[0]}
+ Check Log Message ${tc.teardown[1]}
... Executing keyword 'Should Be Equal' failed:\nx != y WARN
Run Keyword And Warn On Failure With Timeout
@@ -30,5 +30,5 @@ Run Keyword And Warn On Failure With Timeout
Run Keyword And Warn On Failure On Suite Teardown
${suite} = Get Test Suite Run Keyword And Warn On Failure
- Check Log Message ${suite.teardown.msgs[0]}
+ Check Log Message ${suite.teardown[1]}
... Executing keyword 'Fail' failed:\nExpected Warn From Suite Teardown WARN
diff --git a/atest/robot/standard_libraries/builtin/run_keyword_based_on_suite_stats.robot b/atest/robot/standard_libraries/builtin/run_keyword_based_on_suite_stats.robot
index 71c1c1fea88..0ac6326e777 100644
--- a/atest/robot/standard_libraries/builtin/run_keyword_based_on_suite_stats.robot
+++ b/atest/robot/standard_libraries/builtin/run_keyword_based_on_suite_stats.robot
@@ -6,8 +6,8 @@ Resource atest_resource.robot
Run Keyword If All Tests Passed
${suite} = Get Test Suite Run Keyword If All Tests Passed When All Pass
Should Be Equal As Integers ${suite.statistics.failed} 0
- Should Be Equal ${suite.teardown.kws[0].name} My Teardown
- Check Log Message ${suite.teardown.kws[0].kws[0].msgs[0]} Suite teardown message
+ Should Be Equal ${suite.teardown[0].name} My Teardown
+ Check Log Message ${suite.teardown[0, 0, 0]} Suite teardown message
Run Keyword If All Tests Passed Can't be Used In Test
Check Test Case Run Keyword If All Tests Passed Can't be Used In Test
@@ -18,8 +18,8 @@ Run Keyword If All tests Passed Is not Executed When Any Test Fails
Run Keyword If Any Tests Failed
${suite} = Get Test Suite Run Keyword If Any Tests Failed When Test Fails
Should Be Equal As Integers ${suite.statistics.failed} 1
- Should Be Equal ${suite.teardown.kws[0].name} My Teardown
- Check Log Message ${suite.teardown.kws[0].kws[0].msgs[0]} Suite teardown message
+ Should Be Equal ${suite.teardown[0].name} My Teardown
+ Check Log Message ${suite.teardown[0, 0, 0]} Suite teardown message
Run Keyword If Any Tests Failed Can't be Used In Test
Check Test Case Run Keyword If Any Tests Failed Can't be Used In Test
diff --git a/atest/robot/standard_libraries/builtin/run_keyword_if_test_passed_failed.robot b/atest/robot/standard_libraries/builtin/run_keyword_if_test_passed_failed.robot
index 5d8a75270be..b635c2444c6 100644
--- a/atest/robot/standard_libraries/builtin/run_keyword_if_test_passed_failed.robot
+++ b/atest/robot/standard_libraries/builtin/run_keyword_if_test_passed_failed.robot
@@ -5,12 +5,12 @@ Resource atest_resource.robot
*** Test Cases ***
Run Keyword If Test Failed when test fails
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.teardown.body[0].full_name} BuiltIn.Log
- Check Log Message ${tc.teardown.body[0].msgs[0]} Hello from teardown!
+ Should Be Equal ${tc.teardown[0].full_name} BuiltIn.Log
+ Check Log Message ${tc.teardown[0, 0]} Hello from teardown!
Run Keyword If Test Failed in user keyword when test fails
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.teardown.body[1].body[0].msgs[0]} Apparently test failed! FAIL
+ Check Log Message ${tc.teardown[1, 0, 0]} Apparently test failed! FAIL
Run Keyword If Test Failed when test passes
${tc} = Check Test Case ${TEST NAME}
@@ -18,7 +18,7 @@ Run Keyword If Test Failed when test passes
Run Keyword If Test Failed in user keyword when test passes
${tc} = Check Test Case ${TEST NAME}
- Should Be Empty ${tc.teardown.body[1].body}
+ Should Be Empty ${tc.teardown[1].body}
Run Keyword If Test Failed when test is skipped
${tc} = Check Test Case ${TEST NAME}
@@ -26,35 +26,35 @@ Run Keyword If Test Failed when test is skipped
Run Keyword If Test Failed in user keyword when test is skipped
${tc} = Check Test Case ${TEST NAME}
- Should Be Empty ${tc.teardown.body[1].body}
+ Should Be Empty ${tc.teardown[1].body}
Run Keyword If Test Failed Can't Be Used In Setup
${tc} = Check Test Case ${TEST NAME}
Length Should Be ${tc.setup.body} 1
- Check Log Message ${tc.setup.body[0]} Keyword 'Run Keyword If Test Failed' can only be used in test teardown. FAIL
+ Check Log Message ${tc.setup[0]} Keyword 'Run Keyword If Test Failed' can only be used in test teardown. FAIL
Run Keyword If Test Failed Can't Be Used in Test
Check Test Case ${TEST NAME}
Run Keyword If Test Failed Uses User Keyword
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.teardown.kws[0].kws[0].msgs[0]} Teardown message
+ Check Log Message ${tc.teardown[0, 0, 0]} Teardown message
Run Keyword If Test Failed Fails
Check Test Case ${TEST NAME}
Run Keyword If test Failed Can't Be Used In Suite Setup or Teardown
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${SUITE.suites[0].setup.msgs[0]} Keyword 'Run Keyword If Test Failed' can only be used in test teardown. FAIL
- Check Log Message ${SUITE.suites[0].teardown.msgs[0]} Keyword 'Run Keyword If Test Failed' can only be used in test teardown. FAIL
+ Check Log Message ${SUITE.suites[0].setup[0]} Keyword 'Run Keyword If Test Failed' can only be used in test teardown. FAIL
+ Check Log Message ${SUITE.suites[0].teardown[0]} Keyword 'Run Keyword If Test Failed' can only be used in test teardown. FAIL
Run Keyword If Test Passed when test passes
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.teardown.body[0].msgs[0]} Teardown of passing test
+ Check Log Message ${tc.teardown[0, 0]} Teardown of passing test
Run Keyword If Test Passed in user keyword when test passes
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.teardown.body[1].body[0].msgs[0]} Apparently test passed! FAIL
+ Check Log Message ${tc.teardown[1, 0, 0]} Apparently test passed! FAIL
Run Keyword If Test Passed when test fails
${tc} = Check Test Case ${TEST NAME}
@@ -62,7 +62,7 @@ Run Keyword If Test Passed when test fails
Run Keyword If Test Passed in user keyword when test fails
${tc} = Check Test Case ${TEST NAME}
- Should Be Empty ${tc.teardown.body[1].body}
+ Should Be Empty ${tc.teardown[1].body}
Run Keyword If Test Passed when test is skipped
${tc} = Check Test Case ${TEST NAME}
@@ -70,7 +70,7 @@ Run Keyword If Test Passed when test is skipped
Run Keyword If Test Passed in user keyword when test is skipped
${tc} = Check Test Case ${TEST NAME}
- Should Be Empty ${tc.teardown.body[1].body}
+ Should Be Empty ${tc.teardown[1].body}
Run Keyword If Test Passed Can't Be used In Setup
Check Test Case ${TEST NAME}
@@ -80,8 +80,8 @@ Run Keyword If Test Passed Can't Be used In Test
Run Keyword If Test Passes Uses User Keyword
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.teardown.kws[0].kws[0].msgs[0]} Teardown message
- Check Keyword Data ${tc.teardown.kws[0].kws[0]} BuiltIn.Log args=\${message}
+ Check Log Message ${tc.teardown[0, 0, 0]} Teardown message
+ Check Keyword Data ${tc.teardown[0, 0]} BuiltIn.Log args=\${message}
Run Keyword If Test Passed Fails
Check Test Case ${TEST NAME}
@@ -94,27 +94,27 @@ Run Keyword If Test Failed When Teardown Fails
Run Keyword If Test Passed/Failed With Earlier Ignored Failures
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.teardown.kws[0].kws[0].status} FAIL
- Should Be Equal ${tc.teardown.kws[0].status} PASS
- Should Be Equal ${tc.teardown.kws[1].kws[0].status} FAIL
- Should Be Equal ${tc.teardown.kws[1].status} PASS
- Should Be Equal ${tc.teardown.status} PASS
+ Should Be Equal ${tc.teardown[0, 0].status} FAIL
+ Should Be Equal ${tc.teardown[0].status} PASS
+ Should Be Equal ${tc.teardown[1, 0].status} FAIL
+ Should Be Equal ${tc.teardown[1].status} PASS
+ Should Be Equal ${tc.teardown.status} PASS
Run Keyword If Test Passed/Failed after skip in teardown
${tc} = Check Test Case ${TEST NAME}
- Should Be Empty ${tc.teardown.body[1].body}
- Should Be Empty ${tc.teardown.body[2].body}
+ Should Be Empty ${tc.teardown[1].body}
+ Should Be Empty ${tc.teardown[2].body}
Continuable Failure In Teardown
Check Test Case ${TEST NAME}
Run Keyword If test Passed Can't Be Used In Suite Setup or Teardown
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${SUITE.suites[2].setup.msgs[0]} Keyword 'Run Keyword If Test Passed' can only be used in test teardown. FAIL
- Check Log Message ${SUITE.suites[2].teardown.msgs[0]} Keyword 'Run Keyword If Test Passed' can only be used in test teardown. FAIL
+ Check Log Message ${SUITE.suites[2].setup[0]} Keyword 'Run Keyword If Test Passed' can only be used in test teardown. FAIL
+ Check Log Message ${SUITE.suites[2].teardown[0]} Keyword 'Run Keyword If Test Passed' can only be used in test teardown. FAIL
Variable Values Should Not Be Visible As Keyword's Arguments
${tc} = Check Test Case Run Keyword If Test Failed Uses User Keyword
- Check Keyword Data ${tc.teardown} BuiltIn.Run Keyword If Test Failed args=Teardown UK, \${TEARDOWN MESSAGE} type=TEARDOWN
- Check Keyword Data ${tc.teardown.kws[0]} Teardown UK args=\${TEARDOWN MESSAGE}
- Check Keyword Data ${tc.teardown.kws[0].kws[0]} BuiltIn.Log args=\${message}
+ Check Keyword Data ${tc.teardown} BuiltIn.Run Keyword If Test Failed args=Teardown UK, \${TEARDOWN MESSAGE} type=TEARDOWN
+ Check Keyword Data ${tc.teardown[0]} Teardown UK args=\${TEARDOWN MESSAGE}
+ Check Keyword Data ${tc.teardown[0, 0]} BuiltIn.Log args=\${message}
diff --git a/atest/robot/standard_libraries/builtin/run_keyword_if_unless.robot b/atest/robot/standard_libraries/builtin/run_keyword_if_unless.robot
index 07bc9abe674..5141a284b7e 100644
--- a/atest/robot/standard_libraries/builtin/run_keyword_if_unless.robot
+++ b/atest/robot/standard_libraries/builtin/run_keyword_if_unless.robot
@@ -8,21 +8,21 @@ ${EXECUTED} This is executed
*** Test Cases ***
Run Keyword If With True Expression
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[0].body[0].msgs[0]} ${EXECUTED}
+ Check Log Message ${tc[0, 0, 0]} ${EXECUTED}
Run Keyword If With False Expression
${tc} = Check Test Case ${TEST NAME}
- Should Be Empty ${tc.body[0].body}
+ Should Be Empty ${tc[0].body}
Run Keyword In User Keyword
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[0].body[0].body[0].msgs[0]} ${EXECUTED}
- Should Be Empty ${tc.body[1].body[0].body}
+ Check Log Message ${tc[0, 0, 0, 0]} ${EXECUTED}
+ Should Be Empty ${tc[1, 0].body}
Run Keyword With ELSE
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[1].body[0].msgs[0]} ${EXECUTED}
- Check Log Message ${tc.body[3].body[0].msgs[0]} ${EXECUTED}
+ Check Log Message ${tc[1, 0, 0]} ${EXECUTED}
+ Check Log Message ${tc[3, 0, 0]} ${EXECUTED}
Keyword Name in ELSE as variable
Check Test Case ${TEST NAME}
@@ -45,18 +45,18 @@ Only first ELSE is significant
Run Keyword With ELSE IF
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[1].body[0].msgs[0]} ${EXECUTED}
+ Check Log Message ${tc[1, 0, 0]} ${EXECUTED}
Run Keyword with ELSE IF and ELSE
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[0].body[0].msgs[0]} ${EXECUTED}
- Check Log Message ${tc.body[1].body[0].msgs[0]} ${EXECUTED}
+ Check Log Message ${tc[0, 0, 0]} ${EXECUTED}
+ Check Log Message ${tc[1, 0, 0]} ${EXECUTED}
Run Keyword with multiple ELSE IF
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[0].body[0].msgs[0]} ${EXECUTED}
- Check Log Message ${tc.body[1].body[0].msgs[0]} ${EXECUTED}
- Check Log Message ${tc.body[2].body[0].msgs[0]} ${EXECUTED}
+ Check Log Message ${tc[0, 0, 0]} ${EXECUTED}
+ Check Log Message ${tc[1, 0, 0]} ${EXECUTED}
+ Check Log Message ${tc[2, 0, 0]} ${EXECUTED}
Keyword Name in ELSE IF as variable
Check Test Case ${TEST NAME}
@@ -79,53 +79,53 @@ ELSE IF without keyword is invalid
ELSE before ELSE IF is ignored
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.body[0].body[0].msgs[0]} ${EXECUTED}
+ Check Log Message ${tc[0, 0, 0]} ${EXECUTED}
ELSE and ELSE IF inside list arguments should be escaped
Check Test Case ${TEST NAME}
ELSE and ELSE IF must be upper case
${tc} = Check Test Case ${TEST NAME}
- Test ELSE (IF) Escaping ${tc.body[0].body[0]} else
- Test ELSE (IF) Escaping ${tc.body[1].body[0]} ELSE iF
+ Test ELSE (IF) Escaping ${tc[0, 0]} else
+ Test ELSE (IF) Escaping ${tc[1, 0]} ELSE iF
ELSE and ELSE IF must be whitespace sensitive
${tc} = Check Test Case ${TEST NAME}
- Test ELSE (IF) Escaping ${tc.body[0].body[0]} EL SE
- Test ELSE (IF) Escaping ${tc.body[1].body[0]} ELSEIF
+ Test ELSE (IF) Escaping ${tc[0, 0]} EL SE
+ Test ELSE (IF) Escaping ${tc[1, 0]} ELSEIF
Run Keyword With Escaped ELSE and ELSE IF
${tc} = Check Test Case ${TEST NAME}
- Test ELSE (IF) Escaping ${tc.body[0].body[0]} ELSE
- Test ELSE (IF) Escaping ${tc.body[1].body[0]} ELSE IF
+ Test ELSE (IF) Escaping ${tc[0, 0]} ELSE
+ Test ELSE (IF) Escaping ${tc[1, 0]} ELSE IF
Run Keyword With ELSE and ELSE IF from Variable
${tc} = Check Test Case ${TEST NAME}
- Test ELSE (IF) Escaping ${tc.body[0].body[0]} ELSE
- Test ELSE (IF) Escaping ${tc.body[1].body[0]} ELSE
- Test ELSE (IF) Escaping ${tc.body[2].body[0]} ELSE IF
- Test ELSE (IF) Escaping ${tc.body[3].body[0]} ELSE IF
+ Test ELSE (IF) Escaping ${tc[0, 0]} ELSE
+ Test ELSE (IF) Escaping ${tc[1, 0]} ELSE
+ Test ELSE (IF) Escaping ${tc[2, 0]} ELSE IF
+ Test ELSE (IF) Escaping ${tc[3, 0]} ELSE IF
Run Keyword Unless With False Expression
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${ERRORS[0]} Keyword 'BuiltIn.Run Keyword Unless' is deprecated. WARN
- Check Log Message ${tc.body[1].body[0]} Keyword 'BuiltIn.Run Keyword Unless' is deprecated. WARN
- Check Log Message ${tc.body[1].body[1].msgs[0]} ${EXECUTED}
+ Check Log Message ${ERRORS[0]} Keyword 'BuiltIn.Run Keyword Unless' is deprecated. WARN
+ Check Log Message ${tc[1, 0]} Keyword 'BuiltIn.Run Keyword Unless' is deprecated. WARN
+ Check Log Message ${tc[1, 1, 0]} ${EXECUTED}
Run Keyword Unless With True Expression
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${ERRORS[1]} Keyword 'BuiltIn.Run Keyword Unless' is deprecated. WARN
- Check Log Message ${tc.body[0].body[0]} Keyword 'BuiltIn.Run Keyword Unless' is deprecated. WARN
- Length Should Be ${tc.body[0].body} 1
+ Check Log Message ${ERRORS[1]} Keyword 'BuiltIn.Run Keyword Unless' is deprecated. WARN
+ Check Log Message ${tc[0, 0]} Keyword 'BuiltIn.Run Keyword Unless' is deprecated. WARN
+ Length Should Be ${tc[0].body} 1
Variable Values Should Not Be Visible As Keyword's Arguments
${tc} = Check Test Case Run Keyword In User Keyword
- Check Keyword Data ${tc.body[0].body[0]} BuiltIn.Run Keyword If args='\${status}' == 'PASS', Log, \${message}
- Check Keyword Data ${tc.body[0].body[0].body[0]} BuiltIn.Log args=\${message}
+ Check Keyword Data ${tc[0, 0]} BuiltIn.Run Keyword If args='\${status}' == 'PASS', Log, \${message}
+ Check Keyword Data ${tc[0, 0, 0]} BuiltIn.Log args=\${message}
*** Keywords ***
Test ELSE (IF) Escaping
[Arguments] ${kw} ${else (if)}
- Length Should Be ${kw.msgs} 2
- Check Log Message ${kw.msgs[0]} ${else (if)}
- Check Log Message ${kw.msgs[1]} ${EXECUTED}
+ Length Should Be ${kw.body} 2
+ Check Log Message ${kw[0]} ${else (if)}
+ Check Log Message ${kw[1]} ${EXECUTED}
diff --git a/atest/robot/standard_libraries/builtin/run_keyword_variants_variable_handling.robot b/atest/robot/standard_libraries/builtin/run_keyword_variants_variable_handling.robot
index 472e828434a..632d23d74a1 100644
--- a/atest/robot/standard_libraries/builtin/run_keyword_variants_variable_handling.robot
+++ b/atest/robot/standard_libraries/builtin/run_keyword_variants_variable_handling.robot
@@ -5,18 +5,18 @@ Resource atest_resource.robot
*** Test Cases ***
Variable Values Should Not Be Visible As Keyword's Arguments
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0]} BuiltIn.Run Keyword args=My UK, Log, \${OBJECT}
- Check Keyword Data ${tc.kws[0].kws[0]} My UK args=Log, \${OBJECT}
- Check Keyword Data ${tc.kws[0].kws[0].kws[0]} BuiltIn.Run Keyword args=\${name}, \@{args}
- Check Keyword Data ${tc.kws[0].kws[0].kws[0].kws[0]} BuiltIn.Log args=\@{args}
- Check Log Message ${tc.kws[0].kws[0].kws[0].kws[0].msgs[0]} Robot
- Check Keyword Data ${tc.kws[0].kws[0].kws[1].kws[0]} BuiltIn.Log args=\${args}[0]
- Check Log Message ${tc.kws[0].kws[0].kws[1].kws[0].msgs[0]} Robot
+ Check Keyword Data ${tc[0]} BuiltIn.Run Keyword args=My UK, Log, \${OBJECT}
+ Check Keyword Data ${tc[0, 0]} My UK args=Log, \${OBJECT}
+ Check Keyword Data ${tc[0, 0, 0]} BuiltIn.Run Keyword args=\${name}, \@{args}
+ Check Keyword Data ${tc[0, 0, 0, 0]} BuiltIn.Log args=\@{args}
+ Check Log Message ${tc[0, 0, 0, 0, 0]} Robot
+ Check Keyword Data ${tc[0, 0, 1, 0]} BuiltIn.Log args=\${args}[0]
+ Check Log Message ${tc[0, 0, 1, 0, 0]} Robot
Run Keyword When Keyword and Arguments Are in List Variable
${tc} = Check Test Case ${TEST NAME}
- Check Keyword Data ${tc.kws[0].kws[0]} \\Log Many args=c:\\\\temp\\\\foo, \\\${notvar}
- Check Keyword Data ${tc.kws[1].kws[0]} \\Log Many args=\\\${notvar}
+ Check Keyword Data ${tc[0, 0]} \\Log Many args=c:\\\\temp\\\\foo, \\\${notvar}
+ Check Keyword Data ${tc[1, 0]} \\Log Many args=\\\${notvar}
Run Keyword With Empty List Variable
Check Test Case ${TEST NAME}
@@ -57,7 +57,7 @@ Run Keyword If With List And One Argument That needs to Be Processed
*** Keywords ***
Check Keyword Arguments And Messages
[Arguments] ${tc}
- Check Keyword Data ${tc.kws[0].kws[0]} \\Log Many args=\@{ARGS}
- Check Keyword Data ${tc.kws[0].kws[0].kws[0]} BuiltIn.Log Many args=\@{args}
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} c:\\temp\\foo
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[1]} \${notvar}
+ Check Keyword Data ${tc[0, 0]} \\Log Many args=\@{ARGS}
+ Check Keyword Data ${tc[0, 0, 0]} BuiltIn.Log Many args=\@{args}
+ Check Log Message ${tc[0, 0, 0, 0]} c:\\temp\\foo
+ Check Log Message ${tc[0, 0, 0, 1]} \${notvar}
diff --git a/atest/robot/standard_libraries/builtin/run_keyword_variants_with_escaping_control_arguments.robot b/atest/robot/standard_libraries/builtin/run_keyword_variants_with_escaping_control_arguments.robot
index bf6a2754738..6c55e2821a3 100644
--- a/atest/robot/standard_libraries/builtin/run_keyword_variants_with_escaping_control_arguments.robot
+++ b/atest/robot/standard_libraries/builtin/run_keyword_variants_with_escaping_control_arguments.robot
@@ -5,32 +5,32 @@ Resource atest_resource.robot
*** Test Cases ***
Run Keyword with Run Keywords with Arguments Inside List variable should escape AND
${tc}= Test Should Have Correct Keywords BuiltIn.Run Keywords
- Check Log Message ${tc.kws[0].kws[0].kws[0].kws[0].msgs[0]} log message
+ Check Log Message ${tc[0, 0, 0, 0, 0]} log message
Run Keyword with Run Keywords and Arguments Inside List variable should escape AND
${tc}= Test Should Have Correct Keywords BuiltIn.Run Keywords
- Check Log Message ${tc.kws[0].kws[0].kws[0].kws[0].msgs[0]} log message
+ Check Log Message ${tc[0, 0, 0, 0, 0]} log message
Run Keyword If with Run Keywords With Arguments Inside List variable should escape AND
${tc}= Test Should Have Correct Keywords BuiltIn.Run Keywords
- Check Log Message ${tc.kws[0].kws[0].kws[0].kws[0].msgs[0]} log message
+ Check Log Message ${tc[0, 0, 0, 0, 0]} log message
Run Keyword If with Run Keywords And Arguments Inside List variable should escape AND
${tc}= Test Should Have Correct Keywords BuiltIn.Run Keyword
- Check Log Message ${tc.kws[0].kws[0].kws[0].kws[0].kws[0].msgs[0]} log message
+ Check Log Message ${tc[0, 0, 0, 0, 0, 0]} log message
Run Keywords With Run Keyword If should not escape ELSE and ELSE IF
${tc}= Test Should Have Correct Keywords
... BuiltIn.Run Keyword If BuiltIn.Log BuiltIn.Run Keyword If
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} log message
- Check Log Message ${tc.kws[0].kws[1].msgs[0]} that
+ Check Log Message ${tc[0, 0, 0, 0]} log message
+ Check Log Message ${tc[0, 1, 0]} that
Run Keywords With Run Keyword If In List Variable Should Escape ELSE and ELSE IF From List Variable
${tc}= Test Should Have Correct Keywords
... BuiltIn.Run Keyword If BuiltIn.Log BuiltIn.Run Keyword If
- Check Log Message ${tc.kws[0].kws[1].msgs[0]} that
+ Check Log Message ${tc[0, 1, 0]} that
Run Keywords With Run Keyword If With Arguments From List Variable should escape ELSE and ELSE IF From List Variable
${tc}= Test Should Have Correct Keywords
... BuiltIn.Run Keyword If BuiltIn.Log BuiltIn.Run Keyword If
- Check Log Message ${tc.kws[0].kws[1].msgs[0]} that
+ Check Log Message ${tc[0, 1, 0]} that
diff --git a/atest/robot/standard_libraries/builtin/run_keyword_with_errors.robot b/atest/robot/standard_libraries/builtin/run_keyword_with_errors.robot
index dbd75652954..977d82e9da3 100644
--- a/atest/robot/standard_libraries/builtin/run_keyword_with_errors.robot
+++ b/atest/robot/standard_libraries/builtin/run_keyword_with_errors.robot
@@ -5,13 +5,13 @@ Resource atest_resource.robot
*** Test Cases ***
Ignore Error When Keyword Passes
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} My message
+ Check Log Message ${tc[0, 0, 0]} My message
Ignore Error When Keyword Fails
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} My error message FAIL
- Should Be Equal ${tc.kws[0].kws[0].status} FAIL
- Should Be Equal ${tc.kws[0].status} PASS
+ Should Be Equal ${tc[0].status} PASS
+ Should Be Equal ${tc[0, 0].status} FAIL
+ Check Log Message ${tc[0, 0, 0]} My error message FAIL
Ignore Error Returns When Keyword Passes
Check Test Case ${TEST NAME}
@@ -21,22 +21,22 @@ Ignore Error Returns When Keyword Fails
Ignore Error With User Keyword When Keywords Pass
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} Hello world
- Check Keyword Data ${tc.kws[0].kws[0].kws[2]} BuiltIn.Evaluate \${ret} 1+2
+ Check Log Message ${tc[0, 0, 0, 0]} Hello world
+ Check Keyword Data ${tc[0, 0, 2]} BuiltIn.Evaluate \${ret} 1+2
Ignore Error With User Keyword When Keyword Fails
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].kws[0].msgs[0]} Hello world
- Check Log Message ${tc.kws[0].kws[0].kws[1].msgs[0]} Expected failure in UK FAIL
- Length Should Be ${tc.kws[0].kws[0].kws} 3
- Should Be Equal ${tc.kws[0].kws[0].kws[-1].status} NOT RUN
+ Check Log Message ${tc[0, 0, 0, 0, 0]} Hello world
+ Check Log Message ${tc[0, 0, 1, 0]} Expected failure in UK FAIL
+ Length Should Be ${tc[0, 0].body} 3
+ Should Be Equal ${tc[0, 0, -1].status} NOT RUN
Ignore Error With Arguments That Needs To Be Escaped
Check Test Case ${TEST NAME}
Ignore Error When Timeout Occurs
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].status} FAIL Run Keyword And Ignore Error captured timeout even though it should not no values
+ Should Be Equal ${tc[0].status} FAIL Run Keyword And Ignore Error captured timeout even though it should not no values
Ignore Error When Timeout Occurs In UK
Check Test Case ${TEST NAME}
@@ -75,9 +75,9 @@ Ignore Error With "Passing" Exceptions
Expect Error When Error Occurs
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} My error message FAIL
- Should Be Equal ${tc.kws[0].kws[0].status} FAIL
- Should Be Equal ${tc.kws[0].status} PASS
+ Should Be Equal ${tc[0].status} PASS
+ Should Be Equal ${tc[0, 0].status} FAIL
+ Check Log Message ${tc[0, 0, 0]} My error message FAIL
Expect Error When Different Error Occurs
Check Test Case ${TEST NAME}
@@ -97,24 +97,24 @@ Expected Error Should Be Returned
Expect Error With User Keyword When Keywords Pass
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} Hello world
- Check Keyword Data ${tc.kws[0].kws[0].kws[2]} BuiltIn.Evaluate \${ret} 1+2
+ Check Log Message ${tc[0, 0, 0, 0]} Hello world
+ Check Keyword Data ${tc[0, 0, 2]} BuiltIn.Evaluate \${ret} 1+2
Expect Error With User Keyword When Keyword Fails
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].kws[0].msgs[0]} Hello world
- Check Log Message ${tc.kws[0].kws[0].kws[1].msgs[0]} Expected failure in UK FAIL
- Length Should Be ${tc.kws[0].kws[0].kws} 3
- Should Be Equal ${tc.kws[0].kws[0].kws[-1].status} NOT RUN
+ Check Log Message ${tc[0, 0, 0, 0, 0]} Hello world
+ Check Log Message ${tc[0, 0, 1, 0]} Expected failure in UK FAIL
+ Length Should Be ${tc[0, 0].body} 3
+ Should Be Equal ${tc[0, 0, -1].status} NOT RUN
Expect Error With Arguments That Needs To Be Escaped
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[1].kws[0].msgs[0]} c:\\temp\\foo\\not_new_line
- Check Log Message ${tc.kws[1].kws[0].msgs[1]} \${notvar}
+ Check Log Message ${tc[1, 0, 0]} c:\\temp\\foo\\not_new_line
+ Check Log Message ${tc[1, 0, 1]} \${notvar}
Expect Error When Timeout Occurs
${tc} = Check Test Case ${TEST NAME}
- Should Be Equal ${tc.kws[0].status} FAIL Run Keyword And Expect Error captured timeout even though it should not no values
+ Should Be Equal ${tc[0].status} FAIL Run Keyword And Expect Error captured timeout even though it should not no values
Expect Error When Timeout Occurs In UK
Check Test Case ${TEST NAME}
@@ -171,4 +171,4 @@ Expect Error With "Passing" Exceptions
Variable Values Should Not Be Visible As Keyword's Arguments
${tc} = Check Test Case Ignore Error With Arguments That Needs To be Escaped
- Check Keyword Data ${tc.kws[3].kws[0]} BuiltIn.Create List args=\@{NEEDS ESCAPING}
+ Check Keyword Data ${tc[3, 0]} BuiltIn.Create List args=\@{NEEDS ESCAPING}
diff --git a/atest/robot/standard_libraries/builtin/run_keywords.robot b/atest/robot/standard_libraries/builtin/run_keywords.robot
index 307cb414be9..e245b9146e7 100644
--- a/atest/robot/standard_libraries/builtin/run_keywords.robot
+++ b/atest/robot/standard_libraries/builtin/run_keywords.robot
@@ -8,7 +8,7 @@ Resource atest_resource.robot
Passing keywords
${tc} = Test Should Have Correct Keywords
... BuiltIn.No Operation Passing BuiltIn.Log Variables
- Check Log Message ${tc.kws[0].kws[1].kws[0].msgs[0]} Hello, world!
+ Check Log Message ${tc[0, 1, 0, 0]} Hello, world!
Failing keyword
Test Should Have Correct Keywords
@@ -17,18 +17,18 @@ Failing keyword
Embedded arguments
${tc} = Test Should Have Correct Keywords
... Embedded "arg" Embedded "\${1}" Embedded object "\${OBJECT}"
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} arg
- Check Log Message ${tc.kws[0].kws[1].kws[0].msgs[0]} 1
- Check Log Message ${tc.kws[0].kws[2].kws[0].msgs[0]} Robot
+ Check Log Message ${tc[0, 0, 0, 0]} arg
+ Check Log Message ${tc[0, 1, 0, 0]} 1
+ Check Log Message ${tc[0, 2, 0, 0]} Robot
Embedded arguments with library keywords
${tc} = Test Should Have Correct Keywords
... embedded_args.Embedded "arg" in library
... embedded_args.Embedded "\${1}" in library
... embedded_args.Embedded object "\${OBJECT}" in library
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} arg
- Check Log Message ${tc.kws[0].kws[1].msgs[0]} 1
- Check Log Message ${tc.kws[0].kws[2].msgs[0]} Robot
+ Check Log Message ${tc[0, 0, 0]} arg
+ Check Log Message ${tc[0, 1, 0]} 1
+ Check Log Message ${tc[0, 2, 0]} Robot
Keywords names needing escaping
Test Should Have Correct Keywords
@@ -80,7 +80,7 @@ In test teardown with ExecutionPassed exception after continuable failure
Check Test Case ${TESTNAME}
In suite setup
- Check Log Message ${SUITE.setup.kws[0].kws[0].msgs[0]} Hello, world!
+ Check Log Message ${SUITE.setup[0, 0, 0]} Hello, world!
Should Contain Keywords ${SUITE.setup} Passing BuiltIn.No Operation
In suite teardown
diff --git a/atest/robot/standard_libraries/builtin/run_keywords_with_arguments.robot b/atest/robot/standard_libraries/builtin/run_keywords_with_arguments.robot
index b155ef8b66d..4e792da98bf 100644
--- a/atest/robot/standard_libraries/builtin/run_keywords_with_arguments.robot
+++ b/atest/robot/standard_libraries/builtin/run_keywords_with_arguments.robot
@@ -7,46 +7,46 @@ Resource atest_resource.robot
*** Test Cases ***
With arguments
${tc}= Test Should Have Correct Keywords BuiltIn.Should Be Equal BuiltIn.No Operation BuiltIn.Log Many BuiltIn.Should Be Equal
- Check Log Message ${tc.kws[0].kws[2].msgs[1]} 1
+ Check Log Message ${tc[0, 2, 1]} 1
Should fail with failing keyword
Test Should Have Correct Keywords BuiltIn.No Operation BuiltIn.Should Be Equal
Should support keywords and arguments from variables
${tc}= Test Should Have Correct Keywords BuiltIn.Should Be Equal BuiltIn.No Operation BuiltIn.Log Many BuiltIn.Should Be Equal As Integers
- Check Log Message ${tc.kws[0].kws[2].msgs[0]} hello
- Check Log Message ${tc.kws[0].kws[2].msgs[1]} 1
- Check Log Message ${tc.kws[0].kws[2].msgs[2]} 2
- Check Log Message ${tc.kws[0].kws[2].msgs[3]} 3
+ Check Log Message ${tc[0, 2, 0]} hello
+ Check Log Message ${tc[0, 2, 1]} 1
+ Check Log Message ${tc[0, 2, 2]} 2
+ Check Log Message ${tc[0, 2, 3]} 3
AND must be upper case
${tc}= Test Should Have Correct Keywords BuiltIn.Log Many no kw
- Check Log Message ${tc.kws[0].kws[0].msgs[1]} and
+ Check Log Message ${tc[0, 0, 1]} and
AND must be whitespace sensitive
${tc}= Test Should Have Correct Keywords BuiltIn.Log Many no kw
- Check Log Message ${tc.kws[0].kws[0].msgs[1]} A ND
+ Check Log Message ${tc[0, 0, 1]} A ND
Escaped AND
${tc}= Test Should Have Correct Keywords BuiltIn.Log Many no kw
- Check Log Message ${tc.kws[0].kws[0].msgs[1]} AND
+ Check Log Message ${tc[0, 0, 1]} AND
AND from Variable
${tc}= Test Should Have Correct Keywords BuiltIn.Log Many no kw
- Check Log Message ${tc.kws[0].kws[0].msgs[1]} AND
+ Check Log Message ${tc[0, 0, 1]} AND
AND in List Variable
${tc}= Test Should Have Correct Keywords BuiltIn.Log Many no kw
- Check Log Message ${tc.kws[0].kws[0].msgs[1]} AND
+ Check Log Message ${tc[0, 0, 1]} AND
Escapes in List Variable should be handled correctly
${tc}= Test Should Have Correct Keywords BuiltIn.Log Many no kw
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} 1
- Check Log Message ${tc.kws[0].kws[0].msgs[1]} AND
- Check Log Message ${tc.kws[0].kws[0].msgs[2]} 2
- Check Log Message ${tc.kws[0].kws[0].msgs[3]} Log Many
- Check Log Message ${tc.kws[0].kws[0].msgs[4]} x\${escaped}
- Check Log Message ${tc.kws[0].kws[0].msgs[5]} c:\\temp
+ Check Log Message ${tc[0, 0, 0]} 1
+ Check Log Message ${tc[0, 0, 1]} AND
+ Check Log Message ${tc[0, 0, 2]} 2
+ Check Log Message ${tc[0, 0, 3]} Log Many
+ Check Log Message ${tc[0, 0, 4]} x\${escaped}
+ Check Log Message ${tc[0, 0, 5]} c:\\temp
AND as last argument should raise an error
Test Should Have Correct Keywords BuiltIn.Log Many BuiltIn.No Operation
diff --git a/atest/robot/standard_libraries/builtin/set_documentation.robot b/atest/robot/standard_libraries/builtin/set_documentation.robot
index d155f09b210..bbe36cbe526 100644
--- a/atest/robot/standard_libraries/builtin/set_documentation.robot
+++ b/atest/robot/standard_libraries/builtin/set_documentation.robot
@@ -5,35 +5,40 @@ Resource atest_resource.robot
*** Test Cases ***
Set test documentation
${tc} = Check Test Doc ${TESTNAME} This has been set!\nTo several lines.
- Check Log Message ${tc.kws[0].msgs[0]} Set test documentation to:\nThis has been set!\nTo several lines.
+ Check Log Message ${tc[0, 0]} Set test documentation to:\nThis has been set!\nTo several lines.
Replace test documentation
${tc} = Check Test Doc ${TESTNAME} New doc
- Check Log Message ${tc.kws[0].msgs[0]} Set test documentation to:\nNew doc
+ Check Log Message ${tc[0, 0]} Set test documentation to:\nNew doc
Append to test documentation
- ${tc} = Check Test Doc ${TESTNAME} Original doc is continued \n\ntwice!
- Check Log Message ${tc.kws[0].msgs[0]} Set test documentation to:\nOriginal doc is continued
- Check Log Message ${tc.kws[2].msgs[0]} Set test documentation to:\nOriginal doc is continued \n\ntwice!
+ ${tc} = Check Test Doc ${TESTNAME} Original doc is continued \n\ntwice! thrice!!
+ Check Log Message ${tc[0, 0]} Set test documentation to:\nOriginal doc is continued
+ Check Log Message ${tc[2, 0]} Set test documentation to:\nOriginal doc is continued \n\ntwice!
+ Check Log Message ${tc[4, 0]} Set test documentation to:\nOriginal doc is continued \n\ntwice! thrice
+ Check Log Message ${tc[6, 0]} Set test documentation to:\nOriginal doc is continued \n\ntwice! thrice!
+ Check Log Message ${tc[8, 0]} Set test documentation to:\nOriginal doc is continued \n\ntwice! thrice!!
Set suite documentation
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Set suite documentation to:\nNew suite doc
+ Check Log Message ${tc[0, 0]} Set suite documentation to:\nNew suite doc
Check Test Case ${TESTNAME} 2
Should Start With ${SUITE.suites[0].doc} New suite doc
Append to suite documentation
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Set suite documentation to:\nNew suite doc is continued
+ Check Log Message ${tc[0, 0]} Set suite documentation to:\nNew suite doc is continued
${tc} = Check Test Case ${TESTNAME} 2
- Check Log Message ${tc.kws[1].msgs[0]} Set suite documentation to:\nNew suite doc is continued \n\ntwice!
- Should Be Equal ${SUITE.suites[0].doc} New suite doc is continued \n\ntwice!
+ Check Log Message ${tc[1, 0]} Set suite documentation to:\nNew suite doc is continued \n\ntwice!
+ Check Log Message ${tc[3, 0]} Set suite documentation to:\nNew suite doc is continued \n\ntwice!,thrice
+ Check Log Message ${tc[5, 0]} Set suite documentation to:\nNew suite doc is continued \n\ntwice!,thrice?1
+ Should Be Equal ${SUITE.suites[0].doc} New suite doc is continued \n\ntwice!,thrice?1
Set init file suite docs
Should Be Equal ${SUITE.doc} Init file doc. Concatenated in setup. Appended in test.
- Check Log Message ${SUITE.setup.msgs[0]} Set suite documentation to:\nInit file doc. Concatenated in setup.
+ Check Log Message ${SUITE.setup[0]} Set suite documentation to:\nInit file doc. Concatenated in setup.
Set top level suite documentation
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Set suite documentation to:\nInit file doc. Concatenated in setup. Appended in test.
+ Check Log Message ${tc[0, 0]} Set suite documentation to:\nInit file doc. Concatenated in setup. Appended in test.
diff --git a/atest/robot/standard_libraries/builtin/set_library_search_order.robot b/atest/robot/standard_libraries/builtin/set_library_search_order.robot
index bb9d316a7f0..f7b692bbc7c 100644
--- a/atest/robot/standard_libraries/builtin/set_library_search_order.robot
+++ b/atest/robot/standard_libraries/builtin/set_library_search_order.robot
@@ -41,6 +41,6 @@ Library Search Order Is Case Insensitive
Search Order Controlled Match Containing Embedded Arguments Wins Over Exact Match
Check Test Case ${TEST NAME}
-
+
Best Search Order Controlled Match Wins In Library
Check Test Case ${TEST NAME}
diff --git a/atest/robot/standard_libraries/builtin/set_log_level.robot b/atest/robot/standard_libraries/builtin/set_log_level.robot
index bc836e09f84..621e617125c 100644
--- a/atest/robot/standard_libraries/builtin/set_log_level.robot
+++ b/atest/robot/standard_libraries/builtin/set_log_level.robot
@@ -5,35 +5,35 @@ Resource atest_resource.robot
*** Test Cases ***
Set Log Level
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Log level changed from INFO to TRACE. DEBUG
- Check Log Message ${tc.kws[1].msgs[1]} This is logged TRACE
- Check Log Message ${tc.kws[2].msgs[1]} This is logged DEBUG
- Check Log Message ${tc.kws[3].msgs[1]} This is logged INFO
- Check Log Message ${tc.kws[4].msgs[1]} Log level changed from TRACE to DEBUG. DEBUG
- Should Be Empty ${tc.kws[6].msgs}
- Check Log Message ${tc.kws[7].msgs[0]} This is logged DEBUG
- Check Log Message ${tc.kws[8].msgs[0]} This is logged INFO
- Should Be Empty ${tc.kws[9].msgs}
- Should Be Empty ${tc.kws[10].msgs}
- Should Be Empty ${tc.kws[11].msgs}
- Check Log Message ${tc.kws[12].msgs[0]} This is logged INFO
- Should Be Empty ${tc.kws[15].msgs}
- Check Log Message ${tc.kws[16].msgs[0]} This is logged ERROR
- Should Be Empty ${tc.kws[17].msgs}
- Should Be Empty ${tc.kws[18].msgs}
- Should Be Empty ${tc.kws[19].msgs}
+ Check Log Message ${tc[0, 0]} Log level changed from INFO to TRACE. DEBUG
+ Check Log Message ${tc[1, 1]} This is logged TRACE
+ Check Log Message ${tc[2, 1]} This is logged DEBUG
+ Check Log Message ${tc[3, 1]} This is logged INFO
+ Check Log Message ${tc[4, 1]} Log level changed from TRACE to DEBUG. DEBUG
+ Should Be Empty ${tc[6].body}
+ Check Log Message ${tc[7, 0]} This is logged DEBUG
+ Check Log Message ${tc[8, 0]} This is logged INFO
+ Should Be Empty ${tc[9].body}
+ Should Be Empty ${tc[10].body}
+ Should Be Empty ${tc[11].body}
+ Check Log Message ${tc[12, 0]} This is logged INFO
+ Should Be Empty ${tc[15].body}
+ Check Log Message ${tc[16, 0]} This is logged ERROR
+ Should Be Empty ${tc[17].body}
+ Should Be Empty ${tc[18].body}
+ Should Be Empty ${tc[19].body}
Invalid Log Level Failure Is Catchable
Check Test Case ${TESTNAME}
Reset Log Level
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Log level changed from INFO to DEBUG. DEBUG
- Check Log Message ${tc.kws[1].msgs[0]} This is logged INFO
- Check Log Message ${tc.kws[2].msgs[0]} This is logged DEBUG
- Should Be Empty ${tc.kws[3].msgs}
- Check Log Message ${tc.kws[4].msgs[0]} This is logged INFO
- Should Be Empty ${tc.kws[5].msgs}
+ Check Log Message ${tc[0, 0]} Log level changed from INFO to DEBUG. DEBUG
+ Check Log Message ${tc[1, 0]} This is logged INFO
+ Check Log Message ${tc[2, 0]} This is logged DEBUG
+ Should Be Empty ${tc[3].body}
+ Check Log Message ${tc[4, 0]} This is logged INFO
+ Should Be Empty ${tc[5].body}
Log Level Goes To HTML
File Should Contain ${OUTDIR}${/}set_log_level_log.html KW Info to log
diff --git a/atest/robot/standard_libraries/builtin/set_suite_metadata.robot b/atest/robot/standard_libraries/builtin/set_suite_metadata.robot
index 5170c9f8c06..36ca3731efc 100644
--- a/atest/robot/standard_libraries/builtin/set_suite_metadata.robot
+++ b/atest/robot/standard_libraries/builtin/set_suite_metadata.robot
@@ -5,49 +5,62 @@ Resource atest_resource.robot
*** 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]}
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 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]}
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 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]}
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[1, 0]}
... Set suite metadata 'MYname' to value 'final value'.
Append to value
Metadata should have value To Append Original is continued \n\ntwice!
- ${tc} = Check test case ${TESTNAME}
- Check log message ${tc.kws[0].msgs[0]}
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0]}
... Set suite metadata 'To Append' to value 'Original'.
- Check log message ${tc.kws[2].msgs[0]}
+ Check Log Message ${tc[2, 0]}
... Set suite metadata 'toappend' to value 'Original is continued'.
- Check log message ${tc.kws[4].msgs[0]}
+ Check Log Message ${tc[4, 0]}
... Set suite metadata 'TOAPPEND' to value 'Original is continued \n\ntwice!'.
+ Check Log Message ${tc[6, 0]}
+ ... Set suite metadata 'Version' to value '1.0'.
+ Check Log Message ${tc[8, 0]}
+ ... Set suite metadata 'version' to value '1.0/2.0'.
+ Check Log Message ${tc[10, 0]}
+ ... Set suite metadata 'ver sion' to value '1.0/2.0/3.0'.
Set top-level suite metadata
Metadata should have value New metadata Metadata for top level suite top=yes
- ${tc} = Check test case ${TESTNAME}
- Check log message ${tc.kws[0].msgs[0]}
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0]}
... Set suite metadata 'New metadata' to value 'Metadata for'.
- Check log message ${tc.kws[1].msgs[0]}
+ Check Log Message ${tc[1, 0]}
... Set suite metadata 'newmetadata' to value 'Metadata for top level suite'.
+ Metadata should have value Separator 2top**level top=yes
+ Check Log Message ${tc[3, 0]}
+ ... Set suite metadata 'Separator' to value '2'.
+ Check Log Message ${tc[4, 0]}
+ ... Set suite metadata 'Separator' to value '2top'.
+ Check Log Message ${tc[5, 0]}
+ ... Set suite metadata 'Separator' to value '2top**level'.
Non-ASCII and non-string names and values
- ${tc} = Check test case ${TESTNAME}
- Check log message ${tc.kws[0].msgs[0]}
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0]}
... Set suite metadata '42' to value '1'.
- Check log message ${tc.kws[2].msgs[0]}
+ Check Log Message ${tc[2, 0]}
... Set suite metadata '42' to value '1 päivä'.
Modifying \${SUITE METADATA} has no effect also after setting metadata
- Check test case ${TESTNAME}
+ Check Test Case ${TESTNAME}
Metadata should have value Cannot be set otherwise
Set in suite setup
diff --git a/atest/robot/standard_libraries/builtin/set_test_message.robot b/atest/robot/standard_libraries/builtin/set_test_message.robot
index 28882ff74d7..bb79583aa1e 100644
--- a/atest/robot/standard_libraries/builtin/set_test_message.robot
+++ b/atest/robot/standard_libraries/builtin/set_test_message.robot
@@ -6,42 +6,44 @@ Resource atest_resource.robot
*** Test Cases ***
Set Message To Successful Test
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Set test message to:\nMy Test
+ Check Log Message ${tc[0, 0]} Set test message to:\nMy Test
Reset Message
Check Test Case ${TEST NAME}
Append To Message
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Set test message to:\nMy
- Check Log Message ${tc.kws[1].msgs[0]} Set test message to:\nMy & its continuation <>
+ Check Log Message ${tc[0, 0]} Set test message to:\nMy
+ Check Log Message ${tc[1, 0]} Set test message to:\nMy & its continuation <>
+ Check Log Message ${tc[2, 0]} Set test message to:\nMy & its continuation <>1
+ Check Log Message ${tc[3, 0]} Set test message to:\nMy & its continuation <>1,\n2
Set Non-ASCII Message
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Set test message to:\nHyvää yötä
+ Check Log Message ${tc[0, 0]} Set test message to:\nHyvää yötä
Set Multiline Message
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Set test message to:\n1\n2\n3
+ Check Log Message ${tc[0, 0]} Set test message to:\n1\n2\n3
Set HTML Message
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Set test message to:\nMy HTML message html=True
+ Check Log Message ${tc[0, 0]} Set test message to:\nMy HTML message html=True
Append HTML to non-HTML
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Set test message to:\nMy non-HTML & html=False
- Check Log Message ${tc.kws[1].msgs[0]} Set test message to:\nMy non-HTML <message> & its HTML continuation html=True
+ Check Log Message ${tc[0, 0]} Set test message to:\nMy non-HTML & html=False
+ Check Log Message ${tc[1, 0]} Set test message to:\nMy non-HTML <message> & its HTML continuation html=True
Append non-HTML to HTML
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Set test message to:\nMy HTML message html=True
- Check Log Message ${tc.kws[1].msgs[0]} Set test message to:\nMy HTML message & its non-HTML <continuation> html=True
+ Check Log Message ${tc[0, 0]} Set test message to:\nMy HTML message html=True
+ Check Log Message ${tc[1, 0]} Set test message to:\nMy HTML message & its non-HTML <continuation> html=True
Append HTML to HTML
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Set test message to:\nMy HTML message html=True
- Check Log Message ${tc.kws[1].msgs[0]} Set test message to:\nMy HTML message & its HTML continuation html=True
+ Check Log Message ${tc[0, 0]} Set test message to:\nMy HTML message html=True
+ Check Log Message ${tc[1, 0]} Set test message to:\nMy HTML message & its HTML continuation html=True
Set Non-String Message
Check Test Case ${TEST NAME}
@@ -87,3 +89,18 @@ Not Allowed In Suite Setup or Teardown
... Also suite teardown failed:
... 'Set Test Message' keyword cannot be used in suite setup or teardown.
Should Be Equal ${SUITE.suites[1].message} ${error}
+
+Append HTML to non-HTML with separator
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Log Message ${tc[0, 0]} Set test message to:\nA non HTML html=False
+ Check Log Message ${tc[1, 0]} Set test message to:\nA non HTML <message>&its HTML continuation html=True
+
+Append non-HTML to HTML with separator
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Log Message ${tc[0, 0]} Set test message to:\nA HTML message html=True
+ Check Log Message ${tc[1, 0]} Set test message to:\nA HTML message<\br>its non-HTML <continuation> html=True
+
+Append HTML to HTML with separator
+ ${tc} = Check Test Case ${TEST NAME}
+ Check Log Message ${tc[0, 0]} Set test message to:\nA HTML message html=True
+ Check Log Message ${tc[1, 0]} Set test message to:\nA HTML message && its HTML continuation html=True
diff --git a/atest/robot/standard_libraries/builtin/setting_variables.robot b/atest/robot/standard_libraries/builtin/setting_variables.robot
index d1e11227a76..18aa6b8d2b0 100644
--- a/atest/robot/standard_libraries/builtin/setting_variables.robot
+++ b/atest/robot/standard_libraries/builtin/setting_variables.robot
@@ -8,23 +8,23 @@ Resource atest_resource.robot
*** Test Cases ***
Set Variable
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} \${var} = Hello
+ Check Log Message ${tc[0, 0]} \${var} = Hello
Set Variable With More Or Less Than One Value
Check Test Case ${TESTNAME}
Set Local Variable - Scalars
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[1].msgs[0]} \${scalar} = Hello world
+ Check Log Message ${tc[1, 0]} \${scalar} = Hello world
Set Local Variable - Lists
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[3].msgs[0]} \@{list} = [ One | Two | Three ]
- Check Log Message ${tc.kws[6].msgs[0]} \@{list} = [ 1 | 2 | 3 ]
+ Check Log Message ${tc[3, 0]} \@{list} = [ One | Two | Three ]
+ Check Log Message ${tc[6, 0]} \@{list} = [ 1 | 2 | 3 ]
Set Local Variable - Dicts
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[4].msgs[0]} \&{DICT} = { a=1 | 2=b }
+ Check Log Message ${tc[4, 0]} \&{DICT} = { a=1 | 2=b }
Set Local Variables Overrides Test Variables
Check Test Case ${TESTNAME}
@@ -56,7 +56,7 @@ Set Test Variable Needing Escaping
Set Test Variable Affect Subsequent Keywords
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].doc} Makes a variable available everywhere within the scope of the current test.
+ Should Be Equal ${tc[0].doc} Makes a variable available everywhere within the scope of the current test.
Set Test Variable In User Keyword
Check Test Case ${TESTNAME}
@@ -67,12 +67,18 @@ Set Test Variable Not Affecting Other Tests
Test Variables Set In One Suite Are Not Available In Another
Check Test Case ${TESTNAME}
-Set Test Variable cannot be used in suite setup or teardown
+Test variables set on suite level is not seen in tests
+ Check Test Case ${TESTNAME}
+
+Test variable set on suite level does not hide existing suite variable
+ Check Test Case ${TESTNAME}
+
+Test variable set on suite level can be overridden as suite variable
Check Test Case ${TESTNAME}
Set Task Variable as alias for Set Test Variable
${tc} = Check Test Case ${TESTNAME}
- Should Be Equal ${tc.kws[0].doc} Makes a variable available everywhere within the scope of the current task.
+ Should Be Equal ${tc[0].doc} Makes a variable available everywhere within the scope of the current task.
Set Suite Variable
Check Test Case ${TESTNAME} 1
diff --git a/atest/robot/standard_libraries/builtin/should_be_equal.robot b/atest/robot/standard_libraries/builtin/should_be_equal.robot
index 30f8f35dd31..9469e0caf25 100644
--- a/atest/robot/standard_libraries/builtin/should_be_equal.robot
+++ b/atest/robot/standard_libraries/builtin/should_be_equal.robot
@@ -5,11 +5,11 @@ Resource builtin_resource.robot
*** Test Cases ***
Basics
${tc}= Check test case ${TESTNAME}
- Verify argument type message ${tc.kws[0].msgs[0]}
- Verify argument type message ${tc.kws[1].msgs[0]}
- Verify argument type message ${tc.kws[2].msgs[0]} float int
- Verify argument type message ${tc.kws[3].msgs[0]} bytes bytes
- Verify argument type message ${tc.kws[4].msgs[0]}
+ Verify argument type message ${tc[0, 0]}
+ Verify argument type message ${tc[1, 0]}
+ Verify argument type message ${tc[2, 0]} float int
+ Verify argument type message ${tc[3, 0]} bytes bytes
+ Verify argument type message ${tc[4, 0]}
Case-insensitive
Check Test Case ${TESTNAME}
@@ -37,11 +37,11 @@ Fails without values
Multiline comparison uses diff
${tc} = Check test case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[1]} foo\nbar\ndar\n\n!=\n\nfoo\nbar\ngar\n\ndar
+ Check Log Message ${tc[0, 1]} foo\nbar\ndar\n\n!=\n\nfoo\nbar\ngar\n\ndar
Multiline comparison with custom message
${tc} = Check test case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[1]} foo\nbar\ndar\n\n!=\n\nfoo\nbar\ngar\n\ndar
+ Check Log Message ${tc[0, 1]} foo\nbar\ndar\n\n!=\n\nfoo\nbar\ngar\n\ndar
Multiline comparison requires both multiline
Check test case ${TESTNAME}
@@ -57,17 +57,17 @@ formatter=repr/ascii with non-ASCII characters
formatter=repr with multiline
${tc} = Check test case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[1]} foo\nbar\ndar\n\n!=\n\nfoo\nbar\ngar\n\ndar
+ Check Log Message ${tc[0, 1]} foo\nbar\ndar\n\n!=\n\nfoo\nbar\ngar\n\ndar
formatter=repr with multiline and different line endings
${tc} = Check test case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[1]} 1\n2\n3\n\n!=\n\n1\n2\n3
- Check Log Message ${tc.kws[1].msgs[1]} 1\n2\n3\n\n!=\n\n1\n2\n3
+ Check Log Message ${tc[0, 1]} 1\n2\n3\n\n!=\n\n1\n2\n3
+ Check Log Message ${tc[1, 1]} 1\n2\n3\n\n!=\n\n1\n2\n3
formatter=repr/ascii with multiline and non-ASCII characters
${tc} = Check test case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[1]} Å\nÄ\n\Ö\n\n!=\n\nÅ\nÄ\n\Ö
- Check Log Message ${tc.kws[1].msgs[1]} Å\nÄ\n\Ö\n\n!=\n\nÅ\nÄ\n\Ö
+ Check Log Message ${tc[0, 1]} Å\nÄ\n\Ö\n\n!=\n\nÅ\nÄ\n\Ö
+ Check Log Message ${tc[1, 1]} Å\nÄ\n\Ö\n\n!=\n\nÅ\nÄ\n\Ö
Invalid formatter
Check test case ${TESTNAME}
@@ -80,22 +80,22 @@ Dictionaries of different type with same items pass
Bytes containing non-ascii characters
${tc}= Check test case ${TESTNAME}
- Verify argument type message ${tc.kws[0].msgs[0]} bytes bytes
- Verify argument type message ${tc.kws[1].msgs[0]} bytes bytes
+ Verify argument type message ${tc[0, 0]} bytes bytes
+ Verify argument type message ${tc[1, 0]} bytes bytes
Unicode and bytes with non-ascii characters
${tc}= Check test case ${TESTNAME}
- Verify argument type message ${tc.kws[0].msgs[0]} bytes str
+ Verify argument type message ${tc[0, 0]} bytes str
Types info is added if string representations are same
${tc}= Check test case ${TESTNAME}
- Verify argument type message ${tc.kws[0].msgs[0]} str int
+ Verify argument type message ${tc[0, 0]} str int
Should Not Be Equal
${tc}= Check test case ${TESTNAME}
- Verify argument type message ${tc.kws[0].msgs[0]} str str
- Verify argument type message ${tc.kws[1].msgs[0]} str int
- Verify argument type message ${tc.kws[2].msgs[0]} str str
+ Verify argument type message ${tc[0, 0]} str str
+ Verify argument type message ${tc[1, 0]} str int
+ Verify argument type message ${tc[2, 0]} str str
Should Not Be Equal case-insensitive
Check Test Case ${TESTNAME}
@@ -117,6 +117,6 @@ Should Not Be Equal and collapse spaces
Should Not Be Equal with bytes containing non-ascii characters
${tc}= Check test case ${TESTNAME}
- Verify argument type message ${tc.kws[0].msgs[0]} bytes bytes
- Verify argument type message ${tc.kws[1].msgs[0]} bytes str
- Verify argument type message ${tc.kws[2].msgs[0]} bytes bytes
+ Verify argument type message ${tc[0, 0]} bytes bytes
+ Verify argument type message ${tc[1, 0]} bytes str
+ Verify argument type message ${tc[2, 0]} bytes bytes
diff --git a/atest/robot/standard_libraries/builtin/should_be_equal_as_xxx.robot b/atest/robot/standard_libraries/builtin/should_be_equal_as_xxx.robot
index 15d42822d4e..c571788cffc 100644
--- a/atest/robot/standard_libraries/builtin/should_be_equal_as_xxx.robot
+++ b/atest/robot/standard_libraries/builtin/should_be_equal_as_xxx.robot
@@ -5,35 +5,35 @@ Resource builtin_resource.robot
*** Test Cases ***
Should Be Equal As Integers
${tc}= Check test case ${TESTNAME}
- Verify argument type message ${tc.kws[0].msgs[0]}
+ Verify argument type message ${tc[0, 0]}
Should Be Equal As Integers with base
Check test case ${TESTNAME}
Should Not Be Equal As Integers
${tc}= Check test case ${TESTNAME}
- Verify argument type message ${tc.kws[0].msgs[0]}
+ Verify argument type message ${tc[0, 0]}
Should Not Be Equal As Integers with base
Check test case ${TESTNAME}
Should Be Equal As Numbers
${tc}= Check test case ${TESTNAME}
- Verify argument type message ${tc.kws[0].msgs[0]}
+ Verify argument type message ${tc[0, 0]}
Should Be Equal As Numbers with precision
Check test case ${TESTNAME}
Should Not Be Equal As Numbers
${tc}= Check test case ${TESTNAME}
- Verify argument type message ${tc.kws[0].msgs[0]}
+ Verify argument type message ${tc[0, 0]}
Should Not Be Equal As Numbers with precision
Check test case ${TESTNAME}
Should Be Equal As Strings
${tc}= Check test case ${TESTNAME}
- Verify argument type message ${tc.kws[0].msgs[0]} int
+ Verify argument type message ${tc[0, 0]} int
Should Be Equal As Strings does NFC normalization
Check test case ${TESTNAME}
@@ -70,7 +70,7 @@ Should Be Equal As Strings repr multiline
Should Not Be Equal As Strings
${tc}= Check test case ${TESTNAME}
- Verify argument type message ${tc.kws[0].msgs[0]} str float
+ Verify argument type message ${tc[0, 0]} str float
Should Not Be Equal As Strings case-insensitive
Check test case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/builtin/should_be_equal_type_conversion.robot b/atest/robot/standard_libraries/builtin/should_be_equal_type_conversion.robot
new file mode 100644
index 00000000000..752d7ad340b
--- /dev/null
+++ b/atest/robot/standard_libraries/builtin/should_be_equal_type_conversion.robot
@@ -0,0 +1,37 @@
+*** Settings ***
+Suite Setup Run Tests ${EMPTY} standard_libraries/builtin/should_be_equal_type_conversion.robot
+Resource atest_resource.robot
+
+*** Test Cases ***
+Convert second argument using `type`
+ Check Test Case ${TESTNAME}
+
+Automatic `type`
+ Check Test Case ${TESTNAME}
+
+Automatic `type` doesn't handle nested types
+ Check Test Case ${TESTNAME}
+
+First argument must match `type`
+ Check Test Case ${TESTNAME}
+
+Conversion fails with `type`
+ Check Test Case ${TESTNAME}
+
+Invalid type with `type`
+ Check Test Case ${TESTNAME}
+
+Convert both arguments using `types`
+ Check Test Case ${TESTNAME}
+
+Conversion fails with `types`
+ Check Test Case ${TESTNAME}
+
+Invalid type with `types`
+ Check Test Case ${TESTNAME}
+
+Cannot use both `type` and `types`
+ Check Test Case ${TESTNAME}
+
+Automatic type doesn't work with `types`
+ Check Test Case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/builtin/should_contain.robot b/atest/robot/standard_libraries/builtin/should_contain.robot
index 148c1dc50ba..2e90122a0d2 100644
--- a/atest/robot/standard_libraries/builtin/should_contain.robot
+++ b/atest/robot/standard_libraries/builtin/should_contain.robot
@@ -27,6 +27,12 @@ Should Contain and do not collapse spaces
Should Contain and collapse spaces
Check Test Case ${TESTNAME}
+Should Contain with bytes
+ Check Test Case ${TESTNAME}
+
+Should Contain with bytearray
+ Check Test Case ${TESTNAME}
+
Should Not Contain
Check test case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/builtin/sleep.robot b/atest/robot/standard_libraries/builtin/sleep.robot
index 9ff1a8fad74..454392bdafa 100644
--- a/atest/robot/standard_libraries/builtin/sleep.robot
+++ b/atest/robot/standard_libraries/builtin/sleep.robot
@@ -5,19 +5,19 @@ Resource atest_resource.robot
*** Test Cases ***
Sleep
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[1].msgs[0]} Slept 1 second 111 milliseconds.
- Check Log Message ${tc.kws[3].msgs[0]} Slept 1 second 234 milliseconds.
- Check Log Message ${tc.kws[5].msgs[0]} Slept 1 second 112 milliseconds.
+ Check Log Message ${tc[1, 0]} Slept 1 second 111 milliseconds.
+ Check Log Message ${tc[3, 0]} Slept 1 second 234 milliseconds.
+ Check Log Message ${tc[5, 0]} Slept 1 second 112 milliseconds.
Sleep With Negative Time
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[1].msgs[0]} Slept 0 seconds.
- Check Log Message ${tc.kws[2].msgs[0]} Slept 0 seconds.
+ Check Log Message ${tc[1, 0]} Slept 0 seconds.
+ Check Log Message ${tc[2, 0]} Slept 0 seconds.
Sleep With Reason
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Slept 42 milliseconds.
- Check Log Message ${tc.kws[0].msgs[1]} No good reason
+ Check Log Message ${tc[0, 0]} Slept 42 milliseconds.
+ Check Log Message ${tc[0, 1]} No good reason
Invalid Time Does Not Cause Uncatchable Error
Check Test Case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/builtin/tags.robot b/atest/robot/standard_libraries/builtin/tags.robot
index 886fde4cf54..0a4bf8eca0e 100644
--- a/atest/robot/standard_libraries/builtin/tags.robot
+++ b/atest/robot/standard_libraries/builtin/tags.robot
@@ -1,61 +1,61 @@
*** Settings ***
-Suite Setup Run Tests ${EMPTY} standard_libraries/builtin/tags
-Resource atest_resource.robot
+Suite Setup Run Tests ${EMPTY} standard_libraries/builtin/tags
+Resource atest_resource.robot
*** Variables ***
-@{SUITE_TAGS} default force force-init set set-init
+@{SUITE_TAGS} default force force-init set set-init
*** Test Cases ***
Set And Remove Tags In Suite Level
- Should Have Only Suite Tags Set And Remove Tags In Suite Level
+ Should Have Only Suite Tags Set And Remove Tags In Suite Level
Set No Tags
- Should Have Only Suite Tags Set No Tags
+ Should Have Only Suite Tags Set No Tags
Set One Tag
- ${tc} = Tags Should Have Been Added Set One Tag one
- Check Log Message ${tc.kws[0].msgs[0]} Set tag 'one'.
+ ${tc} = Tags Should Have Been Added Set One Tag one
+ Check Log Message ${tc[0, 0]} Set tag 'one'.
Set Multiple Tags
- ${tc} = Tags Should Have Been Added Set Multiple Tags 1 2 3 HELLO Some spaces here
- Check Log Message ${tc.kws[0].msgs[0]} Set tags '1', '2' and '3'.
- Check Log Message ${tc.kws[1].msgs[0]} Set tags 'HELLO', '' and 'Some spaces here'.
+ ${tc} = Tags Should Have Been Added Set Multiple Tags 1 2 3 HELLO Some spaces here
+ Check Log Message ${tc[0, 0]} Set tags '1', '2' and '3'.
+ Check Log Message ${tc[1, 0]} Set tags 'HELLO', '' and 'Some spaces here'.
Tags Set In One Test Are Not Visible To Others
- Should Have Only Suite Tags Tags Set In One Test Are Not Visible To Others
+ Should Have Only Suite Tags Tags Set In One Test Are Not Visible To Others
Remove No Tags
- Should Have Only Suite Tags Remove No Tags
+ Should Have Only Suite Tags Remove No Tags
Remove One Tag
- ${tc} = Tags Should Have Been Removed Remove One Tag force
- Check Log Message ${tc.kws[0].msgs[0]} Removed tag 'force'.
+ ${tc} = Tags Should Have Been Removed Remove One Tag force
+ Check Log Message ${tc[0, 0]} Removed tag 'force'.
Remove Non-Existing Tag
- Should Have Only Suite Tags Remove Non-Existing Tag
+ Should Have Only Suite Tags Remove Non-Existing Tag
Remove Multiple Tags
- ${tc} = Tags Should Have Been Removed Remove Multiple Tags default set set-init
- Check Log Message ${tc.kws[0].msgs[0]} Removed tags 'default', 'SET' and 'non-existing'.
- Check Log Message ${tc.kws[1].msgs[0]} Removed tags '' and 'set-init'.
+ ${tc} = Tags Should Have Been Removed Remove Multiple Tags default set set-init
+ Check Log Message ${tc[0, 0]} Removed tags 'default', 'SET' and 'non-existing'.
+ Check Log Message ${tc[1, 0]} Removed tags '' and 'set-init'.
Remove Tags With Pattern
- Check Test Tags Remove Tags With Pattern
+ Check Test Tags Remove Tags With Pattern
Tags Removed In One Test Are Not Removed From Others
- Should Have Only Suite Tags Tags Removed In One Test Are Not Removed From Others
+ Should Have Only Suite Tags Tags Removed In One Test Are Not Removed From Others
Set And Remove Tags In A User Keyword
- Check Test Tags Set And Remove Tags In A User Keyword tc uk uk2
+ Check Test Tags Set And Remove Tags In A User Keyword tc uk uk2
Set Tags In Test Setup
- Check Test Tags Set Tags In Test Setup set-init setup tag
+ Check Test Tags Set Tags In Test Setup set-init setup tag
Set Tags In Test Teardown
- Check Test Tags Set Tags In Test Teardown set-init teardown
+ Check Test Tags Set Tags In Test Teardown set-init teardown
Using Set And Remove Tags In Suite Teardown Fails
- Should Be Equal ${SUITE.suites[1].message} Suite teardown failed:\n'Set Tags' cannot be used in suite teardown.
+ Should Be Equal ${SUITE.suites[1].message} Suite teardown failed:\n'Set Tags' cannot be used in suite teardown.
Modifying ${TEST TAGS} after setting them has no affect on tags test has
Check Test Tags ${TEST NAME} force-init set-init new
@@ -65,19 +65,19 @@ Modifying ${TEST TAGS} after removing them has no affect on tags test has
*** Keywords ***
Should Have Only Suite Tags
- [Arguments] ${testname}
- Check Test Tags ${testname} @{SUITE_TAGS}
+ [Arguments] ${testname}
+ Check Test Tags ${testname} @{SUITE_TAGS}
Tags Should Have Been Added
- [Arguments] ${testname} @{added}
- @{tags} = Create List @{SUITE_TAGS} @{added}
- Sort List ${tags}
- ${tc} = Check Test Tags ${testname} @{tags}
- RETURN ${tc}
+ [Arguments] ${testname} @{added}
+ @{tags} = Create List @{SUITE_TAGS} @{added}
+ Sort List ${tags}
+ ${tc} = Check Test Tags ${testname} @{tags}
+ RETURN ${tc}
Tags Should Have Been Removed
- [Arguments] ${testname} @{removed}
- @{tags} = Copy List ${SUITE_TAGS}
- Remove Values From List ${tags} @{removed}
- ${tc} = Check Test Tags ${testname} @{tags}
- RETURN ${tc}
+ [Arguments] ${testname} @{removed}
+ @{tags} = Copy List ${SUITE_TAGS}
+ Remove Values From List ${tags} @{removed}
+ ${tc} = Check Test Tags ${testname} @{tags}
+ RETURN ${tc}
diff --git a/atest/robot/standard_libraries/builtin/used_in_custom_libs_and_listeners.robot b/atest/robot/standard_libraries/builtin/used_in_custom_libs_and_listeners.robot
index 2da3f4a1019..0f7eea8c51f 100644
--- a/atest/robot/standard_libraries/builtin/used_in_custom_libs_and_listeners.robot
+++ b/atest/robot/standard_libraries/builtin/used_in_custom_libs_and_listeners.robot
@@ -1,38 +1,65 @@
*** Settings ***
-Documentation These tests mainly verify that using BuiltIn externally does not cause importing problems as in
-... https://github.com/robotframework/robotframework/issues/654.
-... There are separate tests for creating and registering Run Keyword variants.
-Suite Setup Run Tests --listener ${CURDIR}/listener_using_builtin.py standard_libraries/builtin/used_in_custom_libs_and_listeners.robot
+Suite Setup Run Tests
+... --listener ${CURDIR}/listener_using_builtin.py
+... standard_libraries/builtin/used_in_custom_libs_and_listeners.robot
Resource atest_resource.robot
*** Test Cases ***
Keywords Using BuiltIn
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Log level changed from INFO to DEBUG. DEBUG
- Check Log Message ${tc.kws[0].msgs[1]} Hello, debug world! DEBUG
+ Check Log Message ${tc[0, 0]} Log level changed from NONE to DEBUG. DEBUG
+ Check Log Message ${tc[0, 1]} Hello, debug world! DEBUG
+ Length should be ${tc[0].messages} 2
Listener Using BuiltIn
Check Test Case ${TESTNAME}
Use 'Run Keyword' with non-Unicode values
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} 42
- Check Log Message ${tc.kws[0].kws[1].msgs[0]} \\xff
+ Check Log Message ${tc[0, 0, 0]} 42
+ Check Log Message ${tc[0, 1, 0]} \xff
Use BuiltIn keywords with timeouts
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]} Test timeout 1 day active. * seconds left. level=DEBUG pattern=True
- Check Log Message ${tc.kws[0].msgs[1]} Log level changed from INFO to DEBUG. DEBUG
- Check Log Message ${tc.kws[0].msgs[2]} Hello, debug world! DEBUG
- Check Log Message ${tc.kws[3].kws[0].msgs[0]} Test timeout 1 day active. * seconds left. level=DEBUG pattern=True
- Check Log Message ${tc.kws[3].kws[0].msgs[1]} 42
- Check Log Message ${tc.kws[3].kws[1].msgs[0]} Test timeout 1 day active. * seconds left. level=DEBUG pattern=True
- Check Log Message ${tc.kws[3].kws[1].msgs[1]} \\xff
+ Check Log Message ${tc[0, 0]} Log level changed from NONE to DEBUG. DEBUG
+ Check Log Message ${tc[0, 1]} Hello, debug world! DEBUG
+ Length should be ${tc[0].messages} 2
+ Check Log Message ${tc[3, 0]} Test timeout 1 day active. * seconds left. level=DEBUG pattern=True
+ Check Log Message ${tc[3, 1, 0]} Test timeout 1 day active. * seconds left. level=DEBUG pattern=True
+ Check Log Message ${tc[3, 1, 1]} 42
+ Check Log Message ${tc[3, 2, 0]} Test timeout 1 day active. * seconds left. level=DEBUG pattern=True
+ Check Log Message ${tc[3, 2, 1]} \xff
User keyword used via 'Run Keyword'
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} This is x-911-zzz
+ Check Log Message ${tc[0, 0]} Before
+ Check Log Message ${tc[0, 1, 0, 0]} This is x-911-zzz
+ Check Log Message ${tc[0, 2]} After
User keyword used via 'Run Keyword' with timeout and trace level
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[1]} This is x-911-zzz
+ Check Log Message ${tc[0, 0]} Arguments: [ \ ] level=TRACE
+ Check Log Message ${tc[0, 1]} Test timeout 1 day active. * seconds left. level=DEBUG pattern=True
+ Check Log Message ${tc[0, 2]} Before
+ Check Log Message ${tc[0, 3, 0]} Arguments: [ \${x}='This is x' | \${y}=911 | \${z}='zzz' ] level=TRACE
+ Check Log Message ${tc[0, 3, 1, 0]} Arguments: [ 'This is x-911-zzz' ] level=TRACE
+ Check Log Message ${tc[0, 3, 1, 1]} Keyword timeout 1 hour active. * seconds left. level=DEBUG pattern=True
+ Check Log Message ${tc[0, 3, 1, 2]} This is x-911-zzz
+ Check Log Message ${tc[0, 3, 1, 3]} Return: None level=TRACE
+ Check Log Message ${tc[0, 3, 2]} Return: None level=TRACE
+ Check Log Message ${tc[0, 4]} After
+ Check Log Message ${tc[0, 5]} Return: None level=TRACE
+
+Recursive 'Run Keyword' usage
+ ${tc} = Check Test Case ${TESTNAME}
+ Check Log Message ${tc[0, 0, 0]} 1
+ Check Log Message ${tc[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0]} 10
+
+Recursive 'Run Keyword' usage with timeout
+ Check Test Case ${TESTNAME}
+
+Timeout when running keyword that logs huge message
+ Check Test Case ${TESTNAME}
+
+Timeout in parent keyword after running keyword
+ Check Test Case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/builtin/wait_until_keyword_succeeds.robot b/atest/robot/standard_libraries/builtin/wait_until_keyword_succeeds.robot
index 840c3e50d91..da2e5d8b791 100644
--- a/atest/robot/standard_libraries/builtin/wait_until_keyword_succeeds.robot
+++ b/atest/robot/standard_libraries/builtin/wait_until_keyword_succeeds.robot
@@ -6,20 +6,20 @@ Resource atest_resource.robot
Fail Because Timeout exceeded
${tc} = Check Test Case ${TESTNAME}
# Cannot test exactly how many times kw is run because it depends on interpreter speed.
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} Still 2 times to fail! FAIL
- Should Be True len($tc.kws[0].kws) < 4
+ Check Log Message ${tc[0, 0, 0]} Still 2 times to fail! FAIL
+ Should Be True len($tc[0].non_messages) < 4
Pass with first Try
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} Used to test that variable name, not value, is shown in arguments
- Length Should Be ${tc.kws[0].kws} 1
+ Check Log Message ${tc[0, 0, 0]} Used to test that variable name, not value, is shown in arguments
+ Length Should Be ${tc[0].body} 1
Pass With Some Medium Try
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].msgs[0]} Still 2 times to fail! FAIL
- Check Log Message ${tc.kws[0].kws[1].msgs[0]} Still 1 times to fail! FAIL
- Check Log Message ${tc.kws[0].kws[2].msgs[0]} Still 0 times to fail! FAIL
- Length Should Be ${tc.kws[0].kws} 4
+ Check Log Message ${tc[0, 0, 0]} Still 2 times to fail! FAIL
+ Check Log Message ${tc[0, 1, 0]} Still 1 times to fail! FAIL
+ Check Log Message ${tc[0, 2, 0]} Still 0 times to fail! FAIL
+ Length Should Be ${tc[0].body} 4
Pass With Last Possible Try
Check Test Case ${TESTNAME}
@@ -83,37 +83,37 @@ Retry if wrong number of arguments
Retry if variable is not found
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} Variable '\${nonexisting}' not found. FAIL
- Check Log Message ${tc.kws[0].kws[1].kws[0].msgs[0]} Variable '\${nonexisting}' not found. FAIL
- Check Log Message ${tc.kws[0].kws[2].kws[0].msgs[0]} Variable '\${nonexisting}' not found. FAIL
- Length Should Be ${tc.kws[0].kws} 3
+ Check Log Message ${tc[0, 0, 0, 0]} Variable '\${nonexisting}' not found. FAIL
+ Check Log Message ${tc[0, 1, 0, 0]} Variable '\${nonexisting}' not found. FAIL
+ Check Log Message ${tc[0, 2, 0, 0]} Variable '\${nonexisting}' not found. FAIL
+ Length Should Be ${tc[0].non_messages} 3
Pass With Initially Nonexisting Variable Inside Wait Until Keyword Succeeds
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].kws[0].kws[0].msgs[0]} Variable '\${created after accessing first time}' not found. FAIL
- Check Log Message ${tc.kws[0].kws[1].kws[0].msgs[0]} created in keyword teardown
- Length Should Be ${tc.kws[0].kws} 2
+ Check Log Message ${tc[0, 0, 0, 0]} Variable '\${created after accessing first time}' not found. FAIL
+ Check Log Message ${tc[0, 1, 0, 0]} created in keyword teardown
+ Length Should Be ${tc[0].body} 2
Variable Values Should Not Be Visible In Keyword Arguments
${tc} = Check Test Case Pass With First Try
- Check Keyword Data ${tc.kws[0].kws[0]} BuiltIn.Log args=\${HELLO}
+ Check Keyword Data ${tc[0, 0]} BuiltIn.Log args=\${HELLO}
Strict retry interval
${tc} = Check Test Case ${TESTNAME}
- Length Should Be ${tc.body[0].kws} 4
- Elapsed Time Should Be Valid ${tc.body[0].elapsed_time} minimum=0.3 maximum=0.9
+ Length Should Be ${tc[0].body} 4
+ Elapsed Time Should Be Valid ${tc[0].elapsed_time} minimum=0.3 maximum=0.9
Fail with strict retry interval
${tc} = Check Test Case ${TESTNAME}
- Length Should Be ${tc.body[0].kws} 3
- Elapsed Time Should Be Valid ${tc.body[0].elapsed_time} minimum=0.2 maximum=0.6
+ Length Should Be ${tc[0].non_messages} 3
+ Elapsed Time Should Be Valid ${tc[0].elapsed_time} minimum=0.2 maximum=0.6
Strict retry interval violation
${tc} = Check Test Case ${TESTNAME}
- Length Should Be ${tc.body[0].kws} 4
- Elapsed Time Should Be Valid ${tc.body[0].elapsed_time} minimum=0.4 maximum=1.2
+ Length Should Be ${tc[0].non_messages} 4
+ Elapsed Time Should Be Valid ${tc[0].elapsed_time} minimum=0.4 maximum=1.2
FOR ${index} IN 1 3 5 7
- Check Log Message ${tc.body[0].body[${index}]}
+ Check Log Message ${tc[0, ${index}]}
... Keyword execution time ??? milliseconds is longer than retry interval 100 milliseconds.
... WARN pattern=True
END
diff --git a/atest/robot/standard_libraries/collections/dictionaries_should_be_equal.robot b/atest/robot/standard_libraries/collections/dictionaries_should_be_equal.robot
index 17b59691d55..bf677da6fb9 100644
--- a/atest/robot/standard_libraries/collections/dictionaries_should_be_equal.robot
+++ b/atest/robot/standard_libraries/collections/dictionaries_should_be_equal.robot
@@ -65,3 +65,9 @@ Different values and custom error message with values
`ignore_case` when normalized keys have conflict
Check Test Case ${TESTNAME}
+
+`ignore_value_order` set to True
+ Check Test Case ${TESTNAME}
+
+`ignore_value_order` set to False and dictionaries have lists in different order
+ Check Test Case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/collections/dictionary.robot b/atest/robot/standard_libraries/collections/dictionary.robot
index a29ffc9646f..8a386a2a70b 100644
--- a/atest/robot/standard_libraries/collections/dictionary.robot
+++ b/atest/robot/standard_libraries/collections/dictionary.robot
@@ -18,9 +18,9 @@ Set To Dictionary With **kwargs
Remove From Dictionary
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Removed item with key 'b' and value '2'.
- Check Log Message ${tc.kws[0].msgs[1]} Key 'x' not found.
- Check Log Message ${tc.kws[0].msgs[2]} Key '2' not found.
+ Check Log Message ${tc[0, 0]} Removed item with key 'b' and value '2'.
+ Check Log Message ${tc[0, 1]} Key 'x' not found.
+ Check Log Message ${tc[0, 2]} Key '2' not found.
Keep In Dictionary
Check Test Case ${TEST NAME}
@@ -72,17 +72,17 @@ Log Dictionary With Different Log Levels
... a: 1
... b: 2
... c:
- Check Log Message ${tc.kws[0].msgs[0]} ${expected} INFO
- Should Be Empty ${tc.kws[1].msgs}
- Check Log Message ${tc.kws[2].msgs[0]} ${expected} WARN
- Check Log Message ${tc.kws[3].msgs[0]} ${expected} DEBUG
- Check Log Message ${tc.kws[4].msgs[0]} ${expected} INFO
+ Check Log Message ${tc[0, 0]} ${expected} INFO
+ Should Be Empty ${tc[1].body}
+ Check Log Message ${tc[2, 0]} ${expected} WARN
+ Check Log Message ${tc[3, 0]} ${expected} DEBUG
+ Check Log Message ${tc[4, 0]} ${expected} INFO
Log Dictionary With Different Dictionaries
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} Dictionary is empty.
- Check Log Message ${tc.kws[1].msgs[0]} Dictionary has one item:\na: 1
- Check Log Message ${tc.kws[3].msgs[0]} Dictionary size is 3 and it contains following items:\nTrue: xxx\nfoo: []\n(1, 2, 3): 3.14
+ Check Log Message ${tc[0, 0]} Dictionary is empty.
+ Check Log Message ${tc[1, 0]} Dictionary has one item:\na: 1
+ Check Log Message ${tc[3, 0]} Dictionary size is 3 and it contains following items:\nTrue: xxx\nfoo: []\n(1, 2, 3): 3.14
Pop From Dictionary Without Default
Check Test Case ${TEST NAME}
diff --git a/atest/robot/standard_libraries/collections/dictionary_should_contain.robot b/atest/robot/standard_libraries/collections/dictionary_should_contain.robot
index 5534fa70333..c13ab3e559b 100644
--- a/atest/robot/standard_libraries/collections/dictionary_should_contain.robot
+++ b/atest/robot/standard_libraries/collections/dictionary_should_contain.robot
@@ -95,3 +95,9 @@ Should contain sub dictionary with `ignore_case`
`has_key` is not required
Check Test Case ${TESTNAME}
+
+Should contain sub dictionary with `ignore_value_order`
+ Check Test Case ${TESTNAME}
+
+Should contain sub dictionary with `ignore_value_order` set to False when dictionaries have lists in different order
+ Check Test Case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/collections/list.robot b/atest/robot/standard_libraries/collections/list.robot
index 636f6c60e42..75573b13e78 100644
--- a/atest/robot/standard_libraries/collections/list.robot
+++ b/atest/robot/standard_libraries/collections/list.robot
@@ -60,8 +60,8 @@ Remove From List With Invalid Index
Remove Duplicates
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} 0 duplicates removed.
- Check Log Message ${tc.kws[2].msgs[0]} 3 duplicates removed.
+ Check Log Message ${tc[0, 0]} 0 duplicates removed.
+ Check Log Message ${tc[2, 0]} 3 duplicates removed.
Count Values In List
Check Test Case ${TEST NAME}
@@ -149,19 +149,19 @@ List Should Not Contain Duplicates Is Case And Space Sensitive
List Should Not Contain Duplicates With One Duplicate
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[1].msgs[0]} 'item' found 2 times.
+ Check Log Message ${tc[1, 0]} 'item' found 2 times.
List Should Not Contain Duplicates With Multiple Duplicates
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[1].msgs[0]} '2' found 2 times.
- Check Log Message ${tc.kws[1].msgs[1]} 'None' found 2 times.
- Check Log Message ${tc.kws[1].msgs[2]} '4' found 4 times.
- Check Log Message ${tc.kws[1].msgs[3]} '[1, 2, 3]' found 2 times.
- Check Log Message ${tc.kws[1].msgs[4]} '[]' found 10 times.
+ Check Log Message ${tc[1, 0]} '2' found 2 times.
+ Check Log Message ${tc[1, 1]} 'None' found 2 times.
+ Check Log Message ${tc[1, 2]} '4' found 4 times.
+ Check Log Message ${tc[1, 3]} '[1, 2, 3]' found 2 times.
+ Check Log Message ${tc[1, 4]} '[]' found 10 times.
List Should Not Contain Duplicates With Custom Error Message
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[2].msgs[0]} '42' found 42 times.
+ Check Log Message ${tc[2, 0]} '42' found 42 times.
Lists Should Be Equal
Check Test Case ${TEST NAME}
@@ -211,6 +211,9 @@ List Should Contain Sub List
List Should Contain Sub List With Missing Values
Check Test Case ${TEST NAME}
+List Should Contain Sub List When The Only Missing Value Is Empty String
+ Check Test Case ${TEST NAME}
+
List Should Contain Sub List With Missing Values And Own Error Message
Check Test Case ${TEST NAME}
@@ -224,18 +227,18 @@ Log List With Different Log Levels
... 0: 11
... 1: 12
... 2: 13
- Check Log Message ${tc.kws[0].msgs[0]} ${expected} INFO
- Variable Should Not Exist ${tc.kws[1].msgs[0]}
- Check Log Message ${tc.kws[2].msgs[0]} ${expected} WARN
- Check Log Message ${tc.kws[3].msgs[0]} ${expected} DEBUG
- Check Log Message ${tc.kws[4].msgs[0]} ${expected} INFO
+ Check Log Message ${tc[0, 0]} ${expected} INFO
+ Variable Should Not Exist ${tc[1, 0]}
+ Check Log Message ${tc[2, 0]} ${expected} WARN
+ Check Log Message ${tc[3, 0]} ${expected} DEBUG
+ Check Log Message ${tc[4, 0]} ${expected} INFO
Log List With Different Lists
${tc} = Check Test Case ${TEST NAME}
- Check Log Message ${tc.kws[0].msgs[0]} List is empty. INFO
- Check Log Message ${tc.kws[1].msgs[0]} List has one item:\n1
- Check Log Message ${tc.kws[4].msgs[0]} List has one item:\n(1, 2, 3)
- Check Log Message ${tc.kws[6].msgs[0]} List length is 2 and it contains following items:\n0: (1, 2, 3)\n1: 3.12
+ Check Log Message ${tc[0, 0]} List is empty. INFO
+ Check Log Message ${tc[1, 0]} List has one item:\n1
+ Check Log Message ${tc[4, 0]} List has one item:\n(1, 2, 3)
+ Check Log Message ${tc[6, 0]} List length is 2 and it contains following items:\n0: (1, 2, 3)\n1: 3.12
Count Matches In List Case Insensitive
Check Test Case ${TEST NAME}
@@ -350,3 +353,6 @@ List Should Not Contain Duplicates With Ignore Case
List Should Contain Value With Ignore Case And Nested List and Dictionary
Check Test Case ${TEST NAME}
+
+Lists Should be equal with Ignore Case and Order
+ Check Test Case ${TEST NAME}
diff --git a/atest/robot/standard_libraries/dialogs/dialogs.robot b/atest/robot/standard_libraries/dialogs/dialogs.robot
index 4ecc2e49f5c..bb049c007e6 100644
--- a/atest/robot/standard_libraries/dialogs/dialogs.robot
+++ b/atest/robot/standard_libraries/dialogs/dialogs.robot
@@ -46,6 +46,21 @@ Get Value From User Shortcuts
Get Selection From User
Check Test Case ${TESTNAME}
+Get Selection From User When Default Value Provided by Index
+ Check Test Case ${TESTNAME}
+
+Get Selection From User When Default Value Provided by String
+ Check Test Case ${TESTNAME}
+
+Get Selection From User When Default Value Is Integer
+ Check Test Case ${TESTNAME}
+
+Get Selection From User When Default Value Index Is Out of Bounds
+ Check Test Case ${TESTNAME}
+
+Get Selection From User When Default Value Cannot Be Found
+ Check Test Case ${TESTNAME}
+
Get Selection From User Cancelled
Check Test Case ${TESTNAME}
@@ -66,3 +81,9 @@ Get Selections From User Exited
Multiple dialogs in a row
Check Test Case ${TESTNAME}
+
+Garbage Collection In Thread Should Not Cause Problems
+ Check Test Case ${TESTNAME}
+
+Timeout can close dialog
+ Check Test Case ${TESTNAME}
diff --git a/atest/robot/standard_libraries/easter.robot b/atest/robot/standard_libraries/easter.robot
index 7876de7afb4..cf8097982c5 100644
--- a/atest/robot/standard_libraries/easter.robot
+++ b/atest/robot/standard_libraries/easter.robot
@@ -8,6 +8,6 @@ Not None Shall Not Pass
None Shall Pass
${tc} = Check Test Case ${TESTNAME}
- Check Log Message ${tc.kws[0].msgs[0]}
+ Check Log Message ${tc[0, 0]}
...