//
//  EnrollPages.swift
//  Pi
//  Copyright © 2021 Evidation Health Inc. All rights reserved.
//
//  Contains the variables and methods for various enrollment pages

import XCTest

class EnrollPages: BasePage {
    /*
     * Enroll page constants
     */
    let NEXT_BUTTON = "Next"
    let LETS_GO_BUTTON = "Start"

    /*
     * What to know about Intuition constants
     */
    let WHAT_TO_KNOW_TEXT = "What to know about Intuition"

    /*
     * How you'll participate page constants
     */
    let PARTICIPATE_PAGE_TEXT = "How you can help"

    /*
     * Let's get started page constants
     */
    let GET_STARTED_TEXT = "Steps to enroll"

    /*
     * Method continueWhatToKnowPage is to assert what to know page and continue in the flow
     */
    func continueWhatToKnowPage() {
        buttonExists(WHAT_TO_KNOW_TEXT, timeout: 2)
        tapButtonExists(NEXT_BUTTON)
    }

    /*
     * Method continueParticipatePage is to assert how you'' participate page and continue in the flow
     */
    func continueParticipatePage() {
        buttonExists(PARTICIPATE_PAGE_TEXT)
        app.swipeUp()
        tapButtonExists(NEXT_BUTTON)
    }

    /*
     * Method continueGetStartedPage is to assert let's get started page and continue in the flow
     */
    func continueGetStartedPage() {
        buttonExists(GET_STARTED_TEXT)
        tapButtonExists(LETS_GO_BUTTON)
    }

    /*
     * Method continueEligibilityPage is to assert Eligibility page and continue in the flow
     */
    func continueEligibilityPage() {
        buttonExists("Eligibility")
        tapButtonExists(NEXT_BUTTON)
    }

    /*
     * Method enroll is to enroll a user until the SingPass login
     */
    func enroll() {
        continueWhatToKnowPage()
        continueParticipatePage()
        continueGetStartedPage()
        continueEligibilityPage()
    }
}
