package cz.moneta.test.regression.internal.forte;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.forte.components.ForteRoles;
import cz.moneta.test.harness.annotations.Environment;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenarioWithOrder;
import org.junit.jupiter.api.Order;

@TestScenarioWithOrder(name = "Appointments")
public class AppointmentsTest {

    @Order(1)
    @TestCase(name = "Appointments - Add branch and change capacity", environments = {Environment.TST1})
    public void appointmentsAddBranchAndChangeCapacity(Harness harness) {
        harness.withForte()
                .openForteHomePage()
                .clickAppointments()
                .selectRoleMenu(ForteRoles.BANKER)
                .clickAddOM()
                .fillBranchName("bbc")
                .clickFirstSearchedOm()
                .clickRoleMenu("Osobní bankéř")
                .clickSubmit()
                .clickSetActiveBranch()
                .clickChangeCapacity()
                .fillCapacity(10)
                .clickSetCapacity()
                .checkBranchCapacity(10);
    }

    @Order(2)
    @TestCase(name = "Appointments - check menu", environments = {Environment.TST1})
    public void openFindAppointmentsParam(Harness harness) {
        harness.withForte()
                .openForteHomePage()
                .clickAppointments()
                .selectRoleMenu(ForteRoles.APP_ADMIN)
                .clickRolesAdministration()
                .checkTablePresents()
                .clickProductTypes()
                .checkTablePresents()
                .clickListOfEmptySlots()
                .checkTablePresents();
    }
}
