undefined method `invalid_element_errors' in capybara-webkit - javascript

first off I'd like to point out that I'm a bit new at this and thus hope this post will be understandable.
Gems:
rails (2.3.11
nokogiri (1.5.4)
cucumber (1.1.9)
capybara (1.1.2)
copybara-webkit (0.12.1)
Right now I'm doing a project were I'm trying to use cucumber for integration testing of a rails web application.
Since the web-application relies heavily on javascript and ajax I want to use a capybara driver that can handle this. (I just realized :rake_test does not) But I don't want to have a browser window pop up all the time as that will take time.
So I opted on capybara-webkit.
But now that I changed driver, by setting the javascript driver for capybara in my env.rb, I keep getting a annoying error all the time:
undefined method `invalid_element_errors' for #<Capybara::Driver::Webkit:0x9c50bf8> (NoMethodError)
./features/step_definitions/some_steps.rb:37
My code at that line:
>> 35 select("something", :from => find("select[class='class_name']")[:id])
>> 36 click_link('javascript_link')
>> 37 click_link('another_javascript_link')
I'm using a find in line 35 since the id is dynamic.
Now it seems like the problem is actually the find method since if I add another find with known id above this point I'm getting the same error thrown on me on that line instead.
How do I get rid of this problem so I can use capybara-webkit?
I've heard somewhere that this is a problem in the actual driver and that a fix is available at the github masterbranch and that you somehow can link your gem there?
If so can anybody explain how to do it?

I've suffered this problem too. It's a capybara-webkit bug: the 0.12.1 version does not have the invalid_element_errors method.
There was a pull request a few months ago with the fix, but it wasn't merged (https://github.com/thoughtbot/capybara-webkit/pull/288). Now they have added the method in the master branch, so you have to use the git repository:
gem 'capybara-webkit', :git => 'git://github.com/thoughtbot/capybara-webkit'
Try it and see if it works for you :).

Related

Emscripten: 'undefined symbol' when calling JavaScript from C/C++; ERROR_ON_UNDEFINED_SYMBOLS does not work

Actually I've two questions, because the common workaround for my initial problem does not work :)
I'm trying to build an Emscripten based library which calls JavaScript functions as described here: https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html#implement-a-c-api-in-javascript
Simply put I just implement my C/C++ code against a C-Function, implement that function in a .js file and 'link' that file using --js-library.
Basically things are working for me except with version EMSDK version 1.38.12 I got a warning when linking the final library:
warning: undefined symbol: foo_
.. which I don't understand but I could just ignore it. In newer versions of EMSDK the behavior changed and the warnings become errors.
Searching for this error you find you can just add -s ERROR_ON_UNDEFINED_SYMBOLS=0 when linking, but this doesn't work (for me) - I still get this error despite I can see this option being added to the linker.
So my questions are:
how do I make -s ERROR_ON_UNDEFINED_SYMBOLS=0 work for me?
and why do I get this warning in the first place? how do I get rid of it?

Anybody used capnproto js (capnp-js) library?

Is there anybody using (or plan to use) capnp-js-plugin and capnp-js modules for nodejs?
I cloned these repos and ran the tests, but they fail. Also when I just install capnp-js (via npm), the generated js code has syntax errors even for a simple schema:
#0xec2f2fe5874ad874;
using Uid=Int32;
struct User {
id #0 :Uid;
name #1 :Text;
}
Thanks
To anybody trying to use these modules, I would suggest to wait a bit, and avoid them for the moment. I have opened an issue (https://github.com/capnp-js/serialization/issues/17) and I got a reply from the owner of the module that I should better wait for the next major release, which will be a completely rewritten version.

Getting 'unexpected mongo exit code 100' while running a meteor application

I am new to meteor .I started learning meteor language by referring a book
'My First Meteor Application'...While i was running my application i am getting a 'unexpected mongo exit code 100' error.It is showing 'unexpected mongo exit code 100 restarting'.help me get over this error
This error indicates that either mongo process is still running in the background or it was killed improperly. You may use
try `ps -A | grep 'mongo'
to see what's going on. Either way, in your .meteor/local/db directory, there will be a non-empty mongo.lock file. If there's an active mongo process, kill it and the file should become empty. Otherwise remove the file manually. When you're done the error should disappear.
This seems to be a common problem and there are multiple similar questions already out there with just as many suggested fixes. Problem is some of the proposed fixes either only work in certain cases or require using the meteor reset command which deletes the apps database(not ideal for everyone). I posted practically the same question a while back. I managed to solve it in my case and posted my answer to my own question here. It seems to have fixed the issue for several people already without the need for meteor reset so it's worth a try if you haven't found a fix yet. Good luck!

Ember and Syn integration

I'm having trouble integrating bitovi syn (link), Rails 3 (asset pipeline), Ember and qunit. I want to use syn for browser simulation for testing purposes. Has anyone done this, if so, how?
I'm using the version of syn that was released 11 Mar 2014. When I load it into my app, two things happen:
I get a global failure in qunit that says "TypeError: 'undefined' is not an object (evaluating 'Syn.schedule')", (around this line: syn.js?body=1:1084)
and
A div with a form is added to my application.
I'm using qunit for the most part, and I dabbled with using YUI to do browser simulation but it isn't working quite the way I had expected it to. I'd really like to use Syn, but I don't understand why it's not working.
In attempting to get it work, I tried adding this line to the top of the syn.js file:
window.Syn = { schedule: function (fn, ms) { Ember.run.later(window, fn, ms); } };
but it didn't do anything much at all.
I'd read on this pull request: https://github.com/bitovi/syn/pull/28 that I could add that piece of code to mount it in a fashion to work with Ember.
Any help would be greatly appreciated!
So the thing here was simply to load Syn at the bottom of the page. It's potentially a bit broken at the moment in the case where you want to load it in the head (which I probably shouldn't have been doing anyway, but still!) :)

Can't retrieve a valid WinSAT assessment. javascript console

i frequently get this error when running my web app on google chrome
[2536:2008:0502/143602:ERROR:gpu_info_collector_win.cc(96)] Can't retrieve a valid WinSAT assessment.
its ok in firefox and IE..
i've already search for solutions but with no luck.
i am using Aptana Studio + Sencha
how to get rid of this?
I had this error when I was providing the path to chrome.exe as the system property - it went away when I was using chromedriver.exe as downloaded from here: https://code.google.com/p/chromedriver/downloads/list
This means that winsat validation failed.
Winsat is a tool that checks out windows. If it fails, normally this indicates that something is wrong with your system (probably a driver).
In the above case, I would go with the display adapter driver, so try to update it via the Windows Update.
To run winsat yourself, you can run 'winsat formal' from the command line. Then you can look for suspicious output (if you have 0 F/S performance in the direct3d, then this is not fine :-))
Based on the problematic output, you can see what is wrong in the system (in the above example, the display adapter was found as a standard VGA, and a simple update, fixed the error made chrome/selenium).
HTH

Categories