HEX
Server: Apache
System: Linux efa57bbe-abb1-400d-2985-3b056fbc2701.secureserver.net 6.1.147-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jul 24 12:33:32 EDT 2025 x86_64
User: root (0)
PHP: 8.0.30.4
Disabled: NONE
Upload Files
File: //var/www/wp-content/mu-plugins/vendor/wpex/godaddy-launch/.dev/tests/cypress/support/commands.js
import { loginToSite } from '../helpers';

beforeEach( function() {
	loginToSite();

	cy.visit( Cypress.env( 'testURL' ) + '/wp-admin/post-new.php?post_type=post' );
	cy.get( '.block-editor-page' ).should( 'exist' );

	cy.url().should( 'contain', '/wp-admin/post-new.php?post_type=post' ).then( () => {
		cy.window().then( ( win ) => {
			// Enable "Top Toolbar"
			if ( ! win.wp.data.select( 'core/edit-post' ).isFeatureActive( 'fixedToolbar' ) ) {
				win.wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fixedToolbar' );
			}

			win.wp.data.dispatch( 'core/editor' ).disablePublishSidebar();
		} );
	} );
} );


/**
 * Starting in Cypress 8.1.0 Unhandled Exceptions now cause tests to fail.
 * Sometimes unhandled exceptions occur in Core that do not effect the UX created by CoBlocks.
 * We discard unhandled exceptions and pass the test as long as assertions continue expectedly.
 */
Cypress.on( 'uncaught:exception', () => {
	// returning false here prevents Cypress from failing the test.
	return false;
} );