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

TypeError: Cannot call method 'getText' of undefined #28

Closed
lc3t35 opened this issue Jul 6, 2013 · 16 comments
Closed

TypeError: Cannot call method 'getText' of undefined #28

lc3t35 opened this issue Jul 6, 2013 · 16 comments

Comments

@lc3t35
Copy link
Contributor

lc3t35 commented Jul 6, 2013

As mentionned in #27, there was also this error raising where coverage is enabled :

{ [TypeError: Cannot call method 'getText' of undefined] webdriver_promise_error_: true }
Fatal error: { [TypeError: Cannot call method 'getText' of undefined] webdriver_promise_error_: true }

I forked the rtd project for another use (parse.com javascript SDK Cloud Code, Backbone based) but this error just came back to surface ... digging ...

@samhatoum
Copy link
Member

I've added the ability in the latest RTD to disable just unit test coverage in rtd.conf.js, which seems to be the cause. I suspect it's the way karma is generating the coverage reports somehow.

@lc3t35
Copy link
Contributor Author

lc3t35 commented Jul 6, 2013

yes i've seen it but i need coverage reports :)

@samhatoum
Copy link
Member

fair enough! I've resorted to just the acceptance tests as that's better suited for us, however that doesn't mean the unit coverage combination shouldn't be fixed.

For your info, you can still get the unit coverage from /build/reports/... but the combination of those with the server/client coverage from acceptance tests is the part that's broken.

I need to dig in to why karma is doing this, but I've got to finish a few other things first with the actual app we're building.

@lc3t35
Copy link
Contributor Author

lc3t35 commented Jul 8, 2013

Let's reverse starting from the error :

In final.spec.js, verifyCoverageThresholds function send the TypeError message because "metrics" is empty at this line

driver.findElements(webdriver.By.className('metric')).then(function (metrics) { ... }

Because the web page ( localhost:8000/coverage ) is 404 Not Found

At openCoveragePage ->

driver.get('http://localhost:8000/coverage'); -

-> why is this server down ?

modify in Gruntfile.js to have more information : jasmine-node --captureExceptions --verbose => no effect :(
Removed KillReports task in Gruntfile.js => the file coverage--_.json is here !

@samhatoum
Copy link
Member

Thanks for looking further.

The problem I saw was this: If you hit localhost/coverage before the coverage is posted from the unit tests, it works. But if you post a coverage file from that reports directory, it kills the server. My suspicion is something has happened to the way Karma generates those files to begin with. Perhaps some library that Karma depends on has been updated.

@lc3t35
Copy link
Contributor Author

lc3t35 commented Jul 8, 2013

which version of karma is installed ?

imac-de-laurent:rtd laurent$ npm ls -g karma
npm WARN package.json dateformat@1.0.2-1.2.3 No repository field.
npm WARN package.json istanbul@0.1.22 No repository field.
npm WARN package.json pause@0.0.1 No repository field.
npm WARN package.json policyfile@0.0.4 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json cli-table@0.2.0 No repository field.
npm WARN package.json github-url-from-git@1.1.1 No repository field.
npm WARN package.json eyes@0.1.8 No repository field.
npm WARN package.json cheerio-select@0.0.3 No repository field.
npm WARN package.json assert-plus@0.1.2 No repository field.
npm WARN package.json ctype@0.5.2 No repository field.
/usr/local/lib
└── karma@0.8.5 

Having a try with 0.8.6

karma@0.8.6 /usr/local/lib/node_modules/karma
├── pause@0.0.1
├── dateformat@1.0.2-1.2.3
├── xmlbuilder@0.4.2
├── colors@0.6.0-1
├── chokidar@0.6.2
├── growly@1.1.1
├── mime@1.2.9
├── q@0.9.6
├── coffee-script@1.6.3
├── lodash@1.1.1
├── rimraf@2.1.4 (graceful-fs@1.2.2)
├── minimatch@0.2.12 (sigmund@1.0.0, lru-cache@2.3.0)
├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.2)
├── optimist@0.3.5 (wordwrap@0.0.2)
├── LiveScript@1.0.1 (prelude-ls@1.0.0)
├── log4js@0.6.6 (dequeue@1.0.3, semver@1.1.4, async@0.1.15, readable-stream@1.0.2)
├── http-proxy@0.10.3 (pkginfo@0.2.3, utile@0.1.7)
├── istanbul@0.1.22 (abbrev@1.0.4, which@1.0.5, fileset@0.1.5, nopt@2.0.0, wordwrap@0.0.2, async@0.1.22, mkdirp@0.3.5, esprima@0.9.9, escodegen@0.0.23, handlebars@1.0.12)
└── socket.io@0.9.16 (policyfile@0.0.4, base64id@0.1.0, redis@0.7.3, socket.io-client@0.9.16)

No improvment, back to 0.8.5

karma@0.8.5 /usr/local/lib/node_modules/karma
├── pause@0.0.1
├── dateformat@1.0.2-1.2.3
├── xmlbuilder@0.4.2
├── colors@0.6.0-1
├── chokidar@0.6.2
├── growly@1.1.1
├── mime@1.2.9
├── q@0.9.6
├── coffee-script@1.6.3
├── lodash@1.1.1
├── rimraf@2.1.4 (graceful-fs@1.2.2)
├── minimatch@0.2.12 (sigmund@1.0.0, lru-cache@2.3.0)
├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.2)
├── optimist@0.3.5 (wordwrap@0.0.2)
├── LiveScript@1.0.1 (prelude-ls@1.0.0)
├── log4js@0.6.6 (dequeue@1.0.3, semver@1.1.4, async@0.1.15, readable-stream@1.0.2)
├── http-proxy@0.10.3 (pkginfo@0.2.3, utile@0.1.7)
├── istanbul@0.1.22 (abbrev@1.0.4, which@1.0.5, fileset@0.1.5, nopt@2.0.0, wordwrap@0.0.2, async@0.1.22, mkdirp@0.3.5, esprima@0.9.9, escodegen@0.0.23, handlebars@1.0.12)
└── socket.io@0.9.16 (base64id@0.1.0, policyfile@0.0.4, redis@0.7.3, socket.io-client@0.9.16)

