Skip to content

Conversation

Georgegriff
Copy link
Contributor

No description provided.

@Georgegriff
Copy link
Contributor Author

@ihor-nikiforov-scout I've produced a playwright plugin and tested it out, was a little tricky to get the library injected into the function for playwright because they do a .toString on functions to transfer them into the browser scope, but i found a work around

@codecov
Copy link

codecov bot commented Feb 10, 2020

Codecov Report

Merging #19 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #19   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          60     60           
=====================================
  Hits           60     60

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd77f00...c651158. Read the comment docs.

@ingvar-nikiforov
Copy link

@Georgegriff
I've tested these changes in my project and it works like a charm.
Thank you.

@@ -0,0 +1,21 @@
const { selectorEngine } = require("query-selector-shadow-dom/plugins/playwright");

Choose a reason for hiding this comment

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

This is a beautiful interface

@thernstig
Copy link

Add documentation for how to use this in the README.md?

@Georgegriff Georgegriff merged commit 6831fdf into master Feb 10, 2020
@Georgegriff Georgegriff deleted the playwright branch February 10, 2020 19:13
@Georgegriff
Copy link
Contributor Author

@thernstig updated the readme, and done a new release to 0.4.0 not appeared on npm yet, not sure why

@thernstig
Copy link

@Georgegriff Just a question. Is there a reason one need to add shadow=, couldn't that be the default if one use the plugin? I assume if one uses it, one by default want to pierce all shadow dom?

@Georgegriff
Copy link
Contributor Author

It is the default :)

@thernstig
Copy link

Oh, it is? But looking at the updated README it says:

  // shadow= allows a css query selector that automatically pierces shadow roots.
  await page.waitForSelector('shadow=#no-downloads span', {timeout: 3000})

@Georgegriff
Copy link
Contributor Author

Georgegriff commented Feb 10, 2020

Do you mean omit it entirely? Can't do that that's how playwright selector engines work it's how it know where to go, you're free to change shadow= to whatever else you want but something= is requires by playwright

@thernstig
Copy link

I should have read the API for selectors.register before commenting obviously ;) Would be nice if playwright let you set a default selectorEngine to use. Imagine Custom Element-heavy pages (e.g. the ones using lots of lit-html or maybe Stencil), they most likely want to penentrate the shadow dom in all calls. Worth writing an issue on playwright you think?

@Georgegriff
Copy link
Contributor Author

Georgegriff commented Feb 10, 2020

I've not tried it but registering the plugin with a name of css may overwrite their default

@thernstig
Copy link

@Georgegriff Will test this once I move to playwright (might take a while) and if it does not work I'll make a feature suggestion on the Playwright repo. Keep staying awesome with this plugins, appreciate it! 💯

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.

3 participants