IDE Configuration

Run a test from your IDE

Eclipse

In External Tools Configurations add a new tool of type Program with the following settings (changing “stb-tester-e5a091e40de1” in the fields below to the actual ID of your Stb-tester node):

  • Name: Run selected test on stb-tester-e5a091e40de1
  • Location: ${project_loc}/stbt_rig.py
  • Working Directory: ${project_loc}
  • Arguments: -v --node-id=stb-tester-e5a091e40de1 run tests/${selected_resource_name}::${selected_text}

Now you can double-click on the name of a test and click the “Run” button. This will automatically take a snapshot of your code and submit it to the Stb-tester portal (you don’t need to do a git commit first). The logs from the test will appear in the IDE’s console:

images/run-test.png

For more details about stbt_rig.py see Development Workflow.

The arguments above assume that the authorization token for the Stb-tester portal is already in your system keyring. You can set this up by running stbt_rig.py manually first, from your terminal. If that doesn’t work you can save your token to a file and add --portal-auth-file FILENAME to the arguments in the configuration above.

PyCharm

Go to Run > Edit Configurations and select Templates > Python tests > pytest. Fill in the following settings (changing “stb-tester-e5a091e40de1” in the fields below to the actual ID of your Stb-tester node):

  • Additional Arguments: --node-id=stb-tester-e5a091e40de1 -p no:python -p stbt_rig
  • Add content roots to PYTHONPATH: True

The configuration should now look like:

images/configuration.png

You can now run the current test with Ctrl-Shift-F10 or by clicking the green play button in the margin on the left and selecting “Run ‘pytest for …’”:

images/run-test1.png

For more details about stbt_rig.py see Development Workflow.

The arguments above assume that the authorization token for the Stb-tester portal is already in your system keyring. You can set this up by running stbt_rig.py manually first, from your terminal. If that doesn’t work you can save your token to a file and add --portal-auth-file FILENAME to the arguments in the configuration above.