-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add e2e tests for Widgets Customizer #31185
Conversation
Size Change: 0 B Total Size: 1.39 MB ℹ️ View Unchanged
|
0ec661a
to
90c9f36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @kevin940726!
beforeAll( async () => { | ||
// TODO: Ideally we can bundle our test theme directly in the repo. | ||
await activateTheme( 'twentytwenty' ); | ||
await deactivatePlugin( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why disable this? It helps speed up tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The editor doesn't load if we have this plugin enabled. It's probably a bug though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooohhh that's weird, I can repro the issue by adding * { animation-duration: 0ms !important; animation-delay: 0s !important; transition-duration: 0s !important; transition-delay: 0s !important; }
to one of the customize widgets stylesheets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we are relying on transitionend
to initialise things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are! Hmm, we should fix this as anyone using a browser extension to disable animations, or a custom stylesheet hack, won't be able to access the screen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think this is also a bug from core 😅. The completeCallback
is registered within the _animateChangeExpanded
callback, which never gets fired since it's listening the transitionend
event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are passing when I run them locally. Couple of minor questions/comments below.
beforeAll( async () => { | ||
// TODO: Ideally we can bundle our test theme directly in the repo. | ||
await activateTheme( 'twentytwenty' ); | ||
await deactivatePlugin( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooohhh that's weird, I can repro the issue by adding * { animation-duration: 0ms !important; animation-delay: 0s !important; transition-duration: 0s !important; transition-delay: 0s !important; }
to one of the customize widgets stylesheets.
} ).toBeFound( findOptions ); | ||
|
||
expect( console ).toHaveWarned( | ||
"The page delivered both an 'X-Frame-Options' header and a 'Content-Security-Policy' header with a 'frame-ancestors' directive. Although the 'X-Frame-Options' header alone would have blocked embedding, it has been ignored." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When does this warning happen? I don't see it in the browser console when adding blocks manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a puppeteer thing, we might have to enable some flag to disable the warning. Not sure if it's safe to do so though.
bd31797
to
219d9a5
Compare
I'm getting some intermittent failures now and then:
|
Description
Close #30269. Add some basic e2e tests for Widgets Customizer.
This PR also updates
puppeteer-testing-library
to v0.4.0. The full changelog can be seen here.How has this been tested?
Types of changes
New feature
Checklist:
*.native.js
files for terms that need renaming or removal).