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
Converting UI tests from phantomjs to headless chrome #13048
Conversation
Will this PR make #13036 work in tests? |
Commented on the other issue. This PR probably won't be finished for a while unfortunately :) |
@diosmosis do you need help finishing this PR? Could maybe help converting some tests when I have some time in between... |
I was actually doing this in my spare time but it took longer than expected (was hoping to finish in a weekend), and now I don't have the spare time. Would be happy for the help, feel free to push directly to the branch if you'd like @sgiehl! Note: in order to run the tests, you should just have to do an |
expect.screenshot('column_sorted').to.be.capture(function (page) { | ||
page.click('th#avg_time_on_page', 3000); | ||
}, done); | ||
await page.click('th#avg_time_on_page', 3000); |
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.
FYI, the wait timeout no longer exists w/ chrome headless, instead you have to call one of the wait functions: https://github.com/GoogleChrome/puppeteer/blob/v1.4.0/docs/api.md#pagewaitforselectororfunctionortimeout-options-args
I added one extra one waitForNetworkIdle()
that waits for network requests to finish. So here it would be:
await page.click('th#avg_time_on_page');
await page.waitForNetworkIdle();
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.
Also you can wait for times via waitFor(1000)
, but have been trying to replace these w/ waitFor('.selector')
unless its to wait out an animation. (Though in many cases they're unnecessary to have w/ chrome, and in other cases they can be reduced greatly since chrome is so much faster than phantomjs.)
@diosmosis I've rebased the branch on latest |
0b48ac0
to
da3e244
Compare
da3e244
to
bfe8893
Compare
… before when there is a failure.
bfe8893
to
a11d7bb
Compare
@diosmosis I've rebased and update this branch with latest changes on 3.x-dev. ~90% of tests are already passing, but there's still some work left. Maybe you have some time in between to work on some of the stuff:
|
👍 will make some time for it. It's very annoying to have UI tests that never consistently pass, hope this can be merged soon. |
The installation test failure is due to puppeteer/puppeteer#3471. W/o request interception it works. There was a recent commit in puppeteer to try and resolve this, but it doesn't seem to help in this case. |
was done with #14421 |
Work in progress, more to follow.