-
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 Drag-and-Drop in the inserter #44631
Conversation
Size Change: +1 B (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
d8ad8df
to
e325500
Compare
9ac2232
to
91bfe4a
Compare
17275e8
to
bb5f0d3
Compare
@@ -49,6 +49,8 @@ | |||
border-radius: $radius-block-ui; | |||
opacity: 0.04; | |||
background: var(--wp-admin-theme-color); | |||
// This fixes drag-and-drop in Firefox. | |||
pointer-events: none; |
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.
Reference: #44711 (comment).
/** | ||
* Headless webkit won't receive dataTransfer with custom types in the | ||
* drop event on Linux. The solution is to use `xvfb-run` to run the tests. | ||
* ```sh | ||
* xvfb-run npm run test:e2e:playwright | ||
* ``` | ||
* See `.github/workflows/end2end-test-playwright.yml` for advanced usages. | ||
*/ | ||
headless: os.type() !== 'Linux', |
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.
This is kinda unfortunate for linux developers. I'll try to raise an issue upstream. Maybe we should consider only running chromium tests when developing locally?
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.
Opened an issue here: microsoft/playwright#18013.
Would be good to get CI passing in this PR. I think the problem causing them to fail has been solved in |
8f638a4
to
2fbbbc8
Compare
Nice job working through the kinks in getting the cross-browser testing in place @kevin940726 👌 Everything tests well for me, changes make sense, and CI is passing. I'm inclined to approve this PR but think it might be better to get the official green light from someone with more expertise in this area. |
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.
Nice work, looks good to me!
c1ad83c
to
ecb0a43
Compare
What?
Close #31356. Add drag-and-drop e2e tests for the global inserter.
This PR also tries to add cross-browser testing with firefox and webkit, powered by Playwright.
Why?
Because more tests = better! It will also make a potential refactor of the drag-and-drop feature easier to implement.
How?
By default, e2e tests are only run in chromium. We can enable testing in firefox and webkit by appending the
@firefox
or@webkit
tag to the test title. The tag also works intest.describe
and will apply to all the nested tests. We can append-firefox
,-webkit
, or-chromium
to individually disable testing in some browsers.Testing Instructions
CI should pass.