Skip to content
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

Merged
merged 39 commits into from
Feb 15, 2020
Merged

Conversation

jmbockhorst
Copy link
Contributor

@jmbockhorst jmbockhorst commented Feb 10, 2020

Use playwright instead of puppeteer and adds support for yarn test-api --browser [chromium|firefox|webkit]. Closes #2700.

Requires Node >=10.15.0.

@jerch
Copy link
Member

jerch commented Feb 11, 2020

@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",
Copy link
Member

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?

Copy link
Contributor Author

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.

@@ -3,10 +3,11 @@
* @license MIT
*/

import * as puppeteer from 'puppeteer';
// import * as playwright from 'playwright';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

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(`
Copy link
Member

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 }

@@ -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`);
Copy link
Member

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> {
Copy link
Member

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 () => {

Copy link
Member

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 👿 )

Copy link
Member

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:

Screen Shot 2020-02-12 at 7 20 58 AM

Copy link
Contributor Author

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?

Copy link
Member

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';
Copy link
Member

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

Copy link
Contributor Author

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).

Tyriar referenced this pull request in microsoft/vscode Feb 12, 2020
@jmbockhorst jmbockhorst marked this pull request as ready for review February 13, 2020 06:44
@jmbockhorst
Copy link
Contributor Author

A new playwright version came out, so upping that might help stuff too.

@Tyriar
Copy link
Member

Tyriar commented Feb 15, 2020

@jmbockhorst cool, just been working through all the failures on the other browsers 😃

@Tyriar
Copy link
Member

Tyriar commented Feb 15, 2020

Tests take longer due to download again, I think we need to use playwright-core and download the browser on first run instead of PUPPETEER_SKIP_CHROMIUM_DOWNLOAD microsoft/playwright#823 (comment)

@Tyriar
Copy link
Member

Tyriar commented Feb 15, 2020

Doesn't look like Windows tests works yet, maybe they'll work after #2714

@Tyriar Tyriar added this to the 4.5.0 milestone Feb 15, 2020
@Tyriar Tyriar merged commit 708c6bd into xtermjs:master Feb 15, 2020
Tyriar added a commit to microsoft/vscode that referenced this pull request Apr 9, 2020
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…
lemanschik pushed a commit to code-oss-dev/code that referenced this pull request Nov 25, 2022
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…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider replacing puppeteer with playwright
3 participants