-
Notifications
You must be signed in to change notification settings - Fork 2
Test script shorthands
Home - Test script shorthands
The command below compiles the PsychoJS library, deploy test experiments (insofar required), and run the tests, all in one go. It can be configured via Testrun CLI options, the deployExperiments CLI options, and these CLI options:
-
--compileAlso compile the test-experiments before deploying them -
--nocssDon't build the CSS parts of the PsychoJS library -
--nojsDon't build the JS of the PsychoJS library -
--notestsDon't run any tests -
--beepPlay a beep when the command has finished
node test.cjs
- Build the PsychoJS library:
npm run build:css && npm run build:js - Perform any Karma tests that match the
labelCLI option. - Deploy test experiments for any WebdriverIO tests that match the
labelCLI option. - Perform any WebdriverIO tests that match the
labelCLI option.
Run a test with the following settings:
- Compile the PsychoJS library
- Deploy the test-experiments that match the label "wdio_img" to the stager
- Use the local Selenium sever
- Use the local web-server
node test.cjs --server local --url local --label wdio_img
This use case also has a "super-shorthand command":
npm start karma_formattedString
Note this test requires features only available to the PsychoPy/PsychoJS team
Run a test with the following settings:
- Compile the PsychoJS library
- Deploy the test-experiments that match the label "full" to the stager
- Use BrowserStack as Selenium/Appium server
- Use the stager as web-server (with experiments hosted at the URL
https://staging.psychopy.org/experiments/<branch>/{{experiment}}) - Run tests that match the label "full"
- Use thomas as name for the branch
- Use my_testrun as name for the testrun
- Run the tests on each platform that is part of the platform subset
- Upload the testlogs to the PsychoPy staging server, where they will be available at
https://staging.psychopy.org/report_wdio/thomas/my_testrun/andhttps://staging.psychopy.org/report_karma/thomas/my_testrun/
node test.cjs --platform * --subset --server bs --branch thomas --testrun my_testrun --url stager --uploadExperiments --uploadResults --label full
The shorthands below automatically build and deploy a test-experiment when something changes to PsychoPy, PsychoJS, or the test-experiment itself.
On a change in PsychoPy, PsychoJS, or the test-experiment, rebuild the library, compile the test-experiment, and deploy it
The command below watches the directories below for changes. If a change occurs, it builds both the JS and CSS part of PsychoJS, and compiles and deployes the experiment with label wdio_img. Note that this command is comprehensive, but also relatively slow. The other commands in this section are faster, because they only watch for specific parts of PsychoPy, PsychoJS, and a test-experiment, and then only perform the building steps required for reflecting that change.
-
src/directory in the PsychoJS repo -
psychopy/directory in the PsychoPy repo -
tests/directory in the psychojs_testing repo
npm run watch_all wdio_img
The command below watches the src/ directory in the PsychoJS repo for any changes. If a change occurs, it builds the JS part of PsychoJS, deploys the experiment with label wdio_img, and plays two beeps when done.
npm run watch_psychojs_js wdio_img
The command below watches the src/ directory in the PsychoJS repo for any changes. If a change occurs, it builds the CSS part of PsychoJS, deploys the experiment with label wdio_img, and plays two beeps when done.
npm run watch_psychojs_css wdio_img
The command below watches the tests/ directory in the psychojs_testing repo for any changes. If a change occurs, it compiles and deploys the experiment with label wdio_img, and plays two beeps when done.
npm run watch_experiment wdio_img
The command below watches the psychopy/ directory in the PsychoPy repo for any changes. If a change occurs, it compiles and deploys the experiment with label wdio_img, and plays two beeps when done.
npm run watch_psychopy wdio_img