Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'qa/spec/spec_helper.rb')
-rw-r--r--qa/spec/spec_helper.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/qa/spec/spec_helper.rb b/qa/spec/spec_helper.rb
index 3537ba7c235..0f3cf5f4408 100644
--- a/qa/spec/spec_helper.rb
+++ b/qa/spec/spec_helper.rb
@@ -3,6 +3,20 @@ require_relative '../qa'
Dir[::File.join(__dir__, 'support', '**', '*.rb')].each { |f| require f }
RSpec.configure do |config|
+ ServerNotRespondingError = Class.new(RuntimeError)
+
+ # The login page could take some time to load the first time it is visited.
+ # We visit the login page and wait for it to properly load only once at the beginning of the suite.
+ config.before(:suite) do
+ if QA::Runtime::Scenario.respond_to?(:gitlab_address)
+ QA::Runtime::Browser.visit(:gitlab, QA::Page::Main::Login)
+
+ unless QA::Page::Main::Login.perform(&:page_loaded?)
+ raise ServerNotRespondingError, "Login page did not load at #{QA::Page::Main::Login.perform(&:current_url)}"
+ end
+ end
+ end
+
config.before do |example|
QA::Runtime::Logger.debug("Starting test: #{example.full_description}") if QA::Runtime::Env.debug?