Acceptance tests for Robot Framework are naturally created using Robot Framework itself. This folder contains all those acceptance tests and other test data they need.
robot folder.robot folder. See Test data section for details.testdata folder.
Some of these resources are also used by unit tests..gitignore and can be safely
deleted any time.Script to generate acceptance test runners (i.e. files under the robot
directory) based on the test data files (i.e. files under the testdata
directory). Mainly useful if there is one-to-one mapping between tests in
the testdata and robot directories.
Usage: atest/genrunner.py atest/testdata/path/data.robot [atest/robot/path/runner.robot]
Robot Framework's acceptance tests are executed using the run.py
script. It has two mandatory arguments, the Python interpreter to use
when running tests and path to tests to be executed, and it accepts also
all same options as Robot Framework. The script itself should always be
executed with Python 3.6 or newer. Run it with --help or see
documentation in its source code for more information.
To run all the acceptance tests, execute the atest/robot folder
entirely using the selected interpreter:
atest/run.py python atest/robot atest/run.py jython atest/robot
The commands above will execute all tests, but you typically want to skip
Telnet tests and tests requiring manual interaction. These tests are marked
with the no-ci tag and can be easily excluded:
atest/run.py python --exclude no-ci atest/robot
A sub test suite can be executed simply by running the folder or file containing it. On modern machines running all acceptance tests ought to take less than ten minutes with Python, but with Jython the execution time is considerably longer. This is due to Jython being somewhat slower than Python in general, but the main reason is that the JVM is started by acceptance tests dozens of times and that always takes a few seconds.
Before a release tests should be executed separately using Python, Jython, IronPython and PyPy to verify interoperability with all supported interpreters. Tests should also be run using different interpreter versions (when applicable) and on different operating systems.
The results of the test execution are written into an interpreter specific
directory under the atest/results directory. Temporary outputs created
during the execution are created under the system temporary directory.
The test data is divided into two, test data part (atest/testdata folder) and
running part (atest/robot folder). Test data side contains test cases for
different features. Running side contains the actual acceptance test cases
that run the test cases on the test data side and verify their results.
The basic mechanism to verify that a test case in the test data side is
executed as expected is setting the expected status and possible error
message in its documentation. By default tests are expected to pass, but
having FAIL (this and subsequent markers are case sensitive) in the
documentation changes the expectation. The text after the FAIL marker
is the expected error message, which, by default, must match the actual
error exactly. If the error message starts with REGEXP:, GLOB: or
STARTS:, the expected error is considered to be a regexp or glob pattern
matching the actual error, or to contain the beginning of the error. All
other details can be tested also, but that logic is in the running side.
The tests on the running side (atest/robot) contain tags that are used
to include or exclude them based on the platform and required dependencies.
Selecting tests based on the platform is done automatically by the run.py
script, but additional selection can be done by the user to avoid running
tests with preconditions that are not met.
manual or telnet.--exclude require-lxml
if needed.Examples:
# Exclude tests requiring manual interaction or running telnet server.
atest/run.py python --exclude no-ci atest/robot
# Same as the above but also exclude tests requiring docutils and lxml
atest/run.py python -e no-ci -e require-docutils -e require-lxml atest/robot
# Run only tests related to Java integration. This is considerably faster
# than running all tests on Jython.
atest/run.py jython --include require-jython atest/robot
Certain Robot Framework features require optional external modules or tools to be installed, and naturally tests related to these features require same modules/tools as well. This section lists what preconditions are needed to run all tests successfully. See Test tags for instructions how to avoid running certain tests if all preconditions are not met.
These Python modules need to be installed:
It is possible to install the above modules using pip either
individually or by using the provided requirements.txt file:
# Install individually
pip install 'docutils>=0.9'
pip install pygments
pip install pyyaml
pip install enum34 # Needed only with Python 2.
pip install lxml
# Install using requirements.txt
pip install -r atest/requirements.txt
Notice that the lxml module may require compilation on Linux, which in turn
may require installing development headers of lxml dependencies. Alternatively
lxml can be installed using a system package manager with a command like
sudo apt-get install python-lxml.
Because lxml is not compatible with Jython or IronPython, tests requiring it are excluded automatically when using these interpreters.
Screenshot library tests require a platform dependent module or tool that can take screenshots. See Screenshot library documentation for details.
tools.jar
When using Java 8 or earlier, Libdoc requires tools.jar, which is part
of the standard JDK installation, to be in CLASSPATH when reading library
documentation from Java source files. In addition to setting CLASSPATH
explicitly, it is possible to put tools.jar into the ext-lib
directory in the project root and CLASSPATH is set automatically.
Running telnet tests requires some extra setup. Instructions how to run them
can be found from testdata/standard_libraries/telnet/README.rst.
If you don't want to run an unprotected telnet server on your machine, you can
always skip these tests by excluding tests with a tag telnet or no-ci.
All content in the atest folder is under the following copyright:
Copyright 2008-2015 Nokia Networks
Copyright 2016- Robot Framework Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。