10up / cypress-wp-utils

Utilities library for WordPress E2E testing in the Cypress environment
https://10up.github.io/cypress-wp-utils/
MIT License
23 stars 8 forks source link

Repair E2E tests #103

Closed kmgalanakis closed 1 year ago

kmgalanakis commented 1 year ago

Description of the Change

Closes https://github.com/10up/cypress-wp-utils/issues/78

How to test the Change

Changelog Entry

Added - New feature Changed - Existing functionality Deprecated - Soon-to-be removed feature Removed - Feature Fixed - Bug fix Security - Vulnerability

Credits

Props @username, @username2, ...

Checklist:

kmgalanakis commented 1 year ago

@jeffpaul I don't know if I should specifically ping you about this.

I managed to fix the E2E tests by ignoring a CORS related error and by running them on Chrome (they were failing on Electron, objections?) but now I'm facing another test failure with WP trunk version. I consistently get an error like

Uncaught TypeError: Cannot destructure property 'documentElement' of 'contentDocument' as it is null.
    at HTMLIFrameElement.onLoad (block-editor.js?ver=35750e8f523ab571a7d8:25172:9)

when opening the editor using Cypress, something I don't get when loading the exact same site using my Chrome.

I don't know how to proceed, any suggestions?

iamdharmesh commented 1 year ago

Hi @kmgalanakis,

Thank you for the PR.

I managed to fix the E2E tests by ignoring a CORS related error and by running them on Chrome (they were failing on Electron, objections?) but now I'm facing another test failure with WP trunk version. I consistently get an error like

Uncaught TypeError: Cannot destructure property 'documentElement' of 'contentDocument' as it is null.
   at HTMLIFrameElement.onLoad (block-editor.js?ver=35750e8f523ab571a7d8:25172:9)

This is a known issue with WP 6.3 and we have an open issue for it https://github.com/10up/cypress-wp-utils/issues/104. It should be fixed separately from this PR. So, we can proceed here with ignoring it.

Thanks. cc: @jeffpaul

dkotter commented 1 year ago

I'm not sure this is needed anymore after the work that got merged in #105. I ran our E2E tests against every version of WordPress from 5.7 onwards and I don't see any failing tests anymore.

iamdharmesh commented 1 year ago

@dkotter I have verified the changes of this PR and it looks like we are good to close this PR and issue.

@kmgalanakis Please feel free to reopen this if you are still facing the reported issue and we misunderstood anything here.

Thank you