From d8a8d9ffd15d954b54a8b462b4c3860116b5ccae Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 1 Mar 2024 11:13:57 -0500 Subject: [PATCH 1/2] Adds section to cy.screenshot() about Chromium tab activation behavior --- docs/api/commands/screenshot.mdx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/api/commands/screenshot.mdx b/docs/api/commands/screenshot.mdx index 4cdbdfda8b..dd7c510152 100644 --- a/docs/api/commands/screenshot.mdx +++ b/docs/api/commands/screenshot.mdx @@ -300,6 +300,17 @@ cy.screenshot() cy.get('.sticky-header').invoke('css', 'position', null) ``` +### Chromium-specific behavior with regard to tabs + +Chromium will not capture screenshots when the Rendeer process for the Cypress +tab is paused. This most often happens if a new tab was opened by clicking on +an anchor with `target="_blank"`. To accommodate capturing screenshots in this +situation, Cypress will attempt to activate the Cypress tab when a screenshot is +captured. We make our best effort to activate the tab via our Chromium extension. +If the extension is disabled, Cypress will force the main tab to the front. This +will cause the browser to steal focus in open mode. To prevent Cypress from +stealing focus, [ensure that the extension is enabled](/guides/references/troubleshooting#Allow-the-Cypress-Chrome-extension). + ## Rules ### Requirements [](/guides/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} From 4a3223dfb6b7ac9ded35ba38e2118accfd2a58ce Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 4 Mar 2024 10:29:11 -0500 Subject: [PATCH 2/2] typo --- docs/api/commands/screenshot.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/commands/screenshot.mdx b/docs/api/commands/screenshot.mdx index dd7c510152..6fe9bc45a7 100644 --- a/docs/api/commands/screenshot.mdx +++ b/docs/api/commands/screenshot.mdx @@ -302,7 +302,7 @@ cy.get('.sticky-header').invoke('css', 'position', null) ### Chromium-specific behavior with regard to tabs -Chromium will not capture screenshots when the Rendeer process for the Cypress +Chromium will not capture screenshots when the Renderer process for the Cypress tab is paused. This most often happens if a new tab was opened by clicking on an anchor with `target="_blank"`. To accommodate capturing screenshots in this situation, Cypress will attempt to activate the Cypress tab when a screenshot is