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
I have code that calls element.insertAdjacentText(where, data) with a number instead of a string for the data parameter.
This works in normal browsers, but fails when executed during a testcafe test.
PS C:\XXX\github.com\htho\testcafe-repro-insert-adjacent-text> npm run test
> repro-testcafe-insert-adjacent-text@1.0.0 test
> testcafe chrome test.tc.ts
Running tests in:
- Chrome 106.0.0.0 / Windows 10
insertAdjacentText
√ insert text
× insert number
1) A JavaScript error occurred on "http://localhost:3000/".
Repeat test actions in the browser and check the console for errors.
Enable the “skipJsErrors” option to ignore JavaScript errors during test execution. Learn more:
"https://testcafe.io/documentation/404038/recipes/debugging/skip-javascript-errors"
If the website only throws this error when you test it with TestCafe, please create a new issue at:
"https://github.com/DevExpress/testcafe/issues/new?template=bug-report.md".
JavaScript error details:
TypeError: Illegal invocation
at ElementSandbox._hasShadowUIParentOrContainsShadowUIClassPostfix (http://XXX.XXX.XXX.XXX:63695/hammerhead.js:17154:58)
at ElementSandbox._onElementAdded (http://XXX.XXX.XXX.XXX:63695/hammerhead.js:17183:29)
at ElementSandbox._addNodeCore (http://XXX.XXX.XXX.XXX:63695/hammerhead.js:16849:19)
at ElementSandbox._insertAdjacentTextOrElement (http://XXX.XXX.XXX.XXX:63695/hammerhead.js:16889:22)
at HTMLDivElement.insertAdjacentText (http://XXX.XXX.XXX.XXX:63695/hammerhead.js:16949:33)
at HTMLButtonElement.<anonymous> (http://localhost:3000/:22:16)
at HTMLButtonElement.dispatchEvent (http://XXX.XXX.XXX.XXX:63695/hammerhead.js:22986:52)
at EventSimulator._raiseDispatchEvent (http://XXX.XXX.XXX.XXX:63695/hammerhead.js:23780:23)
at EventSimulator._dispatchMouseEvent (http://XXX.XXX.XXX.XXX:63695/hammerhead.js:23690:22)
at EventSimulator._dispatchMouseRelatedEvents (http://XXX.XXX.XXX.XXX:63695/hammerhead.js:23632:22)
Browser: Chrome 106.0.0.0 / Windows 10
7 |test("insert text", async (t) => {
8 | await t.click(Selector("#insert-text"));
10 |});
11 |test("insert number", async (t) => {
> 12 | await t.click(Selector("#insert-number")); // <- FAILS:
13 | await t.expect(Selector("#target").innerText).eql("1");
14 |});
at <anonymous> (C:\XXX\github.com\htho\testcafe-repro-insert-adjacent-text\test.tc.ts:12:13)
at <anonymous> (C:\XXX\github.com\htho\testcafe-repro-insert-adjacent-text\test.tc.ts:8:71)
at __awaiter (C:\XXX\github.com\htho\testcafe-repro-insert-adjacent-text\test.tc.ts:4:12)
at <anonymous> (C:\XXX\github.com\htho\testcafe-repro-insert-adjacent-text\test.tc.ts:11:35)
1/2 failed (1s)
What is your Scenario?
I have code that calls
element.insertAdjacentText(where, data)
with a number instead of a string for thedata
parameter.This works in normal browsers, but fails when executed during a testcafe test.
This is a repository with reproduction code:
https://github.com/htho/testcafe-repro-insert-adjacent-text
What is the Current behavior?
This fails, allthough it shouldnt
What is the Expected behavior?
should have the same effect as
What is your public website URL? (or attach your complete example)
https://github.com/htho/testcafe-repro-insert-adjacent-text
What is your TestCafe test code?
Your complete configuration file
none
Your complete test report
Screenshots
No response
Steps to Reproduce
git clone https://github.com/htho/testcafe-repro-insert-adjacent-text.git
cd testcafe-repro-insert-adjacent-text
npm i
npm run serve
npm run test
(in another terminal)TestCafe version
2.0.1
Node.js version
v16.17.1
Command-line arguments
testcafe chrome test.tc.ts
Browser name(s) and version(s)
chrome 106
Platform(s) and version(s)
Windows 10
Other
No response
The text was updated successfully, but these errors were encountered: