Comparing debug info when running Firefox and Chromium. For this I add a simple Watir test, which can use either firefox or chromium as test viewer. Moving the old test/feature/test_home.rb and test_kontakt.rb to test/watir and making them run in the new environment.
Having troubles to get the old unit test which are using phantomjs to run. I think it will be easier for me to begin from scratch by using the watir spec test from oddb.org.
Discovered that Ruby 2.x has a much better interface for spawning processes. E.g. pid = Process.spawn('bundle', 'exec', 'rackup', 'spec/config.ru', { :err => ['app_spec.log', 'w+'], :out => ['app_spec.log', 'a+']})
allowed me to handle stdoutput and std error of a bundler command. Details see https://ruby-doc.org/core-2.2.0/Process.html#method-c-spawn.
Also added a spec/config.ru file to start the steinwies app with different port for the test. Config.ru looks like this
#\ -w -p 11080 # 11080 must be in sync with TEST_SRV_URI from tst_util.rb lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../src').untaint) $LOAD_PATH << lib_dir $LOAD_PATH << File.dirname(lib_dir) require 'spec/tst_util' # to override the DRB-port require 'util/app' use Rack::Reloader, 0 use Rack::ContentLength use(Rack::Static, urls: ["/doc/"]) map '/doc' do run Proc.new { |env| ['200', {'Content-Type' => 'text/html'}, ['first_post', 'second_post', 'third_post']] } end app = Rack::ShowExceptions.new(Rack::Lint.new(Steinwies::AppWebrick.new())) run app
Fixed steinweis config.ru to get the server port from the etc/config.yml.
Asking myself why running via spec/config.ru I get the error DRb::DRbBadURI at /
whereas I have no problem with the default config.ru. Pushed commit (which should fail in the spec test on travis) with
If failed, but for a different reason that I expected. It did not find the chromeriver executable, which can be found under http://chromedriver.storage.googleapis.com/2.25/chromedriver_linux64.zip, but which should be downloaded and put somewhere in the executable path. Pushed Make chromedriver work under travis-CI
Added a missing @require 'util/config'@ in spec/config.ru to fix patching the DRb-URI used. Made some small changes to make the home_spec.rb tests pass. Pushed commit Spec for homepage works
Now working on adding a kontakt_spec.rb. Also investigating why the tests do not work under Travis-CI. Somehow they connect to different port. Looks as they did not find an etc/config.yml. I must probably create on if it does not yet exist when runnning the spec test.
Pushed commit Added kontakt_spec. Pending with chrome and firefox. It took some time made the spec test run under firefox, as there is a new dependency on the geckodriver, which had to be downloaded separately (see .travis.yml for details).
A (incomplete) test for submitting the kontakt form were added and are marked as pending. They fila both with chrome and firefox.
Pushed commit Pass values to super class. Kontakt spec fails because going to wrong port 8004
Found out why posting the kontakt form did not work correctly. The parameters of the steinwies/session were not passed to the sbsm/session superclass.
Pushed the small changes to sbsm with commits:
I am a little bit unsure whether my changes to the session class, will have a bigger impact on the clients. I don't think so, as it is only extended in xmlconv, bbmb and ydim.