-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Saving: Open preview window before setting URL #8330
Conversation
No longer operating as a link needing default prevented
It looks promising given that Travis is happy. Code looks good. I will give it a spin locally 😃 I will also restart the job which runs e2e tests a few times, to see if Travis likes it. |
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.
Travis sometimes times out for the test we are trying to fix. I hope that #8301 will help to fix it.
I run it several times locally in a few different setups and it is passing all the time.
The problem here is sometimes |
With the changes introduced in this PR we open new popup only once. So this shouldn't be as problematic as before where we had cases where additional popups were opened. Does this test fail for you on the latest master? |
Not as frequently as it used to, but sometimes, yes. |
Can you rebase #8301 on top of the master and change only the part which opens tab for the first time? |
Sure! Will start on that this morning. |
So I've run this branch 10 times now, and twice it's crashed waiting for the preview navigation (not opening a new preview page) with
I'll resolve the conflicts and fix this in #8301 |
Thanks for looking into it. It's still much better than before and what's more important this PR fixes a real issue user can encounter. Let's make #8301 bulletproof 🚀 |
Oh yeah, it's much better than it was :) it just seems like the machine I have running e2e tests here is excellent at surfacing these errors! |
Fixes #8318
Fixes #6956
This pull request seeks to resolve an issue where previewing can cause a new tab to be created, even when an existing preview tab exists to be reused. This also enables the related end-to-end test to be simplified to avoid needing to accommodate both cases where a tab is reused or a new one is created. It is hoped that this simplification will remedy intermittent failures in the end-to-end test suite.
Implementation notes:
If I'm being honest, I'm not entirely clear what it is about this specific flow of logic that resolves the issue. It may be one of:
''
empty string instead ofabout:blank
avoids cross-origin conflicts which might cause a separate window tab to be createdTesting instructions:
Ensure preview end-to-end tests pass (notably in Travis CI).
Ensure PostPreviewButton unit tests pass:
Verify that Preview button will open a tab if one does not already exist, or reuse an existing open tab.
Caveat: While the open tab will be reused, it's not guaranteed it will be given focus. This is consistent with Classic Editor behavior and, to my knowledge, it is not possible to force focus on the opened tab.