summaryrefslogtreecommitdiff
path: root/qa/qa/page/main/entry.rb
blob: ae6484b4bfed3afe1e045bd52c7c2ea61d40c944 (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
module QA
  module Page
    module Main
      class Entry < Page::Base
        def visit_login_page
          visit("#{Runtime::Scenario.gitlab_address}/users/sign_in")
          wait_for_instance_to_be_ready
        end

        private

        def wait_for_instance_to_be_ready
          # This resolves cold boot / background tasks problems
          #
          start = Time.now

          while Time.now - start < 240
            break if page.has_css?('.application', wait: 10)

            refresh
          end
        end
      end
    end
  end
end