/** * Injects instrumented step classes into any @Step annotated fields of the specified class. * * @param testCase */ public void initialize(Object testCase) { StepAnnotations.injector().injectScenarioStepsInto(testCase, stepFactory); }
private <T> void instantiateAnyNestedStepLibrariesIn(final T steps, final Class<T> scenarioStepsClass) { StepAnnotations.injector().injectNestedScenarioStepsInto(steps, this, scenarioStepsClass); }
/** * Instantiates the @ManagedPages-annotated Pages instance using current WebDriver. */ protected static void injectAnnotatedPagesObjectInto(final Object testCase) { StepAnnotations.injector().injectOptionalAnnotatedPagesObjectInto(testCase, getPages()); }
/** * Instantiates the @ManagedPages-annotated Pages instance using current WebDriver. * @param testCase any object (testcase or other) containing injectable Serenity components */ public static void injectScenarioStepsInto(final Object testCase) { StepAnnotations.injector().injectScenarioStepsInto(testCase, getStepFactory()); }
/** * Instantiates the @ManagedPages-annotated Pages instance using current WebDriver. * @param testCase any object (testcase or other) containing injectable Serenity components */ protected static void injectAnnotatedPagesObjectInto(final Object testCase) { StepAnnotations.injector().injectOptionalAnnotatedPagesObjectInto(testCase, getPages()); }
@Override public Object createInstanceOfType(Class<?> type) { Object stepsInstance = getContext().newInstanceOf(type); StepAnnotations.injector().injectScenarioStepsInto(stepsInstance, getStepFactory()); ThucydidesWebDriverSupport.initializeFieldsIn(stepsInstance); injectDependencies(stepsInstance); return stepsInstance; }