/** * Instantiates the @ManagedPages-annotated Pages instance using current WebDriver. */ protected void injectScenarioStepsInto(final Object testCase) { StepAnnotations.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()); }
/** * 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); }
/** * Instantiates the step scenario fields in a test case. */ public static void injectScenarioStepsInto(final Object testCase, final StepFactory stepFactory) { List<StepsAnnotatedField> stepsFields = StepsAnnotatedField.findOptionalAnnotatedFields(testCase.getClass()); instanciateScenarioStepFields(testCase, stepFactory, stepsFields); }
/** * Instantiates the @ManagedPages-annotated Pages instance using current WebDriver. */ protected static void injectAnnotatedPagesObjectInto(final Object testCase) { StepAnnotations.injectOptionalAnnotatedPagesObjectInto(testCase, getPages()); }
private <T> void instantiateAnyNestedStepLibrariesIn(final T steps, final Class<T> scenarioStepsClass) { StepAnnotations.injectNestedScenarioStepsInto(steps, this, scenarioStepsClass); }
private static void instanciateScenarioStepFields( final Object testCaseOrSteps, final StepFactory stepFactory, final List<StepsAnnotatedField> stepsFields) { for(StepsAnnotatedField stepsField : stepsFields) { instantiateAnyUnitiaializedSteps(testCaseOrSteps, stepFactory, stepsField); } }
private void instantiateAnyUnitiaializedSteps(Object testCaseOrSteps, StepFactory stepFactory, StepsAnnotatedField stepsField) { if (!stepsField.isInstantiated(testCaseOrSteps)) { ensureThatThisFieldIsNotCyclicOrRecursive(stepsField); Class<?> scenarioStepsClass = stepsField.getFieldClass(); Object steps = StepLibraryCreator.usingConfiguredCreationStrategy(stepFactory, stepsField, environmentVariables) .initiateStepsFor(scenarioStepsClass); stepsField.setValue(testCaseOrSteps, steps); stepsField.assignActorNameIn(steps); injectNestedScenarioStepsInto(steps, stepFactory, scenarioStepsClass); } }
/** * 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 step scenario fields in a test case. */ public static void injectScenarioStepsInto(final Object testCase, final StepFactory stepFactory) { List<StepsAnnotatedField> stepsFields = StepsAnnotatedField.findOptionalAnnotatedFields(testCase.getClass()); instanciateScenarioStepFields(testCase, stepFactory, stepsFields); }
/** * 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.injectOptionalAnnotatedPagesObjectInto(testCase, getPages()); }
private <T> void instantiateAnyNestedStepLibrariesIn(final T steps, final Class<T> scenarioStepsClass) { StepAnnotations.injectNestedScenarioStepsInto(steps, this, scenarioStepsClass); }
private static void instanciateScenarioStepFields( final Object testCaseOrSteps, final StepFactory stepFactory, final List<StepsAnnotatedField> stepsFields) { for(StepsAnnotatedField stepsField : stepsFields) { instantiateAnyUnitiaializedSteps(testCaseOrSteps, stepFactory, stepsField); } }
/** * Injects instrumented step classes into any @Step annotated fields of the specified class. * * @param testCase */ public void initialize(Object testCase) { StepAnnotations.injectScenarioStepsInto(testCase, stepFactory); }
@Override public Object createInstanceOfType(Class<?> type) { Object stepsInstance = getContext().newInstanceOf(type); StepAnnotations.injector().injectScenarioStepsInto(stepsInstance, getStepFactory()); ThucydidesWebDriverSupport.initializeFieldsIn(stepsInstance); injectDependencies(stepsInstance); return stepsInstance; }
/** * Instantiates the step scenario fields in a test case. */ public static void injectNestedScenarioStepsInto(final Object scenarioSteps, final StepFactory stepFactory, final Class<?> scenarioStepsClass) { List<StepsAnnotatedField> stepsFields = StepsAnnotatedField.findOptionalAnnotatedFields(scenarioStepsClass); instanciateScenarioStepFields(scenarioSteps, stepFactory, stepsFields); }
/** * 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()); }
/** * Instantiates the @ManagedPages-annotated Pages instance using current WebDriver. */ protected static void injectAnnotatedPagesObjectInto(final Object testCase) { StepAnnotations.injectOptionalAnnotatedPagesObjectInto(testCase, getPages()); } }
private static void instantiateAnyUnitiaializedSteps(Object testCaseOrSteps, StepFactory stepFactory, StepsAnnotatedField stepsField) { if (!stepsField.isInstantiated(testCaseOrSteps)) { Class<?> scenarioStepsClass = stepsField.getFieldClass(); Object steps = stepFactory.getStepLibraryFor(scenarioStepsClass); stepsField.setValue(testCaseOrSteps, steps); injectNestedScenarioStepsInto(steps, stepFactory, scenarioStepsClass); } }