Closed jsilvestri closed 5 years ago
I managed to fix this this morning by trying RAILS_ENV=test rake teaspoon
instead of just teaspoon
or bundle exec teaspoon -f documentation
. I am so glad to have it working, but am not sure why this would make any difference?
The primary difference between how test and development (the default env that teaspoon runs in for caching/performance reasons) is usually how errors/exceptions are handled by rails. You might be seeing some exception somewhere that's causing rails to behave differently? That might be where I'd start -- hopefully helpful.
@jejacks0n is there a way to force the teaspoon
command line interface to use test
? I tried RAILS_ENV=test teaspoon
, but that has the same timeout error as initially listed in this issue.
RAILS_ENV=development rake teaspoon
does fail, but with a different error:
DEPRECATION WARNING: The factory_girl gem is deprecated. Please upgrade to factory_bot. See https://github.com/thoughtbot/factory_bot/blob/v4.9.0/UPGRADE_FROM_FACTORY_GIRL.md for further instructions. (called from require at /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:82)
Starting the Teaspoon server...
[4206] Puma starting in cluster mode...
[4206] * Version 3.11.0 (ruby 2.3.4-p301), codename: Love Song
[4206] * Min threads: 1, max threads: 1
[4206] * Environment: test
[4206] * Process workers: 2
[4206] * Preloading application
[4206] * Listening on tcp://127.0.0.1:37029
[4206] Use Ctrl-C to stop
Unable to start teaspoon server; could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
It looks like it can't connect to the server at the port specified. You can configure teaspoon to use a specific port, and if you're inside a docker container you need to make sure that port is something that will be available.
We recently upgraded to rails 5.1 from 4.2, and in the process upgraded to teaspoon 1.1.5 as well. I am able to get jasmine tests running with teaspoon both in a browser and by running teaspoon from the command line locally on my Mac, but I cannot get them to work in the Docker instance that used to work on rails 4.2 / teaspoon 1.1.1. I get the error
Timed out (Selenium::WebDriver::Error::TimeOutError)
.When I investigate further, in lib/teaspoon/driver/selenium.rb,
driver.navigate.to(url)
is not getting to anything, because evendriver.execute_script("return window")
returns[]
. I am using headless chromedriver v. 2.36.540471 (which I also use successfully with Docker for rspec tests).I have Selenium debugging logs on, but they say nothing of interest (just that we get stuck in the
.until
loop in selenium.rb until time out is reached). If you have more ways I could debug, I would appreciate it. I have been scouring blogs and trying all sorts of flags!Here are my logs (NOTE that there are many more lines further down that just duplicate the checking for
return window.Teaspoon && window.Teaspoon.finished
andreturn window.Teaspoon && window.Teaspoon.getMessages()
).Thanks!