You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my application, there are several ReactJS fields for which we utilize the executeScript command to assign values. While this process functions correctly in a non-parallel execution environment, it encounters issues when executed in parallel.
**Note: this works fine with codeceptjs versions lesser than 3.5.8 (Example, with 3.5.6 this error does not occur).
Command to run the test npx codeceptjs run-workers 2 profile1 --verbose
**
What do you get instead?
Provide console output if related. Use --verbose mode for more details.
Error processing test.after event:
DataCloneError: function(name, func, attachToElement = false, proto, instances) {
const customCommand = typeof com...<omitted>... } could not be cloned.
at new DOMException (node:internal/per_context/domexception:53:5)
at sendToParentThread (E:\Codeceptjs_pipeline\parenttrigger\node_modules\codeceptjs\lib\command\workers\runTests.js:282:14)
at EventEmitter.<anonymous> (E:\Codeceptjs_pipeline\parenttrigger\node_modules\codeceptjs\lib\command\workers\runTests.js:227:49)
at EventEmitter.emit (node:events:530:35)
at EventEmitter.emit (node:domain:488:12)
at Object.emit (E:\Codeceptjs_pipeline\parenttrigger\node_modules\codeceptjs\lib\event.js:149:28)
at E:\Codeceptjs_pipeline\parenttrigger\node_modules\codeceptjs\lib\scenario.js:182:11
at injectHook (E:\Codeceptjs_pipeline\parenttrigger\node_modules\codeceptjs\lib\scenario.js:10:5)
at module.exports.teardown (E:\Codeceptjs_pipeline\parenttrigger\node_modules\codeceptjs\lib\scenario.js:180:10)
at Context.<anonymous> (E:\Codeceptjs_pipeline\parenttrigger\node_modules\codeceptjs\lib\ui.js:114:66)
Provide test source code if related
Feature('CodeceptJS test');const{I}=inject();Scenario('test something',async()=>{awaitI.amOnPage('/react/demos/?_gl=1*1lz342q*_ga*MTY3MTc2MDgxLjE3MDY2ODgzOTg.*_ga_41J4HFMX1J*MTcwNjY4ODM5Ny4xLjAuMTcwNjY4ODM5Ny4wLjAuMA..#/bootstrap5/textboxes/default');awaitI.wait(10);// temp adding a wait// for versions < 3.5.8 use helper to locate the elementconstelement=awaitI.grabWebElements({id: 'textbox_2'})// set the value in react text fieldawaitI.executeScript((element,value)=>{constvalueSetter=Object.getOwnPropertyDescriptor(element,'value').set;constprototype=Object.getPrototypeOf(element);constprototypeValueSetter=Object.getOwnPropertyDescriptor(prototype,'value').set;if(valueSetter&&valueSetter!==prototypeValueSetter){prototypeValueSetter.call(element,value);}else{valueSetter.call(element,value);}element.dispatchEvent(newEvent('input',{bubbles: true}));},element[0],'test');})
What are you trying to achieve?
In my application, there are several ReactJS fields for which we utilize the
executeScript
command to assign values. While this process functions correctly in a non-parallel execution environment, it encounters issues when executed in parallel.**Note: this works fine with codeceptjs versions lesser than 3.5.8 (Example, with 3.5.6 this error does not occur).
Command to run the test
npx codeceptjs run-workers 2 profile1 --verbose
**
What do you get instead?
Details
The text was updated successfully, but these errors were encountered: