Comments (9)
@taras You can use test.step()
to add steps that would be visible in the trace viewer. However, most of Playwright APIs show in the trace. What do you use under the hood that's missing in the trace viewer?
from playwright.
It would be nice to be able to write arbitrary data to the trace.
from playwright.
@dgozman Since we're not using locators, I assume we won't get the traces I highlighted in the image. We want to add these from the node or the browser for interactor interactions.
from playwright.
@taras Most of Playwright APIs show in the trace, not only locators. What APIs do you use that's missing in the trace viewer?
from playwright.
We're building a custom testing harness that uses the Playwright library to start up the browser. We have a custom test runner. Our traces would only show HTTP requests because we don't currently use the test
function or locators. We want to use the trace functionality without relying on Playwright's test runner.
from playwright.
@taras I see, so you basically use Playwright to launch the browser. In this case, there is indeed not much to see in the trace. I will keep this issue open, but the usecase seems to be low priority for Playwright. It looks like it would be easier for you to record your own trace and show it in whatever UI you would like, because there is pretty much nothing from Playwright that could show up in the trace.
from playwright.
Thank you very much for considering my request. I would like to clarify that we have two separate use cases.
The primary use case that prompted this request is supporting Playwright to Interactors. This would make it possible for users of Interactors to use the Playwright runner with interactors for their component library. In this case, they'd be using everything except locators.
The second use case is for BigTest, where we're considering replacing WebDriver with Playwright. In the case of BigTest, we have our own declarative test syntax and it's own test runner.
The Interactors use case is a much higher priority for us. Can you give some pointers on how we can send trace information to Playwright, even via some unofficial APIs? I would appreciate it.
Thank you for your time,
Taras
from playwright.
In this case, they'd be using everything except locators.
I think the usual Playwright trace would be almost there. I guess you are using something else instead of locators, probably some kind of page.evaluate()
or similar? That should show up in the trace anyway, albeit under the actual API name, not under your wrapper name. I didn't understand whether you use Playwright's test runner in this case, but if you do you can wrap it all with test.step()
.
Can you give some pointers on how we can send trace information to Playwright, even via some unofficial APIs? I would appreciate it.
Unfortunately, there is no way to achieve this today.
from playwright.
I guess you are using something else instead of locators, probably some kind of page.evaluate() or similar?
The design of Intractors is very similar to Playwright locators. They're both convergent and perform chained DOM look-up in one tick of the event loop. You might find this blog post interesting https://frontside.com/blog/2020-07-16-the-lesson-of-bigtest-interactors/
We only use page.evaluate
to send the agent what Interactor to call and arguments to that interactor. Actual lookup and interaction happen in the browser context. So it sounds like we should expect to see page.evaluate
and arguments in the trace?
I didn't understand whether you use Playwright's test runner in this case, but if you do you can wrap it all with test.step().
In this case, the users would be using Playwright test runner.
from playwright.
Related Issues (20)
- [Bug]: .env file bypassed in debug mode 1.1.1 HOT 2
- [Feature]: Trace viewer: When using multiple browsers, I would like to see which browser is making which HTTP request HOT 1
- Video testing is not working on playwright HOT 3
- [Bug]: JUnit report contains invalid character in logs HOT 2
- [Bug]: Running issues in debug does not work and ends up in multiple different situations. HOT 1
- [Bug]: 1.44.0 automatically closes the browser on test end (even with reuseBrower:true) HOT 2
- Can't run tests in debug mode HOT 4
- [Bug]: Test info attached in html report in wrong format HOT 1
- [Feature]: receive parameters in `test.describe()` HOT 1
- Target page, context or browser has been closed HOT 1
- [Bug]: Unable to view the right context on Traces and Videos
- [Bug]: Playwright Extension Test Explorer cannot find setup.ts files HOT 2
- [Bug]: Updated to Playwright Test for VSCode v1.1.1 and all test except one dissappeared from Test Explorer view HOT 2
- [Bug]: Can't run tests with the extension (no Browser will be opend) HOT 2
- [Bug]: Setting a different locale does not work as expected HOT 4
- [Regression]: Playwright Test for VSCode can't find *.spec.ts files HOT 7
- [Bug]: "waitForResponse" always fails on firefox HOT 1
- [Bug]: Using force:true to click on an element overlapped by another element will not click or error out HOT 1
- [Bug]: Using test.fail() does not actually fail the test HOT 2
- [Bug]: Locators are in Playwright provided is not Detecting when we run same Scripts again HOT 1
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.