Page MenuHomeSoftware Heritage

cypress: Override type command to remove key press delay
ClosedPublic

Authored by anlambert on Thu, Jun 16, 1:56 PM.

Details

Summary

Cypress use a default key press delay of 10ms which significantly
slow downs e2e tests when typing a long string in an input element.

So override the type command to remove that delay.

Locally, overall cypress tests execution is reduced by one minute
(from 6m36 to 5m37).

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

cypress/e2e/deposit-admin.cy.js
191 ↗(On Diff #28815)

Modal was not closing anymore after the type command overriding, click on close button instead which is equivalent.

cypress/e2e/persistent-identifiers.cy.js
33

I do not know why those tests start hanging locally but this is not related to the type command overriding.
I put that change in a separate commit.

Build is green

Patch application report for D7997 (id=28815)

Rebasing onto 662ce6eafc...

Current branch diff-target is up to date.
Changes applied before test
commit d5f020c02bb47bf3dab5d9e0e9928d38fba4c5be
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Jun 16 13:52:23 2022 +0200

    cypress: Override type command to remove key press delay
    
    Cypress use a default key press delay of 10ms which significantly
    slow downs e2e tests when typing a long string in an input element.
    
    So override the type command to remove that delay.
    
    Locally, overall cypress tests execution is reduced by one minute
    (from 6m36 to 5m37).

commit f8c7ca101e6a089b470c39924688f2625b0c05c4
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Jun 16 13:51:27 2022 +0200

    cypress/persistent-identifiers: Workaround tests hang issue

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1903/ for more details.

On Jenkins , we gain more than one minute in overall cypress tests execution, see build log before that change and build log after that change.

This revision is now accepted and ready to land.Thu, Jun 16, 2:25 PM