-
Notifications
You must be signed in to change notification settings - Fork 209
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
[Feature]: Trace viewer log type actions #1565
Comments
Related request in python microsoft/playwright-python#1949 |
Sounds like something similar to |
idea: we could add a public void fooTest(TestStep step, Page page) {
step.describe("Prepare new order", () -> {
// some playwright actions
}
} Although this won't solve any logging any non-playwright actions but I don't think playwright currently allows that anyways. There are other issues similar to this most recently microsoft/playwright#30610. |
Step is a good idea to add more context. For my use case, as I'm doing complexe integration tests with multiple "actors", it is important to have the possibility to add "non playwrigth" actions. I'm doing external actions that sents update GUI using SSE. For example, i can do :
if i don't have the information of the external action, it is difficult to understand why I'm doing a check on OFF and just after ON without any apparent change:
|
🚀 Feature Request
It can be great to have the possibility to add "log" action to the list of actions on the trace viewer to better following the tests execution and so easy readiness. It can also facilitate debugging.
Example
For example, if we are writing a Junit integration test like that.
myService.createOrder(new order)
myService.addOrderLine(myOrder, new line1)
myService.addOrderLine(myOrder,new line 2)
myApp.jmsPublishOrder(myOrder)
page.navigate(toPublishedOrder)
assertThat(page.locator(myOrderId).isVisible()
myApp.jmsValidateOrder(myOrder)
page.navigate(toValidatedOrder)
assertThat(page.locator(myOrderId).isVisible()
myApp.doSomeMoreTimeConsimingActions()
page.navigate(toOrderFinised())
===========>
It can be good to see:
Log Preparing new order 1
Log Send order
Page.navidate toPublishedOrder
Locator.expect myOrderId
Log Validate order 1
Page.navidate toValidatedOrder
Locator.expect myOrderId
Log do some more time consuming actions
page.navigate(toOrderFinised())
Motivation
We are using Playwright for simple gui tests and complexe automatique integration tests. Our complexe tests can have a lot of steps and are used on a system that interact with:
The web application uses a lot of Server Sent Event that update the display of the GUI.
The Playwright Traces are saved as proof of tests execution success and so it can be wery useful to be able to better follow the test and to understand which external action influence the gui display and so the Playwright navigations, actions and checks we are doing.
Workaround
Currently we are doing as workaround Page.evaluate("console.log('my log')"). It allows to understand test execution but in the list of actions we have juste Page.evaluate. The detail of the log can be seen in the detail of the evaluate or in the console.
As we have a GUI snapshot for Page.evalute, this solution as also the disadvantage of increasing the size of the Trace zip
The text was updated successfully, but these errors were encountered: