Object AllureHelper
-
- All Implemented Interfaces:
public class AllureHelper
Статический класс с методами управления шагами отчета Allure.
Пример:
AllureHelper.runStep("Название шага", () -> { // ... var value = getValue(); AllureHelper.setParameterToStep("value", value); // ... });
-
-
Field Summary
Fields Modifier and Type Field Description private ConcurrentHashMap<Long, AllureLifecycle>
allureLifecyclesMap
private final ConcurrentHashMap<String, String>
steps
public final static AllureHelper
INSTANCE
-
Method Summary
Modifier and Type Method Description final static Unit
runStep(String stepName, Runnable stepRunnable)
Создание шага Allure и выполнение переданной лямбды. final static <T extends Any> T
runStep(String stepName, Function0<T> stepFunction)
Создание шага Allure, выполнение переданной лямбды и получение из неё объекта. final static <T extends Any> Unit
setParameterToStep(String parameterName, T parameterValue)
Установка параметра шагу Allure. final static Unit
addAttachment(String fileName, File file)
Добавление файла к отчету final static Unit
addAttachment(File file)
Добавление файла к отчету final ConcurrentHashMap<Long, AllureLifecycle>
getAllureLifecyclesMap()
final Unit
setAllureLifecyclesMap(ConcurrentHashMap<Long, AllureLifecycle> allureLifecyclesMap)
final ConcurrentHashMap<String, String>
getSteps()
-
-
Method Detail
-
runStep
final static Unit runStep(String stepName, Runnable stepRunnable)
Создание шага Allure и выполнение переданной лямбды.
Для добавления параметра к этому шагу используйте метод setParameterToStep внутри лямбды.
- Parameters:
stepName
- Название шагаstepRunnable
- Действия шага- Since:
2.0.6
-
runStep
final static <T extends Any> T runStep(String stepName, Function0<T> stepFunction)
Создание шага Allure, выполнение переданной лямбды и получение из неё объекта.
Для добавления параметра к этому шагу используйте метод setParameterToStep внутри лямбды.
- Parameters:
stepName
- Название шагаstepFunction
- Действия шага- Returns:
Объект, возвращаемый лямбдой
- Since:
2.0.6
-
setParameterToStep
final static <T extends Any> Unit setParameterToStep(String parameterName, T parameterValue)
Установка параметра шагу Allure.
AllureHelper.runStep("Название шага", () -> { // ... var value = //... AllureHelper.setParameterToStep("Название параметра", value); // ... });
- Parameters:
parameterName
- Название параметраparameterValue
- Значение параметра- Since:
2.4.0
-
addAttachment
final static Unit addAttachment(String fileName, File file)
Добавление файла к отчету
- Parameters:
fileName
- Название файлаfile
- Файл
-
addAttachment
final static Unit addAttachment(File file)
Добавление файла к отчету
- Parameters:
file
- Файл
-
getAllureLifecyclesMap
final ConcurrentHashMap<Long, AllureLifecycle> getAllureLifecyclesMap()
-
setAllureLifecyclesMap
final Unit setAllureLifecyclesMap(ConcurrentHashMap<Long, AllureLifecycle> allureLifecyclesMap)
-
getSteps
final ConcurrentHashMap<String, String> getSteps()
-
-
-
-