package com.intland.codebeamer.functionaltest.page;

import static com.codeborne.selenide.Selectors.byValue;
import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.page;

/**
 * Created by arnold on 2017. 01. 11..
 */



public class RepositoryManagementPage extends BasePage {

    public enum RepositoryManagementOptions {
        NEW_MANAGED_REPO ("#createNew"),
        USE_EXISTING_EXTERNAL_REPO ("#useExternal");

        private final String selector;

        RepositoryManagementOptions(String s) {
            selector = s;
        }

        public boolean equalsName(String otherName) {
            return (otherName == null) ? false : selector.equals(otherName);
        }

        public String toString() {
            return this.selector;
        }
    }

    public void clickOnNext(){
        $(byValue("Next")).click();
    }

    public void selectRepositoryOption(RepositoryManagementOptions option){
        $(option.toString()).click();
    }
}
