Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions tests/cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ import '@10up/cypress-wp-utils';
// Import commands.js using ES2015 syntax:
import './commands';

Cypress.on( 'uncaught:exception', ( err ) => {
if (
err?.name === 'AbortError' &&
err?.message?.includes( 'Transition was skipped' )
) {
return false;
}
} );

Comment on lines +21 to +29

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is an, apparently successful, way of working around the following error throwing on GitHub Action runs that does not occur locally.

I think it's something to do with view transitions not firing but removing wp_enqueue_view_transitions_admin_css from the admin CSS, see below, did not work on it's own.

AbortError: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.

  > Transition was skipped

When Cypress detects uncaught errors originating from your application it will automatically fail the current test.

This behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.

https://on.cypress.io/uncaught-exception-from-application

@dkotter Are you able to give me a logic check on this? It's happening in a bunch of repos.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, this looks fine and I landed on practically the same solution in ClassifAI: 10up/classifai@a9234df. Note we've since migrated ClassifAI to Playwright over Cypress and no longer have this problem

beforeEach( () => {
cy.session( 'login', cy.login, {
cacheAcrossSpecs: true,
Expand Down
Loading