user22405
user22405

Reputation: 31

Is there a similar thing like EventFiringWebDriver to PlayWright automation?

My objective is to log all the interactions with the web elements in PlayWright automation. I need to capture the following interactions

  1. Click/Submit
  2. Select dropdown
  3. Check Box
  4. Text filling
  5. Radio button
  6. Toggle button

Something like as shown here https://blog.testproject.io/2018/06/04/event-listeners/

Hope it helps what I am trying to achieve, please do comment if further information is required.

Thanks.

Upvotes: 2

Views: 104

Answers (1)

Vishal Aggarwal
Vishal Aggarwal

Reputation: 4189

Write wrapper functions over library functions to log desired details

Write wrapper functions over each UI action and which will write the specific action performed detail on an generally external file for later reference on post execution.

On the script level these wrapper functions will be called and all library functions will be called indirectly.

This is the standard advise to keep it DRY as there will be hardly 10-15 primary functions covering most of the UI actions and will encapsulate all the required logging & reporting functionality in one place.

Upvotes: 1

Related Questions