Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Running test suite from Sublime Text

Tatu Aalto edited this page Mar 30, 2016 · 1 revision

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.

Configuration

There are three predefined configurations to run the test(s):

  1. Run all test from the test suite.
  2. Select the tests cases by tag.
  3. 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.

Running

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.

Clone this wiki locally