Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render correct error text for internal uncaught errors #6936

Closed
helen-dikareva opened this issue Mar 22, 2022 · 5 comments · Fixed by #7364
Closed

Render correct error text for internal uncaught errors #6936

helen-dikareva opened this issue Mar 22, 2022 · 5 comments · Fixed by #7364
Assignees
Labels
FREQUENCY: level 2 Support Center An issue created/received from the Support Center ticket. TYPE: enhancement The accepted proposal for future implementation.

Comments

@helen-dikareva
Copy link
Collaborator

helen-dikareva commented Mar 22, 2022

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

Such a message is displayed when any exception in TestCafe internal code is thrown.

image

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

  1. 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.

@helen-dikareva helen-dikareva added TYPE: bug The described behavior is considered as wrong (bug). Support Center An issue created/received from the Support Center ticket. labels Mar 22, 2022
@helen-dikareva helen-dikareva added TYPE: enhancement The accepted proposal for future implementation. and removed TYPE: bug The described behavior is considered as wrong (bug). labels May 16, 2022
@AndreyBelym AndreyBelym changed the title Browser manipulation actions raise errors during recording in all test formats in Studio Render correct error text for uncaught errors Jun 15, 2022
@Florian-HH
Copy link

Florian-HH commented Jul 14, 2022

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

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jul 14, 2022
@AlexKamaev
Copy link
Contributor

@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

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jul 18, 2022
@Florian-HH
Copy link

@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?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jul 18, 2022
@miherlosev
Copy link
Collaborator

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.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jul 21, 2022
@AndreyBelym AndreyBelym changed the title Render correct error text for uncaught errors Render correct error text for internal uncaught errors Sep 23, 2022
@Aleksey28 Aleksey28 self-assigned this Nov 2, 2022
AndreyBelym pushed a commit that referenced this issue Nov 17, 2022
…7364)

<!--
Thank you for your contribution.

Before making a PR, please read our contributing guidelines at

https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md#code-contribution

We recommend creating a *draft* PR, so that you can mark it as 'ready
for review' when you are done.
-->
[closes #6936]
## Purpose
Render correct error text for internal uncaught errors

## Approach
_Describe how your changes address the issue or implement the desired
functionality in as much detail as possible._

## References
_Provide a link to the existing issue(s), if any._

## Pre-Merge TODO
- [X] Write tests for your proposed changes
- [ ] Make sure that existing tests do not fail
@github-actions
Copy link

Release v2.1.1-alpha.1 addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FREQUENCY: level 2 Support Center An issue created/received from the Support Center ticket. TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants