Make WordPress Core

Opened 11 months ago

Closed 7 months ago

Last modified 7 months ago

#61224 closed defect (bug) (invalid)

Uncaught exception in login form

Reported by: hansmorb's profile hansmorb Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.6
Component: Users Keywords: reporter-feedback
Focuses: javascript Cc:

Description

Hey,

sorry if this is not the best technical description but our plugins E2E tests kept failing on the latest trunk version of WP (the releases are fine).

Even when disabling all plugins and switching to the TwentyTwentyFour Theme the bug occurred, this is the output from Cypress:

TypeError: Cannot read properties of undefined (reading 'serialize')

and the stack trace is the following:

at <unknown> (http://localhost:1001/wp-admin/js/user-profile.min.js?ver=6.6-alpha-58156:2:6213)
at dispatch (http://localhost:1001/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,zxcvbn-async,wp-polyfill,wp-hooks&ver=6.6-alpha-58156:2:40035)
at v.handle (http://localhost:1001/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,zxcvbn-async,wp-polyfill,wp-hooks&ver=6.6-alpha-58156:2:38006)

What I noticed is, that I am changing the time using the cy.clock function because it was easier for me to write tests that rely on it currently not being the last day of the month.

Here is the snippet of the cypress code, when I comment out the cy.clock(getTestDate()); function the test works.

describe('test booking process', () => {
  function getTestDate() {
    let dt = new Date();
    var test = new Date(dt.getTime()),
        month = test.getMonth();
  
    test.setDate(test.getDate() + 1);
    if (test.getMonth() !== month ) {
      dt.setDate(dt.getDate() + 1);
    }

    return dt.getTime();
  }

  beforeEach( function() {
    cy.clock(getTestDate());
    cy.visit( '/wp-login.php' );
    cy.wait( 1000 );
    cy.get( '#user_login' ).type( Cypress.env( "wpSubscriber" ) );
    cy.get( '#user_pass' ).type( Cypress.env( "wpPassword" ) );
    cy.get( '#wp-submit' ).click();

The test is failing shortly after clicking the #wp-submit Button on the login form.

As the bug only occurred recently, and we regularly check against trunk I thought it might have to do something with this commit:

https://github.com/WordPress/WordPress/commit/39c3bec9f311fc138876632c23972309017ea157

The login works as expected, so I am having a hard time diagnosing the real underlying issue.
I would not rule out that I am doing something wrong, so I am sorry if that is a non issue.

Let me know if this is not relevant or if you need any more information from me.

Thank you!

Change History (2)

#1 @hellofromTonya
8 months ago

  • Keywords reporter-feedback added

Hello @hansmorb,

Welcome to WordPress Core Trac.

The version shown in the Cypress output shows ver=6.6-alpha-58156.

  • Did the issue resolve for you when 6.6.0 shipped?
  • Does it still persist today in your tests on Core trunk?

You noted the [58137] changeset. That particular one adds a JS confirmation when a user profile has unsaved changes. I'm curious if adjustments are needed in your e2e tests for the new confirmation.

I suspect it is or was an issue in your test suite. But let's confirm. Can you follow-up with the current status on your test suite please?

Last edited 7 months ago by SergeyBiryukov (previous) (diff)

#2 @hellofromTonya
7 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

With no follow-up, closing this ticket.

Please note, this Trac is used for the development of the WordPress software itself, not for support or assistance with individual sites, themes, frameworks, or plugins.

You can find people who are able to assist with your site in the WordPress support forums.

I've closed this ticket as invalid, which is Trac's unfriendly term to indicate I've referred you to the support team.

Note: See TracTickets for help on using tickets.