testcafe
testcafe copied to clipboard
Render correct error text for uncaught errors
What is your Scenario?
I'd like to use browser manipulation actions (e.g. resizeWindow, maximizeWindow etc.) the same way with other actions in my tests in the recording process.
Test run for such tests works properly.
TestCafe Studio issue: https://github.com/DevExpress/testcafe-studio/issues/4170
What is the Current behavior?
When I add such actions in my tests (both *.js/ts and *.testcafe formats) and start recording for them in TestCafe Studio I get an error

What is the Expected behavior?
Correct error message. We should show more descriptive error message. Otherwise we spend to much time to determinate the real cause and we won't be able to diagnost user's problems if they write to us about them.
Please add TestCafe Studio squad for review PR if API is changed or provide us with Breaking change list.
What is your public website URL? (or attach your complete example)
any
What is your TestCafe test code?
The smallest example could be the following
fixture `Google`
.page `https://google.com`;
test(`New Test`, async t => {
await t.maximizeWindow();
});
Your complete configuration file
Your complete test report
Screenshots
Steps to Reproduce
- Run test in TestCafe Studio
TestCafe version
1.18.4
Node.js version
14.9.0
Command-line arguments
Browser name(s) and version(s)
any
Platform(s) and version(s)
any
Other
The research result:
The TestRun's constructor API was changed in the PR @Aleksey28
Specifically messageBus was added as a parameter.
But in Studio we use this API .
The [object object] error was inroduced after the PR merging @AlexKamaev. This line raise error "TypeError: Cannot read property 'on' of undefined" and this error is catch in the catch block. But still in Studio we get an unidentified [object object] error.
I have the same issue with "Uncaught object "[object Object]" was thrown. Throw Error instead." in Testcafe version 1.20.0-rc.1 for selectors where I try to get the innerText/textContent for a sub-element of a svg
@Florian-HH I believe this issue is not related to the original one. Please share your project and your test code with us so that we can reproduce the issue on our side
@AlexKamaev I am sorry, but the project and the test code is owned by a company and can't be shared. What I can say is that the object is the result of a java script function which updates the value every 1000ms. This value is shown in the html in a sub element of an svg. The test code tries to assign this value to a const via textContent. Does that help?
Hi @Florian-HH,
We need an example that we can reproduce locally without any additional setup (see how to create a minimal working example). If you can create such an example please create a separate issue and attach an example to it. Also, it's not necessary to use the production code that cann't be shared. It's possible to create a simple example based on production code. Such example will not contain private information.
Release v2.1.1-alpha.1 addresses this.