com.epam.jdi.uitests.web.selenium.elements.actions.ActionScenrios Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdi-uitest-web Show documentation
Show all versions of jdi-uitest-web Show documentation
Epam UI Automation framework package for Web
package com.epam.jdi.uitests.web.selenium.elements.actions;
/*
* Copyright 2004-2016 EPAM Systems
*
* This file is part of JDI project.
*
* JDI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* JDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with JDI. If not, see .
*/
import com.epam.commons.Timer;
import com.epam.commons.linqinterfaces.JAction;
import com.epam.commons.linqinterfaces.JActionTTTT;
import com.epam.commons.linqinterfaces.JFuncTTTTTR;
import com.epam.jdi.uitests.core.logger.LogLevels;
import com.epam.jdi.uitests.web.selenium.elements.base.BaseElement;
import java.util.function.Function;
import java.util.function.Supplier;
import static com.epam.jdi.uitests.core.settings.JDISettings.*;
import static java.lang.String.format;
/**
* Created by Roman_Iovlev on 8/10/2015.
*/
public class ActionScenrios {
protected BaseElement element;
public ActionScenrios setElement(BaseElement element) {
this.element = element;
return this;
}
public static JActionTTTT actionScenario =
(element, actionName, jAction, level) -> {
element.logAction(actionName, level);
logger.logOff(() -> {
try {
new Timer(timeouts.getCurrentTimeoutSec() * 1000).wait(() -> {
jAction.invoke();
return true;
});
} catch (Exception | Error ex) {
throw asserter.exception("Do action %s failed. Can't get result. Reason: %s", actionName, ex.getMessage());
}});
logger.debug("Done");
};
public void actionScenario(String actionName, JAction jAction, LogLevels level) {
actionScenario.invoke(element, actionName,
jAction, level);
}
public static JFuncTTTTTR, Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy