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

Add example with playwright-video #13

Closed
mxschmitt opened this issue Mar 1, 2020 · 6 comments · Fixed by #14
Closed

Add example with playwright-video #13

mxschmitt opened this issue Mar 1, 2020 · 6 comments · Fixed by #14
Labels
enhancement New feature or request

Comments

@mxschmitt
Copy link
Owner

Add playwright-video example.

@arjunattam
Copy link
Contributor

What do you think about running screencast by default for all executions on Chromium (for now)? That way, executions will not need additional screenshots code to verify result of execution.

@mxschmitt
Copy link
Owner Author

What do you think about running screencast by default for all executions on Chromium (for now)? That way, executions will not need additional screenshots code to verify result of execution.

Sounds good, for that I would probably need to wrap each context.newPage() call somehow. So I can inject there the playwright-video call.

@arjunattam
Copy link
Contributor

Good point.

Thinking aloud here - what if try-playwright exposes a "context" object to the script (instead of exposing the "playwright" object right now). That way, an existing browser instance could be shared across executions, and since nothing needs to be launched, executions will be much faster. It does have downsides, like browser.newPage() cannot be used, and the browser type will need to be specified outside the script (with a dropdown; causing the scripts to be limited to just one browser). With this and https://github.com/qawolf/playwright-video/issues/7, the screencast implementation would be simplified.

Of course this is only an idea, feel free to shoot it down :)

@mxschmitt
Copy link
Owner Author

Good point.

Thinking aloud here - what if try-playwright exposes a "context" object to the script (instead of exposing the "playwright" object right now). That way, an existing browser instance could be shared across executions, and since nothing needs to be launched, executions will be much faster. It does have downsides, like browser.newPage() cannot be used, and the browser type will need to be specified outside the script (with a dropdown; causing the scripts to be limited to just one browser). With this and qawolf/playwright-video#7, the screencast implementation would be simplified.

Of course this is only an idea, feel free to shoot it down :)

awesome idea!

@jperl
Copy link
Contributor

jperl commented Mar 2, 2020

We will add captureAllPages as soon as microsoft/playwright#1163 is merged. And the capture will stop automatically when each page is closed, so you should only need to call await captureAllPages(context, { path: "/your/path" }).

@mxschmitt
Copy link
Owner Author

@jperl
fyi: I've not implemented the approach to always record chromium sessions, because it does probably harm the users UX by taking longer and showing only a video with a few frames per second.
But anywhere, it's there as a usable example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants