From 83dbca39ffbf89e5e73ce2d8ed9653dd84d16c26 Mon Sep 17 00:00:00 2001 From: Mac Siri Date: Tue, 14 Feb 2023 09:53:47 -0500 Subject: [PATCH] [CI] Capture Cypress logs on failure (#19114) --- .github/workflows/ci-cd.yml | 4 +++- cypress/e2e/seededFlows/loggedOutFlows/homeFeed.spec.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 244f93268..baf4542db 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -215,7 +215,9 @@ jobs: if: failure() with: name: cypress-snapshots - path: tmp/cypress_screenshots + path: | + tmp/cypress_screenshots + cypress/logs - name: Upload test results to BuildPulse for flaky test detection if: '!cancelled()' # Run this step even when the tests fail. Skip if the workflow is cancelled. uses: Workshop64/buildpulse-action@master diff --git a/cypress/e2e/seededFlows/loggedOutFlows/homeFeed.spec.js b/cypress/e2e/seededFlows/loggedOutFlows/homeFeed.spec.js index ecd75474e..07d2d0ce6 100644 --- a/cypress/e2e/seededFlows/loggedOutFlows/homeFeed.spec.js +++ b/cypress/e2e/seededFlows/loggedOutFlows/homeFeed.spec.js @@ -14,6 +14,8 @@ describe('Logged out Home feed', () => { cy.findAllByTestId('profile-preview-card') .first() .within(() => { + cy.focused(); // Explicitly ask for focused element + cy.findByRole('link', { name: 'Admin McAdmin', }).should('have.focus');