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

Incomplete Stacktraces on test failures #350

Closed
a-hat opened this issue May 28, 2020 · 0 comments · Fixed by #360
Closed

Incomplete Stacktraces on test failures #350

a-hat opened this issue May 28, 2020 · 0 comments · Fixed by #360
Assignees

Comments

@a-hat
Copy link

a-hat commented May 28, 2020

Hi everyone,
we are using gauge+taiko for E2E testing. I am currently wondering if it is possible to improve the output when a test fails. Most of the time, I do not see the corresponding line number in the test implementation where an exception occurs. This is probably due to the async handling.
Here is an example of an output from https://github.com/getgauge-examples/js-taiko

# API
  ## Combo Box     ✔DEPRECATION WARNING: comboBox is deprecated, use dropDown to select from the options using value or text.
 ✔
  ## Check Box     ✔ ✔
  ## Radio Button     ✔ ✔
  ## Radio Button without for     ✔ ✔
  ## Attach file     ✔ ✔
  ## Text Field     ✔[DEPRECATED] gauge.screenshotFn will be removed soon, use gauge.customScreenshotWriter instead.
 ✘
        Failed Step: Text Field
        Specification: specs/HTMLElementsAPI.spec:34
        Error Message: Error: TypeError: this.focus is not a function
            at Text.focusElement (<anonymous>:3:14)
        Stacktrace: 
        Error: TypeError: this.focus is not a function
            at Text.focusElement (<anonymous>:3:14)
            at _focus (node_modules/taiko/lib/taiko.js:2741:11)
            at async node_modules/taiko/lib/taiko.js:1036:9
            at async doActionAwaitingNavigation (node_modules/taiko/lib/taiko.js:2642:5)
            at async module.exports.focus (node_modules/taiko/lib/taiko.js:1034:5)
            at async module.exports.<computed> (node_modules/taiko/lib/taiko.js:2899:20)
  ## Scroll     ✔ ✔
  ## Alert     ✔ ✔

As you can see, only the specification which failed is mentioned in the stacktrace, not the actual test implementation. I would expect to see a trace to this: https://github.com/getgauge-examples/js-taiko/blob/efab8b9703a834afff913308dd35496562360f5e/tests/step_implementation.js#L110

As this makes debugging tests much more difficult, any support on this would be highly appreciated.

Note that this is a possible duplicate to #184, but because this issue is over a year old I decided to raise a new one.

@BugDiver BugDiver self-assigned this Jul 3, 2020
BugDiver pushed a commit that referenced this issue Jul 3, 2020
Signed-off-by: BugDiver <vinaysh@thoughtworks.com>
BugDiver pushed a commit that referenced this issue Jul 7, 2020
* Fix stack trace chopping #350

Signed-off-by: BugDiver <vinaysh@thoughtworks.com>

* Bump up versions

Signed-off-by: BugDiver <vinaysh@thoughtworks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants