getgauge / taiko

A node.js library for testing modern web applications
https://taiko.dev
MIT License
3.56k stars 452 forks source link

Need to pass only args to evaluate callback #2687

Open Iamsomasundaram opened 1 year ago

Iamsomasundaram commented 1 year ago

Hi Team - In the current version of the evaluate API, there is no provision to send only args to the callback, we need to pass an element along with the args param, is there any way where we can pass only arguments to the callback function?

Example: await evaluate( (args) => { }, options)

mzissa commented 1 year ago

I agree with you. I faced this issue as well. The way I got around it is by passing a dummy select like this:

const dummyDiv = $("div");
await evaluate(dummyDiv, function (x) { });