Skip to content

Commit 8b0072a

Browse files
authored
Merge pull request #289 from parthlambdatest/username_key_opts
Add cli options for username and accesskey in cli
2 parents 5036777 + 751ab55 commit 8b0072a

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

src/commander/capture.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ command
2020
.option('-F, --force', 'forcefully apply the specified parallel instances per browser')
2121
.option('--fetch-results [filename]', 'Fetch results and optionally specify an output file, e.g., <filename>.json')
2222
.option('--buildName <string>', 'Specify the build name')
23+
.option('--userName <string>', 'Specify the LT username')
24+
.option('--accessKey <string>', 'Specify the LT accesskey')
2325
.action(async function(file, _, command) {
2426
const options = command.optsWithGlobals();
2527
if (options.buildName === '') {

src/commander/exec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ command
2222
.option('-P, --port <number>', 'Port number for the server')
2323
.option('--fetch-results [filename]', 'Fetch results and optionally specify an output file, e.g., <filename>.json')
2424
.option('--buildName <string>', 'Specify the build name')
25+
.option('--userName <string>', 'Specify the LT username')
26+
.option('--accessKey <string>', 'Specify the LT accesskey')
2527
.action(async function(execCommand, _, command) {
2628
const options = command.optsWithGlobals();
2729
if (options.buildName === '') {

src/commander/upload.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ command
2727
})
2828
.option('--fetch-results [filename]', 'Fetch results and optionally specify an output file, e.g., <filename>.json')
2929
.option('--buildName <string>', 'Specify the build name')
30+
.option('--userName <string>', 'Specify the LT username')
31+
.option('--accessKey <string>', 'Specify the LT accesskey')
3032
.action(async function(directory, _, command) {
3133
const options = command.optsWithGlobals();
3234
if (options.buildName === '') {

src/lib/ctx.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ export default (options: Record<string, string>): Context => {
6060
fetchResultsFileObj = ''
6161
}
6262
buildNameObj = options.buildName || ''
63+
if (options.userName && options.accessKey) {
64+
env.LT_USERNAME = options.userName
65+
env.LT_ACCESS_KEY = options.accessKey
66+
}
6367
} catch (error: any) {
6468
console.log(`[smartui] Error: ${error.message}`);
6569
process.exit();

0 commit comments

Comments
 (0)