-
Notifications
You must be signed in to change notification settings - Fork 35
Run Tests
Jacky Sun edited this page Aug 13, 2024
·
29 revisions
node run.js [options]
-
-p, --project
: Specify the project to run tests on, e.g.,milo-live-chrome
. Use'all'
for all projects or a comma-separated list of projects. -
-c, --config
: Specify the name of the configuration file, e.g.,milo
. -
-g, --grep
: Filter tests by grep pattern, e.g.,'@milo'
. -
-r, --reporter
: Specify the reporter to use, e.g.,'html'
. -
-h, --help
: Display this help message and exit. -
--headed
: Run tests in headed mode. -
--headless
: Run tests in headless mode (default).
-
Run uar test on uar-live:
node run.js -c uar -g "@uar-quiz-basic-milo" -p uar-live-chrome
-
Run uar test on milo-live:
node run.js -c uar -g "@uar-quiz-basic-milo" -p milo-live-chrome
-
Run milo test on milo-live:
node run.js -c milo -g "@milo" -p milo-live-chrome
-
You can also use '=':
node run.js -c=milo -g="@milo" -p=milo-live-chrome
-
Or long options:
node run.js --config=milo --grep="@milo" --project=milo-live-chrome
-
Support run on all projects with
-p 'all'
:node run.js -c milo -p all -g "@milo"
-
Support run some projects with a comma-separated list of projects:
node run.js -c milo -p milo-live-chrome,milo-live-firefox -g "@milo"
We set testDir: '../tests/xxx'
in xxx.config.js
to control test scopes. In other words, you can't run others' tests, but you can run your tests on different websites.
For example, if you want to run milo tests on bacom, you need to add this into bacom.config.js
:
testDir: '../tests',
testMatch: ['bacom/**/*.test.js', 'milo/**/*.test.js'],
Then you can run milo tests on bacom:
node run.js -c bacom -p bacom-live-chrome -g "@accordion"