package ru.colibri.ui.steps.general;

import ru.colibri.ui.core.settings.DriversSettings;
import ru.colibri.ui.core.steps.AbsSteps;

import java.util.concurrent.TimeUnit;

public abstract class AbsServiceSteps extends AbsSteps {

    public void goToMain(String screenName) {
        int implicitlyWaitInSecondsOld = getDriversSettings().getImplicitlyWaitInSeconds();
        int implicitlyWaitInSecondsNew = 10;
//        уменьшаем ожидалку
        driver.manage().timeouts().implicitlyWait(implicitlyWaitInSecondsNew, TimeUnit.SECONDS);
        returnCycle(screenName);
//        возвращаем ожидалку на место
        driver.manage().timeouts().implicitlyWait(implicitlyWaitInSecondsOld, TimeUnit.SECONDS);
    }


    protected abstract void returnCycle(String screenName);

    protected abstract ISystemButtonsClick getISystemButtonsClickBean();

    protected abstract DriversSettings getDriversSettings();

    protected abstract String getAlertLocator();
}

package ru.colibri.ui.steps.general;

import ru.colibri.ui.core.settings.DriversSettings;
import ru.colibri.ui.core.steps.AbsSteps;

import java.util.concurrent.TimeUnit;

public abstract class AbsServiceSteps extends AbsSteps {

    private static final int TIMEOUT = 7;
    private int currentTimeout;

    public void goToMain(String screenName) {
        decreaseImplicitlyWait();
        returnCycle(screenName);
        increaseImplicitlyWait();

    }

    private void decreaseImplicitlyWait() {
        currentTimeout = getDriversSettings().getImplicitlyWaitInSeconds();
        driver.manage().timeouts().implicitlyWait(TIMEOUT, TimeUnit.SECONDS);
    }

    private void increaseImplicitlyWait() {
        driver.manage().timeouts().implicitlyWait(currentTimeout, TimeUnit.SECONDS);
    }


    protected abstract void returnCycle(String screenName);

    protected abstract ISystemButtonsClick getISystemButtonsClickBean();

    protected abstract DriversSettings getDriversSettings();

    protected abstract String getAlertLocator();
}

add increaseImplicitlyWait and decreaseImplicitlyWait in AbsServiceSteps (#5)