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

strategy.rb « ce « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6c1820ffdc84df2ada1a1eed96ea4bd780f01b25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true

module QA
  module CE
    module Strategy
      extend self

      def extend_autoloads!
        # noop
      end

      def perform_before_hooks
        retries ||= 0

        # 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 before the tests.
        QA::Runtime::Browser.visit(:gitlab, QA::Page::Main::Login)
      rescue QA::Page::Validatable::PageValidationError
        if (retries += 1) < 3
          Runtime::Logger.warn("The login page did not appear as expected. Retrying... (attempt ##{retries})")
          retry
        end

        raise
      end
    end
  end
end