-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add replay record command to launch and record #286
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ import { | |
BrowserName, | ||
ExternalRecordingEntry, | ||
FilterOptions, | ||
LaunchOptions, | ||
ListOptions, | ||
MetadataOptions, | ||
Options, | ||
|
@@ -804,9 +805,10 @@ async function updateMetadata({ | |
async function launchBrowser( | ||
browserName: BrowserName, | ||
args: string[] = [], | ||
attach: boolean = false, | ||
opts?: Options | ||
record: boolean = false, | ||
opts?: Options & LaunchOptions | ||
) { | ||
debug("launchBrowser: %s %o %s %o", browserName, args, record, opts); | ||
const execPath = getExecutablePath(browserName, opts); | ||
if (!execPath) { | ||
throw new Error(`${browserName} not supported on the current platform`); | ||
|
@@ -830,15 +832,15 @@ async function launchBrowser( | |
}; | ||
|
||
const proc = spawn(execPath, browserArgs[browserName], { | ||
detached: !attach, | ||
detached: !opts?.attach, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does detached do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jazzdan added it so the CLI process wouldn't exit until the the browser exited. Not sure why (but not really relevant to this PR either) |
||
env: { | ||
RECORD_ALL_CONTENT: record ? "1" : "", | ||
...process.env, | ||
RECORD_ALL_CONTENT: "1", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you still need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It moved up two lines |
||
RECORD_REPLAY_DIRECTORY: opts?.directory, | ||
}, | ||
stdio: "inherit", | ||
}); | ||
if (!attach) { | ||
if (!opts?.attach) { | ||
proc.unref(); | ||
} else { | ||
// Wait for the browser process to finish. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong but this is a breaking change. Do you know if users rely on this command and if we need to have any migrate path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a breaking change. I don't think anyone outside of us and QA is using it though.