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

Jquery scrollTop causes "Uncaught object "[object Object]" was thrown. Throw Error instead." #2045

Closed
enes1004 opened this issue Jun 13, 2019 · 3 comments
Assignees
Labels
AREA: client STATE: Auto-locked Issues that were automatically locked by the Lock bot SYSTEM: event simulation TYPE: bug

Comments

@enes1004
Copy link

What is your Test Scenario?

I am trying to test a simple click in a page with jquery function scrollTop()

What is the Current behavior?

The page scrolls to destination.
TestCafe waits for element to appear and then throws
"Uncaught object "[object Object]" was thrown. Throw Error instead."

If I exclude scroll functions, test works. If I use native JS, it works in Chrome. (But, scrolling had browser compatibility issues with other browsers, so I prefer to use Jquery ScrollTop)

What is the Expected behavior?

Passing test as there is no assetion

What is your web application and your TestCafe test code?

https://chugakujyuken.kobetsuba.jp/js_includes/test.html

Your complete test code (or attach your test files):
 import { Selector,ClientFunction } from 'testcafe';

fixture `Getting Started`
    .page `https://chugakujyuken.kobetsuba.jp/js_includes/test.html`;

test('jquery test', async t => {
    await t.click("#button")
}); 

Your complete test report:
 Running tests in:
 - Chrome 75.0.3770 / Linux 0.0.0

 Getting Started
----
Chrome 75.0.3770 / Linux 0.0.0
DEBUGGER PAUSE ON FAILED TEST:
Uncaught object "[object Object]" was thrown. Throw Error instead.

Browser: Chrome 75.0.3770 / Linux 0.0.0
----

AAAAAAAAAG ✖ jquery test
   1) Uncaught object "[object Object]" was thrown. Throw Error instead.

      Browser: Chrome 75.0.3770 / Linux 0.0.0


 1/1 failed (15s)

Your Environment details:

  • testcafe version: 1.2.1
  • node.js version: 8.9.1
  • command-line arguments: testcafe chrome jquery_error_test.js --debug-on-fail --skip-js-errors
  • browser name and version: Chrome 75.0.3770
  • platform and version: Linux Ubuntu 14.04 LTS
@miherlosev
Copy link
Contributor

Hi @enes1004

Thank you for the detailed description. I've reproduced the problem.

For team:
The problem is in styleUtils.setScrollLeft function. We should use the native functions window.scrollTop, window.scrollLeft.

@enes1004
Copy link
Author

Thank you very much. I will be watching for update.

@lock
Copy link

lock bot commented Jun 24, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked Issues that were automatically locked by the Lock bot label Jun 24, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: client STATE: Auto-locked Issues that were automatically locked by the Lock bot SYSTEM: event simulation TYPE: bug
Projects
None yet
Development

No branches or pull requests

4 participants