Skip to content

Commit

Permalink
docs: align cli flags with synthetics docs (#914)
Browse files Browse the repository at this point in the history
* docs: align cli flags with synthetics docs

* apply suggestions from code review

Co-authored-by: Justin Kambic <jk@elastic.co>

---------

Co-authored-by: Justin Kambic <jk@elastic.co>
  • Loading branch information
vigneshshanmugam and justinkambic committed Apr 5, 2024
1 parent 13813d4 commit 974815f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
11 changes: 7 additions & 4 deletions src/cli.ts
Expand Up @@ -80,19 +80,22 @@ program
Object.keys(reporters)
)
)
.option('--inline', 'Run inline journeys from heartbeat')
.option('--inline', 'read journeys from stdin instead of reading from files')
.option('-r, --require <modules...>', 'module(s) to preload')
.option('--sandbox', 'enable chromium sand-boxing')
.option('--rich-events', 'Mimics a heartbeat run')
.option('--no-headless', 'run browser in head-full mode')
.option(
'--rich-events',
'preset flag used when running monitors directly via Heartbeat'
)
.option('--no-headless', 'run with the browser in headful mode')
.option(
'--capability <features...>',
'Enable capabilities through feature flags'
)
.addOption(
new Option(
'--screenshots [flag]',
'take screenshots at end of each step'
'Control whether to capture screenshots at the end of each step'
).choices(['on', 'off', 'only-on-failure'])
)
.option(
Expand Down
10 changes: 5 additions & 5 deletions src/options.ts
Expand Up @@ -189,7 +189,7 @@ export function parseThrottling() {
export function getCommonCommandOpts() {
const params = createOption(
'-p, --params <jsonstring>',
'JSON object that gets injected to all journeys'
'JSON object that defines any variables your tests require.'
).argParser(JSON.parse);

const playwrightOpts = createOption(
Expand All @@ -199,7 +199,7 @@ export function getCommonCommandOpts() {

const pattern = createOption(
'--pattern <pattern>',
'RegExp pattern to match journey/monitor files that are different from the default (ex: /*.journey.(ts|js)$/)'
'RegExp pattern to match journey files in the current working directory (default: /*.journey.(ts|js)$/)'
);

const apiDocsLink =
Expand All @@ -214,16 +214,16 @@ export function getCommonCommandOpts() {

const configOpt = createOption(
'-c, --config <path>',
'configuration path (default: synthetics.config.js)'
'path to the configuration file (default: synthetics.config.(js|ts))'
);

const tags = createOption(
'--tags <name...>',
'run/push tests with a tag that matches the glob'
'run/push tests with the tag(s) matching a pattern'
);
const match = createOption(
'--match <name>',
'run/push tests with a name or tags that matches the glob'
'run/push tests with a name or tags that matches a pattern'
);

return {
Expand Down

0 comments on commit 974815f

Please sign in to comment.