package cz.moneta.test.dsl.mobile.smartbanking.activation;

import cz.moneta.test.harness.support.mobile.MobileLookup;
import cz.moneta.test.harness.support.mobile.android.AndroidClick;
import cz.moneta.test.harness.support.mobile.android.AndroidTypeInto;
import cz.moneta.test.harness.support.mobile.android.AndroidTypeIntos;
import cz.moneta.test.harness.support.mobile.android.AndroidWait;
import cz.moneta.test.harness.support.mobile.ios.IosClick;
import cz.moneta.test.harness.support.mobile.ios.IosTypeInto;
import cz.moneta.test.harness.support.mobile.ios.IosTypeIntos;
import cz.moneta.test.harness.support.mobile.ios.IosWait;
import cz.moneta.test.harness.support.mobile.share.MobileFlow;

import static cz.moneta.test.dsl.mobile.smartbanking.activation.SetActivationCodeView.IOS_CODE_FIRST;
import static cz.moneta.test.dsl.mobile.smartbanking.activation.SetActivationCodeView.IOS_CODE_SECOND;
import static cz.moneta.test.dsl.mobile.smartbanking.activation.SetActivationCodeView.IOS_CODE_THIRD;
import static cz.moneta.test.dsl.mobile.smartbanking.activation.SetActivationCodeView.IOS_CODE_FOURTH;
import static cz.moneta.test.dsl.mobile.smartbanking.activation.SetActivationCodeView.ANDROID_CODE_FIRST;
import static cz.moneta.test.dsl.mobile.smartbanking.activation.SetActivationCodeView.ANDROID_CODE_SECOND;
import static cz.moneta.test.dsl.mobile.smartbanking.activation.SetActivationCodeView.ANDROID_CODE_THIRD;
import static cz.moneta.test.dsl.mobile.smartbanking.activation.SetActivationCodeView.ANDROID_CODE_FOURTH;

@IosWait(value = {IOS_CODE_FIRST, IOS_CODE_SECOND, IOS_CODE_THIRD, IOS_CODE_FOURTH}, by = MobileLookup.XPATH)
@AndroidWait(value = {ANDROID_CODE_FIRST, ANDROID_CODE_SECOND, ANDROID_CODE_THIRD, ANDROID_CODE_FOURTH})
public interface SetActivationCodeView extends MobileFlow<SetActivationCodeView> {
    String ANDROID_CODE_FIRST = "edit_input_activation_code_first";
    String ANDROID_CODE_SECOND = "edit_input_activation_code_second";
    String ANDROID_CODE_THIRD = "edit_input_activation_code_third";
    String ANDROID_CODE_FOURTH = "edit_input_activation_code_fourth";
    String ANDROID_CONTINUE_BUTTON = "btn_input_code_continue";

    String IOS_CODE_FIRST = "//XCUIElementTypeTextField[1]";
    String IOS_CODE_SECOND = "//XCUIElementTypeTextField[2]";
    String IOS_CODE_THIRD = "//XCUIElementTypeTextField[3]";
    String IOS_CODE_FOURTH = "//XCUIElementTypeTextField[4]";
    String IOS_CONTINUE_BUTTON = "Pokračovat";

    @IosTypeIntos({
            @IosTypeInto(value = IOS_CODE_FIRST, by = MobileLookup.XPATH, hideKeyboardAfterType = false),
            @IosTypeInto(value = IOS_CODE_SECOND, by = MobileLookup.XPATH, hideKeyboardAfterType = false),
            @IosTypeInto(value = IOS_CODE_THIRD, by = MobileLookup.XPATH, hideKeyboardAfterType = false),
            @IosTypeInto(value = IOS_CODE_FOURTH, by = MobileLookup.XPATH, hideKeyboardAfterType = false, andWait = @IosWait(IOS_CONTINUE_BUTTON))})
    @AndroidTypeIntos({
            @AndroidTypeInto(value = ANDROID_CODE_FIRST, hideKeyboardAfterType = false),
            @AndroidTypeInto(value = ANDROID_CODE_SECOND, hideKeyboardAfterType = false),
            @AndroidTypeInto(value = ANDROID_CODE_THIRD, hideKeyboardAfterType = false),
            @AndroidTypeInto(value = ANDROID_CODE_FOURTH, hideKeyboardAfterType = false, andWait = @AndroidWait(ANDROID_CONTINUE_BUTTON))})
    SetActivationCodeView typePartsOfCode(String firstPart, String secondPart, String thirdPart, String fourthPart);

    @AndroidClick(ANDROID_CONTINUE_BUTTON)
    @IosClick(IOS_CONTINUE_BUTTON)
    ActivationPinView tapOnContinueButton();

}
