Fixing Testing Errors

7 views
Skip to first unread message

Steven Leiva

unread,
Dec 11, 2015, 9:17:46 PM12/11/15
to Bridge Troll
Hi Everyone,

I am trying to contribute to BridgeTroll. Specifically, I'm trying to make a pull request to address issue 394.

I have the feature working. The code is up on a branch of my fork.

I have finished writing tests for the code that I wrong, but unfortunately the build failed on Travis CI as well as local. I am not sure how to fix this errors. I will continue researching this on my own, but thought I'd ask in case anyone could point me in the right direction.

Steven Leiva

unread,
Dec 11, 2015, 9:46:27 PM12/11/15
to Bridge Troll
The second error - i.e., failing to click on "Assign" - is due to the fact that the search results are on top of the assign button.

I'm not sure how to fix this. I've tried using sleep(1) before click_button("Assign") and I've tried using page.find("input.btn.btn-primary").trigger('click') but none of that seemed to fix it.

Some other posts suggest using selenium instead of poltergeist, but that seems like an overkill of a solution for such a small problem.

Steven Leiva

unread,
Dec 11, 2015, 10:36:47 PM12/11/15
to Bridge Troll
OK - I hope I'm not spamming anyone here ;)

The issue seems to be that the code that is supposed to click on the results of the search - page.find('.select2-results__option').click - is not actually doing the clicking. How do I know this? Because when I run the tests and replace click_button "Assign" with page.find('input.btn.btn-primary').trigger('click') as suggested by the error message, I get a new error:

ActiveRecord::RecordNotFound:
       Couldn't find User with 'id'=


This error indicates that we in fact did click on the "Assign" button but we didn't click on an option.

So I guess the solution is to actually click on the options presented after a search. Off to figure that out.

Steven Leiva

unread,
Dec 11, 2015, 11:27:16 PM12/11/15
to Bridge Troll
It turns out that this has all been one giant mistake.

Unfortunately, I ran bundle update. For whatever reason, I thought that that command was innocuous, and the real issue lay in changing the Gemfile.

I've learned my lesson.
Reply all
Reply to author
Forward
0 new messages