Search in sources :

Example 1 with DataReplacer

use of ru.sbtqa.tag.pagefactory.data.DataReplacer in project page-factory-2 by sbtqa.

the class DataAspect method sendStepStart.

@Around("sendStepStart(event)")
public void sendStepStart(ProceedingJoinPoint joinPoint, TestStepStarted event) throws Throwable {
    PickleStepTestStep testStep = (PickleStepTestStep) event.testStep;
    DataReplacer dataParser = new DataReplacer();
    dataParser.replace(testStep);
    joinPoint.proceed(new Object[] { event });
}
Also used : DataReplacer(ru.sbtqa.tag.pagefactory.data.DataReplacer) Around(org.aspectj.lang.annotation.Around)

Example 2 with DataReplacer

use of ru.sbtqa.tag.pagefactory.data.DataReplacer in project page-factory-2 by sbtqa.

the class FragmentReplacer method isFragmentNameMatch.

private boolean isFragmentNameMatch(String name, Step step, String language, String data) throws DataException, FragmentException {
    boolean isFragmentNameMatch = FragmentUtils.getFragmentName(step, language).equals(name);
    if (!isFragmentNameMatch) {
        String scenarioNameFromData = new DataReplacer().replaceDataPlaceholders(step.getText(), data);
        Step stepNew = new Step(step.getLocation(), step.getKeyword(), scenarioNameFromData, step.getArgument());
        isFragmentNameMatch = FragmentUtils.getFragmentName(stepNew, language).equals(name);
    }
    return isFragmentNameMatch;
}
Also used : DataReplacer(ru.sbtqa.tag.pagefactory.data.DataReplacer) Step(gherkin.ast.Step)

Aggregations

DataReplacer (ru.sbtqa.tag.pagefactory.data.DataReplacer)2 Step (gherkin.ast.Step)1 Around (org.aspectj.lang.annotation.Around)1