From a5ab2a5e3a708762015073b1f63c51afe584ad95 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Fri, 10 Nov 2017 09:15:40 +0100 Subject: Do not require to set Capybara app_host in RSpec --- qa/qa/page/main/entry.rb | 2 +- qa/qa/scenario/entrypoint.rb | 23 ++++++++++++----------- qa/qa/specs/config.rb | 8 +------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/qa/qa/page/main/entry.rb b/qa/qa/page/main/entry.rb index a9810beeb29..fa1cad62741 100644 --- a/qa/qa/page/main/entry.rb +++ b/qa/qa/page/main/entry.rb @@ -3,7 +3,7 @@ module QA module Main class Entry < Page::Base def initialize - visit('/') + visit(Runtime::Scenario.gitlab_address) # This resolves cold boot / background tasks problems # diff --git a/qa/qa/scenario/entrypoint.rb b/qa/qa/scenario/entrypoint.rb index 8f708fe38ab..a6a7120aed8 100644 --- a/qa/qa/scenario/entrypoint.rb +++ b/qa/qa/scenario/entrypoint.rb @@ -7,18 +7,9 @@ module QA class Entrypoint < Template include Bootable - def self.tags(*tags) - @tags = tags - end - - def self.get_tags - @tags - end - def perform(address, *files) - Specs::Config.perform do |specs| - specs.address = address - end + Runtime::Scenario.define(:gitlab_address, address) + Specs::Config.perform ## # Perform before hooks, which are different for CE and EE @@ -33,6 +24,16 @@ module QA ) end end + + private + + def self.tags(*tags) + @tags = tags + end + + def self.get_tags + @tags + end end end end diff --git a/qa/qa/specs/config.rb b/qa/qa/specs/config.rb index 79c681168cc..b1b8d9a3ca8 100644 --- a/qa/qa/specs/config.rb +++ b/qa/qa/specs/config.rb @@ -11,13 +11,7 @@ module QA class Config < Scenario::Template attr_writer :address - def initialize - @address = ENV['GITLAB_URL'] - end - def perform - raise 'Please configure GitLab address!' unless @address - configure_rspec! configure_capybara! end @@ -56,7 +50,7 @@ module QA end Capybara.configure do |config| - config.app_host = @address + # config.app_host = @address config.default_driver = :chrome config.javascript_driver = :chrome config.default_max_wait_time = 4 -- cgit v1.2.1