corona-warn-app / cwa-website

Corona-Warn-App website. The CWA development ended on May 31, 2023. You still can warn other users until April 30, 2023. More information:
https://coronawarn.app/en/faq/#ramp_down
Apache License 2.0
524 stars 225 forks source link

Complete migration of Cypress plugins migration to v12 #3516

Closed MikeMcC399 closed 1 year ago

MikeMcC399 commented 1 year ago

Since the Plugins file is deprecated in Cypress 10+, this PR moves the contents of cypress/plugins/index.js into cypress.config.js instead of requiring it. The deprecated cypress/plugins/index.js file is then deleted.

Background

Cypress Legacy configuration > Folders / Files for versions 9 and below used a default pluginsFile of cypress/plugins/index.js.

Cypress (modern) configuration does not include a pluginsFile at all. According to the Cypress documentation setupNodeEvents the Plugins file is deprecated.

Local Verification

Execute under Node.js 18.16.0

npm ci
npm test

and confirm that all tests run and that the only errors are link errors.

dsarkar commented 1 year ago

Thanks @MikeMcC399 for the PR. Works fine. (For testing this PR I removed most of the test in check_links.cy.js, so the test passes)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  app_to_web.cy.js                         00:06        8        8        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  applink.cy.js                            424ms        3        3        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  blog.cy.js                               413ms        1        1        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  check_anchor_links.cy.js                 00:58       37       37        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  check_videos.cy.js                       00:17       17       17        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  eventRegistration.cy.js                  00:08        6        6        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  faq.cy.js                                00:09       16       16        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  faq_link_attr.cy.js                      00:02        3        3        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  hotline.cy.js                            206ms        1        1        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  mime.cy.js                               136ms        2        2        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  hybrid/check_links.cy.js                 00:26        4        4        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        02:11       98       98        -        -        -