Question

Some background on what happened. So I have not upgraded/changed any of the gems/code/versions etc regarding my test framework which consists of the following (I am running ruby 1.8.7p374):

gem 'capybara', '1.1.4'
gem 'commander', '4.1.3'
gem 'cucumber', '1.2.3'
gem 'poltergeist', '1.0.2'
gem 'parallel', '0.6.2'
gem 'parallel_tests', '0.10.1'
gem 'rspec', '2.13.0'
gem 'sauce', '2.3.2'
gem 'sauce-cucumber', '2.3.1'
gem 'gherkin', '2.11.6'

Last Wednesday my tests were all passing just fine, Then Thursday morning when I tried to run the suite against our site I am getting a lot of failures with the following message:

  One or more errors were raised in the Javascript code on the page:

  SyntaxError: Parse error (Capybara::Poltergeist::JavascriptError)

As far as changes on our site, we recently changed our login and register forms to go over https but that was on wednesday and I had run my tests before that was deployed.

I am running my tests on a Mac with OSx 10.8.5

I have tried running it on a local linux vagrant box but I still get the error.

However if I run the tests on one of our linux instances (hosted on AWS) it runs fine.

I have tried diagnosing this to death and not found anything. The most useful of them being firebug which picks up no javascript errors on our site at all.

Please help as this is driving me insane.

If I have missed some important information please ask and I will provide.

Was it helpful?

Solution

So it turns out it is Affiliate Window having issues and that was making PhantomJS fall over. Our solution was to disable this for our test environments as it is 3rd party. Just a shame there was no helpful error message.

How we found this you ask...

Well I used remote debugger in Poltergeist which pulled up the error in a the inspector console nice and clearly.

To configure this have a look at this link

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top