module MobileAnalytics
  class IndexPage < BasePage
    page_url "/"

    # these can be replaced with indexed elements if need be
    div(:first_data_card, class: "data-card", index: 0)
    div(:first_data_card_total, class: "card-total", index: 0)
    link(:logout, text: "LOG OUT")
    div(:loader, class: "loading-overlay")
    button(:three_months_time_domain, text: "3 Months")

    def wait_for_graph_to_load
      first_data_card_element.when_present(30)
    end

    def wait_for_loader
      loader_element.when_not_present(30)
    end
  end
end
