summaryrefslogtreecommitdiff
path: root/qa/qa/page/main/entry.rb
blob: be2e7e8e6c87ed8e1a5d393080e5d2d26210cbcc (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
module QA
  module Page
    module Main
      class Entry < Page::Base
        def visit_login_page
          visit('/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