Sha256: a51f980091a0d9b5fcbae6b4939d9297f76ffaa9a3bc30d9f7836dd6fd06f8e2
Contents?: true
Size: 1.23 KB
Versions: 4
Compression:
Stored size: 1.23 KB
Contents
require 'capybara' require 'capybara/poltergeist' require 'launchy' require_relative './web_application' require_relative './suite' # Set the default_wait_time to something reasonable for the entire length of # the test suite to run. This should probably eventually be something # configurable because these could break for people with long running test # suites. Capybara.default_wait_time = 120 # 2 mins module Snapdragon class CliApplication def initialize(arguements) @args = arguements @suite = Snapdragon::Suite.new(arguements) end def run session = Capybara::Session.new(:poltergeist, Snapdragon::WebApplication.new(nil, @suite)) if @suite.filtered? session.visit("/run?spec=#{@suite.spec_query_param}") else session.visit("/run") end session.find("#testscomplete") return 0 end def serve server = Capybara::Server.new(Snapdragon::WebApplication.new(nil, @suite), 9292) server.boot if @suite.filtered? Launchy.open("http://localhost:9292/run?spec=#{@suite.spec_query_param}") else Launchy.open('http://localhost:9292/run') end trap('SIGINT') { puts "Shutting down..."; exit 0 } sleep end end end
Version data entries
4 entries across 4 versions & 1 rubygems