Comments (5)
This only collected 8 upvotes during the last 18 months, so I'm going to close it and defer to the third parties to resolve this. You can always open a new bug and link to this one with additional information!
from playwright.
Maybe we can directly provide some indication whether the rendering is stable? I'm very curious as to how your tool works.
from playwright.
@JoelEinbinder Thanks for reply.
I'm very curious as to how your tool works
The following figure is a screenshot of Chrome rendering pipeline.
I really want the (A) timing to get stable page.screenshot()
result, but, as far as I know, we can't get if painting/composition finished ( if you have some plans to get (A) timing, please tell me).
So we use (B) timing instead of (A). The (B) timing is closer to (A) than JS function call finished timing. The (B) timing means style recalculation and layouting finished and we wait for (B) using code such as:
let recalcStyleCountOfPreviousFrame = -1, layoutCountOfPreviousFrame = -1;
for (let i = 0; i < 100; i++) {
const { RecalcStyleCount, LayoutCount } = await page.metrics();
const isStable =
recalcStyleCountOfPreviousFrame === RecalcStyleCount &&
LayoutCount === layoutCountOfPreviousFrame;
if (isStable) {
break;
}
recalcStyleCountOfPreviousFrame = RecalcStyleCount;
layoutCountOfPreviousFrame = LayoutCount
await new Promise(res => setTImeout(res, 16));
}
await page.screenshot();
Of course, I'm sure this logic is not perfect. But it works well to some extent.
Metrics API is not our goal. We really want a method/API to get (A) timing.
from playwright.
It would be great if we would have the same metrics API that we have in Puppeteer.
JSheap tracking is really important thing and I think that a lot of people would miss it in Playwright =)
It would be great if we would be able to track CPU usage, also.
from playwright.
You can measure memory in chromium by evaluating ‘performance.memory.usedJSHeapSize’ within the page.
from playwright.
Related Issues (20)
- [Bug]: Missing libraries for webkit browsers (libwoff2dec.so) HOT 3
- I have playwright cucumber typescript projects. we execute the Test Cases through npm commands using tags. Commands npm test --tags=@smoke. but the same commands are not working in mac
- is it possible to hide skipped tests altogether from HTML report?
- [Feature]: Skip remaining tests after failure of first test HOT 1
- [Feature]: Generate trace even for codegen use HOT 2
- [Bug] shutdown workers before calling Reporter.onEnd
- [Feature]: Make "respectGitIgnore" a configurable parameter HOT 2
- [Bug]: Not possible to specify custom test-id on codegen HOT 1
- [Feature]: Have an option to launch UI mode, Inspector or TraceViewer in different browsers. HOT 1
- [Bug]: HOT 1
- [Bug]: Playwright Firefox does not catch all requests / responses
- [Bug]: Redirected from another domain to my domain then perform click event page crashed!! HOT 1
- [Bug]: Rollup failed to resolve import "/playwright/index.ts" from "/myrepo/playwright/index.html" HOT 2
- Logout verification for parallel tests with login thru global setup with single user
- [Bug]: Chromium browsers does not respect locale option (no use of Accept-Language header) for WebSocket connections HOT 1
- [Bug]: [GUI] Locator Code Generator improper escaping and inverted frame order HOT 1
- [Bug]: beforeEach and afterEach hooks not running in sync for tests that are skipped at runtime HOT 2
- [Bug]: After disabling BlockInsecurePrivateNetworkRequests in chrome://flags/, the function to upload attachments becomes non-functional.
- [Feature]: Allow to pass components and functions to hooks config HOT 3
- [Bug]: Parallel test process execution causing race condition and empty babel transpiled file read from disk cache HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playwright.