-
Notifications
You must be signed in to change notification settings - Fork 43
Running test suite from Sublime Text
It is possible to run test(s) from the currently active tab in the Sublime Text by using the
built system
from Sublime Text. The requirement to be able run the test is that python -m robot.run --version
works also from the command line and there is valid Robot Framework test suite open in the active tab.
There are three predefined configurations to run the test(s):
- Run all test from the test suite.
- Select the tests cases by tag.
- Select the test cases by name.
To be able to select the test cases, by tag or the name, user must configure the build system from Preferences | Package settings | Robot Framework Assistan | Edit Build Configuration |. The file contains json configuration file and by default is like this:
{
"cmd": ["python", "-m", "robot.run", "$file"],
"selector": "source.robot",
"variants": [
{ "name": "Selects the test cases by tag",
"cmd": ["python", "-m", "robot.run", "--include", "REPLACE_WITH_TAG", "$file"],
},
{ "name": "Selects the test cases by name",
"cmd": ["python", "-m", "robot.run", "--test", "REPLACE_WITH_TEST_NAME", "$file"]
}
]
}
From the file, replace the REPLACE_WITH_TAG
and REPLACE_WITH_TEST_NAME
sections with values that match the user needs and save the file.
The built system can be run by pressing the F7
or Ctrl+B
. In the first run,
command palette appears to confirm which of the build system will be set to the default build system. The default build system can be changed by pressing the Crtl+Shift+B
and choosing the new default build system from the command palette.