klee
Version:
Record browser interactions for testing.
30 lines (25 loc) • 622 B
JavaScript
const {Command} = require('@oclif/command')
const recorder = require('../lib/recorder')
class RecordCommand extends Command {
async run() {
try {
const {args} = this.parse(RecordCommand)
const {url} = args
await recorder(url.trim())
} catch (error) {
this.error(error.message)
}
}
}
RecordCommand.description = '\nRecord interactions in a target URL.'
RecordCommand.args = [
{
name: 'url',
required: true,
description: 'Url to start recording',
parse: url => {
return url.replace(/www\.|http(s*)|:\/\//g, '')
},
},
]
module.exports = RecordCommand