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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
screen.openTestingPlayground()? 馃 #780
Comments
I like. Approved !!! |
Sounds great. Testing-playground.com supports two ways of receiving state trough urls.
The first has as downside that urls have a max length. Depending on how large the debug info is, this can become a problem. (max ~2000 chars if I remember correctly). The second has as downside that markup is stored on a server. Not everyone might like that. |
Let's start with option 1 (which I'm guessing would be simpler) and then we can build option 2 if people say they want it. I wonder whether it would be possible to determine whether something's too big for the encoded URL and if it is prompt the user to ask them whether they'd like it saved to a gist first 馃 |
That check would be easy as pie. We would only need to be sure about the max url length limit. Edit, hardest part about the post option, would be to prevent spamming. We don't want that a So yeah, option 1 is definitely easier to implement. |
I think you'd want to use |
Also, I just saw that the newest VSCode release has support for webviews in panels. It would be interesting to build an extension for debugging DOM tests using that. Not everyone uses VSCode, but a lot web devs do. |
I've updated testing-playground to iron out some kinks to make this possible. I'll leave the final implementation up to someone else. But here's the snippet to make it work: const { compressToEncodedURIComponent } = require('lz-string');
function unindent(string) {
return (string || '').replace(/[ \t]*[\n][ \t]*/g, '\n');
}
function encode(value) {
return compressToEncodedURIComponent(unindent(value));
}
function getPlaygroundUrl(markup = '', query = '') {
return `https://testing-playground.com/#markup=${encode(markup)}&query=${encode(query)}`;
}
getPlaygroundUrl('<!-- markup here -->', '// and query here'); This outputs the following url:
The Both |
has anyone picked this up? If not, I can pick it up :) |
I think that you can go with this. Thanks for the help 鉂わ笍 |
I think the same! Please share any doubts if you have some. Thanks a lot!! 馃敐 |
We can close this issue :) thaaanksss |
I started to use logPlaygroundUrl and i quickly found that im copying and pasting the url to see whats what. Any chance of exposing the URL under some method, or maybe even better, passing |
Hi @pavelloz! |
@MatanBobi Yes! Thank you, i missed that one. |
Ok ok, get here's my idea... Often I tell people: "Add a screen.debug() and copy/paste the HTML output into testing-playground.com"
What if...
And it just opened a testing playground with all their HTML set in there automatically!??!? Thoughts on this idea? Good/bad? I'm sure it could be improved.... Just a random thought I had.
cc @smeijer
The text was updated successfully, but these errors were encountered: