This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 250046 - Cannot debug Karma tests
Summary: Cannot debug Karma tests
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Testing (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2015-01-27 10:38 UTC by Vladimir Riha
Modified: 2015-01-30 10:27 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (66.36 KB, text/plain)
2015-01-27 10:38 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2015-01-27 10:38:04 UTC
Created attachment 151696 [details]
IDE log

Please download [1] and:
 - invoke NPM install
 - go to Project Properties, JavaScript Testing, set Karma as provider and enable Debugging
 - add line breakpoint to controllersSpec.js:6
 - right click on project and select Test
 => IDE opens 2 browsers (that's OK), but breakpoint is never hit. This works fine in 8.0.2

[1] http://services.netbeans.org/synergy/server/api/attachment.php?id=206



Product Version: NetBeans IDE Dev (Build web-main-1841-on-20150127)
Java: 1.8.0_25; Java HotSpot(TM) Client VM 25.25-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b17
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
Comment 1 Tomas Mysik 2015-01-27 13:31:17 UTC
Will try to look at it soon. Thanks.
Comment 2 Tomas Mysik 2015-01-28 10:22:52 UTC
Martine, caused by your changeset [1], you are ignoring breakpoints from test files (only siteroot is considered).

Thanks.
[1] http://hg.netbeans.org/web-main/rev/cc90acf81df1
Comment 3 Tomas Mysik 2015-01-28 10:25:46 UTC
BTW not sure about SOURCES_TYPE_HTML5_TEST_SELENIUM - Fanis?

Thanks.
Comment 4 Tomas Mysik 2015-01-28 10:26:36 UTC
Martine, let me know if you are busy, I could easily fix it, I guess.

Thanks.
Comment 5 Vladimir Riha 2015-01-28 10:30:50 UTC
Debugging Selenium tests should work as well. My test project has sources == project dir so breakpoints in Selenium tests work, but once Sources is set to Selenium tests "sibling" folder, breakpoints in Selenium tests are ignored as well (tested with Mocha).
Comment 6 Theofanis Oikonomou 2015-01-28 10:42:23 UTC
(In reply to Tomas Mysik from comment #3)
> BTW not sure about SOURCES_TYPE_HTML5_TEST_SELENIUM - Fanis?
> 
> Thanks.

well SOURCES_TYPE_HTML5_TEST_SELENIUM does not affect debugging karma tests,
but I would like to ask when fixing this, either you or Martin, to include SOURCES_TYPE_HTML5_TEST_SELENIUM sources as well so that debugging of selenium tests works as well. Lada mentioned a selenium related use-case. Thank you
Comment 7 Martin Entlicher 2015-01-28 11:00:50 UTC
Thanks for the discovery of the problem Tomáši. If you have gathered the necessary source root constants already, feel free to push the fix. Thanks a lot.
Comment 8 Tomas Mysik 2015-01-28 11:12:01 UTC
Will do that.
Comment 9 Tomas Mysik 2015-01-28 11:17:38 UTC
Should be fixed now. Thanks.

http://hg.netbeans.org/web-main/rev/5b6a7ffda86f
Comment 10 Quality Engineering 2015-01-29 04:15:56 UTC
Integrated into 'main-silver', will be available in build *201501290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5b6a7ffda86f
User: Tomas Mysik <tmysik@netbeans.org>
Log: #250046 - Cannot debug Karma tests
Comment 11 Vladimir Riha 2015-01-29 16:54:36 UTC
Seems fine with Karma, but please try following:
 - create a new sample project Knockout Messages
 - npm install
 - set Sources to "server" folder
 - add breakpoint to Selenium Tests/browser.js:57
 - debug test file Selenium Tests/downloadTest.js
 => debugger does not stop on given breakpoint. It works OK if Sources are in Project dir



Thanks


Product Version: NetBeans IDE Dev (Build 201501290002)
Java: 1.8.0_25; Java HotSpot(TM) Client VM 25.25-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b17
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
Comment 12 Tomas Mysik 2015-01-30 07:35:06 UTC
The original issue is fixed and I know nothing about Selenium area so reported as a new issue #250106.

Thanks.
Comment 13 Vladimir Riha 2015-01-30 10:27:16 UTC
OK, thank you. 

V.