-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Use playwright instead of puppeteer #2712
Conversation
@jmbockhorst Very nice 👍 About the failing mouse tests - my guess is that my hack on the puppeteer protocol for the wheel events fail here. I had to do this, because puppeteer does not expose those with enough settings in the official API (like setting the modifier keys). |
package.json
Outdated
@@ -50,7 +51,7 @@ | |||
"mustache": "^3.0.1", | |||
"node-pty": "^0.9.0", | |||
"nyc": "13", | |||
"puppeteer": "^1.15.0", | |||
"playwright": "^0.10.0", |
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.
We need to remote @types/puppeteer
, are the types for playwright included in the package?
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.
Yes, the types for playwright are included.
test/api/TestUtils.ts
Outdated
@@ -3,10 +3,11 @@ | |||
* @license MIT | |||
*/ | |||
|
|||
import * as puppeteer from 'puppeteer'; | |||
// import * as playwright from 'playwright'; |
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.
Remove
test/api/InputHandler.api.ts
Outdated
it('Pm = 1003, Set Use All Motion (any event) Mouse Tracking', async() => { | ||
const coords = await page.evaluate(` | ||
it('Pm = 1003, Set Use All Motion (any event) Mouse Tracking', async () => { | ||
const coords: any = await page.evaluate(` |
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.
{ left: number, top: number, bottom: number, right: number }
test/api/InputHandler.api.ts
Outdated
@@ -443,7 +443,7 @@ async function getCursor(): Promise<{col: number, row: number}> { | |||
} | |||
|
|||
async function getDimensions(): Promise<any> { | |||
const dim = await page.evaluate(`term._core._renderService.dimensions`); | |||
const dim: any = await page.evaluate(`term._core._renderService.dimensions`); |
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.
Can we reference IRenderDimensions
from here?
await page.setViewport({ width, height }); | ||
}); | ||
|
||
after(async () => { | ||
await browser.close(); | ||
}); | ||
|
||
beforeEach(async function(): Promise<any> { | ||
beforeEach(async function (): Promise<any> { |
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've noticed in some PRs the space goes away and some it gets added. Is this prettier acting up or something? I prefer: async function() {
and async () => {
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.
Hehe, this is quite a sensible topic for some ppl. There are discussions about this in linter blueprint / style guide projects, some argue, that the whitespace should stay, since the official form is function SP <name>(
and if name is empty the SP would still be there. Well JS allows both, I personally favour the short form w'o the space as well. (But also couldnt care less here, I would be more concerned if someone starts to remove all ;
in the code 👿 )
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 normally don't mention it but in #2711 the oppposite change happened:
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 was going to ask about this. I’m just using VS Code’s default TypeScript formatting settings. Then I would see my formatter would change any entire file just with formatting so I would revert it and try to match the settings. There is some inconsistencies throughout the project so it becomes a mess sometimes and it’s easy to miss things. Maybe we can set some standardized workplace format settings or something?
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.
Sounds good to me #2717
@@ -3,25 +3,25 @@ | |||
* @license MIT | |||
*/ | |||
|
|||
import * as puppeteer from 'puppeteer'; | |||
import * as playwright from 'playwright'; |
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.
It's probably best to change this to import { Page, Browser }
on each file to be consistent
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.
Yeah, I can do that after #2711 once I can remove the getBrowserTypes()
function from the addon files (which needs the namespace import).
Firefox takes longer to start up
A new playwright version came out, so upping that might help stuff too. |
@jmbockhorst cool, just been working through all the failures on the other browsers 😃 |
Tests take longer due to download again, I think we need to use |
Doesn't look like Windows tests works yet, maybe they'll work after #2714 |
xtermjs/xterm.js@c5593bd...21b490f Link provider fix - Merge pull request xtermjs/xterm.js#2710 from jmbockhorst/linkFix Leaked reference - Merge pull request xtermjs/xterm.js#2767 from JavaCS3/fix/addDisposableDomListener-leak Missing cursor fix - Merge pull request xtermjs/xterm.js#2731 from jerch/fix_2729 Accessibility fix - Merge pull request xtermjs/xterm.js#2814 from Tyriar/role_list Fixes #93480 Showcase Merge pull request xtermjs/xterm.js#2761 from slel/patch-1 Merge pull request xtermjs/xterm.js#2723 from UziTech/patch-1 Test, doc, build improvements Merge pull request xtermjs/xterm.js#2766 from Tyriar/readme Merge pull request xtermjs/xterm.js#2786 from Tyriar/eslint Merge pull request xtermjs/xterm.js#2799 from Tyriar/enum_like_upper_case Merge pull request xtermjs/xterm.js#2730 from Tyriar/ts38 Merge pull request xtermjs/xterm.js#2753 from jerch/fix_vtfeatures_template Merge pull request xtermjs/xterm.js#2754 from jerch/fix_vtfeatures_2 Merge pull request xtermjs/xterm.js#2722 from Tyriar/linux_tests Merge pull request xtermjs/xterm.js#2712 from jmbockhorst/playwright Merge pull request xtermjs/xterm.js#2800 from Tyriar/upgrade_mac Many dependency updates Merge pull request xtermjs/xterm.js#2758 from Tyriar/acorn Merge pull request xtermjs/xterm.js#2770 from xtermjs/dependabot/npm_and_yarn/deep-eq… Merge pull request xtermjs/xterm.js#2779 from xtermjs/dependabot/npm_and_yarn/webpack… Merge pull request xtermjs/xterm.js#2760 from xtermjs/dependabot/npm_and_yarn/acorn-5… Merge pull request xtermjs/xterm.js#2772 from xtermjs/dependabot/npm_and_yarn/https-p… Merge pull request xtermjs/xterm.js#2783 from Tyriar/deps Merge pull request xtermjs/xterm.js#2795 from xtermjs/dependabot/npm_and_yarn/types/w… Merge pull request xtermjs/xterm.js#2801 from xtermjs/dependabot/npm_and_yarn/types/w… Merge pull request xtermjs/xterm.js#2780 from xtermjs/dependabot/npm_and_yarn/types/w… Merge pull request xtermjs/xterm.js#2792 from xtermjs/dependabot/npm_and_yarn/mocha-7… Merge pull request xtermjs/xterm.js#2803 from Tyriar/more_deps Merge pull request xtermjs/xterm.js#2805 from xtermjs/dependabot/npm_and_yarn/mustach… Merge pull request xtermjs/xterm.js#2810 from xtermjs/dependabot/npm_and_yarn/deep-eq… Merge pull request xtermjs/xterm.js#2815 from xtermjs/dependabot/npm_and_yarn/nyc-15.0.1 Merge pull request xtermjs/xterm.js#2820 from xtermjs/dependabot/npm_and_yarn/typescr… Merge pull request xtermjs/xterm.js#2819 from xtermjs/dependabot/npm_and_yarn/typescr…
xtermjs/xterm.js@c5593bd...21b490f Link provider fix - Merge pull request xtermjs/xterm.js#2710 from jmbockhorst/linkFix Leaked reference - Merge pull request xtermjs/xterm.js#2767 from JavaCS3/fix/addDisposableDomListener-leak Missing cursor fix - Merge pull request xtermjs/xterm.js#2731 from jerch/fix_2729 Accessibility fix - Merge pull request xtermjs/xterm.js#2814 from Tyriar/role_list Fixes microsoft#93480 Showcase Merge pull request xtermjs/xterm.js#2761 from slel/patch-1 Merge pull request xtermjs/xterm.js#2723 from UziTech/patch-1 Test, doc, build improvements Merge pull request xtermjs/xterm.js#2766 from Tyriar/readme Merge pull request xtermjs/xterm.js#2786 from Tyriar/eslint Merge pull request xtermjs/xterm.js#2799 from Tyriar/enum_like_upper_case Merge pull request xtermjs/xterm.js#2730 from Tyriar/ts38 Merge pull request xtermjs/xterm.js#2753 from jerch/fix_vtfeatures_template Merge pull request xtermjs/xterm.js#2754 from jerch/fix_vtfeatures_2 Merge pull request xtermjs/xterm.js#2722 from Tyriar/linux_tests Merge pull request xtermjs/xterm.js#2712 from jmbockhorst/playwright Merge pull request xtermjs/xterm.js#2800 from Tyriar/upgrade_mac Many dependency updates Merge pull request xtermjs/xterm.js#2758 from Tyriar/acorn Merge pull request xtermjs/xterm.js#2770 from xtermjs/dependabot/npm_and_yarn/deep-eq… Merge pull request xtermjs/xterm.js#2779 from xtermjs/dependabot/npm_and_yarn/webpack… Merge pull request xtermjs/xterm.js#2760 from xtermjs/dependabot/npm_and_yarn/acorn-5… Merge pull request xtermjs/xterm.js#2772 from xtermjs/dependabot/npm_and_yarn/https-p… Merge pull request xtermjs/xterm.js#2783 from Tyriar/deps Merge pull request xtermjs/xterm.js#2795 from xtermjs/dependabot/npm_and_yarn/types/w… Merge pull request xtermjs/xterm.js#2801 from xtermjs/dependabot/npm_and_yarn/types/w… Merge pull request xtermjs/xterm.js#2780 from xtermjs/dependabot/npm_and_yarn/types/w… Merge pull request xtermjs/xterm.js#2792 from xtermjs/dependabot/npm_and_yarn/mocha-7… Merge pull request xtermjs/xterm.js#2803 from Tyriar/more_deps Merge pull request xtermjs/xterm.js#2805 from xtermjs/dependabot/npm_and_yarn/mustach… Merge pull request xtermjs/xterm.js#2810 from xtermjs/dependabot/npm_and_yarn/deep-eq… Merge pull request xtermjs/xterm.js#2815 from xtermjs/dependabot/npm_and_yarn/nyc-15.0.1 Merge pull request xtermjs/xterm.js#2820 from xtermjs/dependabot/npm_and_yarn/typescr… Merge pull request xtermjs/xterm.js#2819 from xtermjs/dependabot/npm_and_yarn/typescr…
Use playwright instead of puppeteer and adds support for
yarn test-api --browser [chromium|firefox|webkit]
. Closes #2700.Requires Node
>=10.15.0
.