Skip to content
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

Conversation

ryanjduffy
Copy link
Contributor

Adds replay record command to launch and record and update replay launch to only launch the browser. Both now can be manually overridden by setting RECORD_ALL_CONTENT in the env.

Copy link

replay-io bot commented Dec 2, 2023

flake

StatusComplete ↗︎
Commit5af00b8
Results
2 Failed
  • cypress/e2e/adding-spec.ts
      AssertionError: Timed out retrying after 4000ms: Expected to find content: 'Sorry, something went wrong' but never did.
          at Context.eval (webpack:///./cypress/e2e/adding-spec.ts:99:49)
  • cypress/e2e/button-spec.ts
      CypressError: Timed out retrying after 4050ms: `cy.click()` failed because this element is detached from the DOM.
      `<button data-test-id="disappearingButton" data-reactid=".0.0">Disappe...</button>`
      Cypress requires elements be attached in the DOM to interact with them.
      The previous command that ran was:
        > `cy.get()`
      This DOM element likely became detached somewhere between the previous and current command.
      Common situations why this happens:
        - Your JS framework re-rendered asynchronously
        - Your app code reacted to an event firing and removed the element
      You typically need to re-query for the element or add 'guards' which delay Cypress from running new commands.
      https://on.cypress.io/element-has-detached-from-dom
          at $Cy.ensureAttached (http://localhost:8888/__cypress/runner/cypress_runner.js:147471:76)
          at runAllChecks (http://localhost:8888/__cypress/runner/cypress_runner.js:133346:12)
          at retryActionability (http://localhost:8888/__cypress/runner/cypress_runner.js:133426:16)
          at tryCatcher (http://localhost:8888/__cypress/runner/cypress_runner.js:11318:23)
          at Promise.attempt.Promise.try (http://localhost:8888/__cypress/runner/cypress_runner.js:8592:29)
          at whenStable (http://localhost:8888/__cypress/runner/cypress_runner.js:152665:65)
          at <unknown> (http://localhost:8888/__cypress/runner/cypress_runner.js:152095:14)
          at tryCatcher (http://localhost:8888/__cypress/runner/cypress_runner.js:11318:23)
          at Promise._settlePromiseFromHandler (http://localhost:8888/__cypress/runner/cypress_runner.js:9253:31)
          at Promise._settlePromise (http://localhost:8888/__cypress/runner/cypress_runner.js:9310:18)
          at Promise._settlePromise0 (http://localhost:8888/__cypress/runner/cypress_runner.js:9355:10)
          at Promise._settlePromises (http://localhost:8888/__cypress/runner/cypress_runner.js:9435:18)
          at Promise._fulfill (http://localhost:8888/__cypress/runner/cypress_runner.js:9379:18)
          at <unknown> (http://localhost:8888/__cypress/runner/cypress_runner.js:10993:46)
      From Your Spec Code:
          at Context.eval (webpack:///./cypress/e2e/button-spec.ts:3:48)
17 Passed

...process.env,
RECORD_ALL_CONTENT: "1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you still need RECORD_ALL_CONTENT for the record option, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It moved up two lines

@@ -830,15 +832,15 @@ async function launchBrowser(
};

const proc = spawn(execPath, browserArgs[browserName], {
detached: !attach,
detached: !opts?.attach,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does detached do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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)

@ryanjduffy ryanjduffy marked this pull request as ready for review December 4, 2023 16:17
) {
try {
debug("Options", opts);

const browser = fuzzyBrowserName(opts.browser) || "chromium";
assertValidBrowserName(browser);

const attach = opts.attach || false;
await launchBrowser(browser, [url || "about:blank"], false, { ...opts, verbose: true });
Copy link
Contributor

@callingmedic911 callingmedic911 Dec 4, 2023

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?

Copy link
Contributor Author

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.

@ryanjduffy ryanjduffy merged commit 0f79844 into main Dec 4, 2023
3 of 4 checks passed
@ryanjduffy ryanjduffy deleted the ryan/scs-1629-support-interactive-recording-from-replay-launch branch December 4, 2023 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants