GithubHelp home page GithubHelp logo

Comments (9)

dgozman avatar dgozman commented on May 18, 2024

@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.

uchagani avatar uchagani commented on May 18, 2024

It would be nice to be able to write arbitrary data to the trace.

from playwright.

taras avatar taras commented on May 18, 2024

Locators in Trace

@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.

dgozman avatar dgozman commented on May 18, 2024

@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.

taras avatar taras commented on May 18, 2024

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.

dgozman avatar dgozman commented on May 18, 2024

@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.

taras avatar taras commented on May 18, 2024

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.

dgozman avatar dgozman commented on May 18, 2024

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.

taras avatar taras commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.