
com.qantium.uisteps.serenity.SerenityUtils Maven / Gradle / Ivy
/*
* Copyright 2014 ASolyankin.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.qantium.uisteps.serenity;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.UUID;
import org.junit.Assert;
import net.serenitybdd.core.Serenity;
import net.serenitybdd.core.SessionMap;
import net.thucydides.core.annotations.Step;
import net.thucydides.core.guice.Injectors;
import net.thucydides.core.steps.StepEventBus;
import net.thucydides.core.steps.StepFactory;
import net.thucydides.core.steps.StepListener;
import net.thucydides.core.util.EnvironmentVariables;
import net.thucydides.core.webdriver.Configuration;
import net.thucydides.core.webdriver.SupportedWebDriver;
import net.thucydides.core.webdriver.ThucydidesWebdriverManager;
import net.thucydides.core.webdriver.WebDriverFacade;
import net.thucydides.core.webdriver.WebDriverFactory;
import net.thucydides.core.webdriver.WebdriverInstances;
import net.thucydides.core.webdriver.WebdriverManager;
import net.thucydides.core.webdriver.WebdriverProxyFactory;
import org.openqa.selenium.WebDriver;
/**
*
* @author Asolyankin
*/
public class SerenityUtils {
public static WebDriver getCurrentDriver() {
return getDrivers().getCurrentDriver();
}
public static T getNewStepLibrary(Class stepLibraryClass) {
return getStepFactory().getNewStepLibraryFor(stepLibraryClass);
}
public static StepFactory getStepFactory() {
return new StepFactory();
}
public static String getBaseUrl() {
return getConfiguration().getBaseUrl();
}
public static void putToSession(String key, Object value) {
getCurrentSession().put(key, value);
}
public static Object getFromSession(String key) {
return getCurrentSession().get(key);
}
public static SessionMap
© 2015 - 2025 Weber Informatics LLC | Privacy Policy