Same dependencies between 0.8.5 and 0.8.6.

@samhatoum
Copy link
Member

Baffling! I'll take a another poke around later on...

@xolvio
Copy link
Collaborator

xolvio commented Jul 22, 2013

Hi, did you get any further with this?

@lc3t35
Copy link
Contributor Author

lc3t35 commented Jul 22, 2013

No, i'm waiting for karma-runner/karma#635 to be solved.

@lc3t35
Copy link
Contributor Author

lc3t35 commented Aug 1, 2013

No more error with last fresh reinstall -> closing

@lc3t35 lc3t35 closed this as completed Aug 1, 2013
@xolvio
Copy link
Collaborator

xolvio commented Aug 1, 2013

Great to hear

@lc3t35
Copy link
Contributor Author

lc3t35 commented Aug 5, 2013

I forgot to change rtd.conf.js coverage enable to true, the error is still here :(

@lc3t35 lc3t35 reopened this Aug 5, 2013
@lc3t35
Copy link
Contributor Author

lc3t35 commented Aug 5, 2013

npm ls -g

/usr/local/lib
├─┬ bower@0.10.0
├─┬ grunt-cli@0.1.9
├─┬ istanbul@0.1.43
├─┬ jasmine-node@1.11.0
├─┬ karma@0.8.8
├─┬ meteorite@0.5.1
├── n@1.0.0
├─┬ npm@1.2.32
├─┬ phantomjs@1.9.1-0
├── selenium-webdriver@2.33.0

@robotlovesyou
Copy link

Hi, I have the same issue. I've disabled coverage reporting for now.
I'm running node 0.10.5 and the required npm modules as per the docs.

@xolvio
Copy link
Collaborator

xolvio commented Aug 6, 2013

Thanks for the reports, I'll work on this again soon, a little swamped for the next week or so

@xolvio
Copy link
Collaborator

xolvio commented Aug 16, 2013

this seems to be working now with the latest karma. Could you guys kindly check out the latest and let me know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants