diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-11-10 09:15:40 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-11-10 09:15:40 +0100 |
commit | a5ab2a5e3a708762015073b1f63c51afe584ad95 (patch) | |
tree | f3c5f998c151687bbbe2051c75eb60128f0f893c | |
parent | 14238ee238697a80defc480bc8385dc91550598d (diff) | |
download | gitlab-ce-a5ab2a5e3a708762015073b1f63c51afe584ad95.tar.gz |
Do not require to set Capybara app_host in RSpec
-rw-r--r-- | qa/qa/page/main/entry.rb | 2 | ||||
-rw-r--r-- | qa/qa/scenario/entrypoint.rb | 23 | ||||
-rw-r--r-- | 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 |