Обновленная версия каратэ до 0.9.5 с 0.9.2 - ошибка: java .lang.IllegalArgumentException: недопустимая ссылка на группу - PullRequest
0 голосов
/ 20 марта 2020

После обновления каратэ с 0.9.5 с 0.9.2 я получаю следующую ошибку при выполнении набора тестов с Runner.path -> java .lang.IllegalArgumentException: недопустимая ссылка на группу

TestRunner. java


import com.intuit.karate.KarateOptions;
import com.intuit.karate.Results;
import com.intuit.karate.Runner;
import com.pro.api.tests.helpers.FileUtility;
import net.masterthought.cucumber.Configuration;
import net.masterthought.cucumber.ReportBuilder;
import org.apache.commons.io.FileUtils;
import org.junit.Test;

import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.TimeZone;

import static org.junit.Assert.assertTrue;

@KarateOptions(tags = {"~@ignore"},
        features = {*FeatureListHere*
        })

public class TestRunner {

    private void generateReport(String karateOutputPath) throws Exception {
        Collection<File> jsonFiles = FileUtils.listFiles(new File(karateOutputPath), new String[]{"json"}, true);
        List<String> jsonPaths = new ArrayList<String>(jsonFiles.size());
        for (File file : jsonFiles) {
            jsonPaths.add(file.getAbsolutePath());
        }
        Configuration config = new Configuration(new File("target"), "Rest-API Automation Suite");
        ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
        reportBuilder.generateReports();
    }

    @Test
    public void testAllFeatures() throws Exception {
        TimeZone.setDefault(TimeZone.getTimeZone("IST"));

        String karateOutputPath = "target/surefire-reports";
        Results stats = Runner.parallel(getClass(), 1, karateOutputPath);
        generateReport(karateOutputPath);
        FileUtility.constructEmailableReport("target/cucumber-html-reports/overview-features.html");
        assertTrue("There are scenario failures", stats.getFailCount() == 0);
    }

}

НЕИСПРАВНОСТЬ СТРОИТЕЛЬНОГО ВЫХОДА:

Выполнение прерывается с помощью приведенного ниже ошибка и отчеты не генерируются

[ERROR] testAllFeatures(com.pro.api.tests.features.TestRunner)  Time elapsed: 1,244.887 s  <<< ERROR!
java.lang.IllegalArgumentException: Illegal group reference
    at com.pro.api.tests.features.TestRunner.testAllFeatures(TestRunner.java:59)
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   TestRunner.testAllFeatures:59 ? IllegalArgument Illegal group reference
[INFO] 
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[Container] 2020/03/20 07:02:46 Command did not exit successfully mvn clean install -Dkarate.env=$ENVIRONMENT exit status 1
[Container] 2020/03/20 07:02:46 Phase complete: BUILD State: FAILED
[Container] 2020/03/20 07:02:46 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: mvn clean install -Dkarate.env=$ENVIRONMENT. Reason: exit status 1
[Container] 2020/03/20 07:02:47 Entering phase POST_BUILD
[Container] 2020/03/20 07:02:47 Phase complete: POST_BUILD State: SUCCEEDED
[Container] 2020/03/20 07:02:47 Phase context status code:  Message: 
[Container] 2020/03/20 07:02:47 Preparing to copy secondary artifacts latest
[Container] 2020/03/20 07:02:47 Expanding base directory path: target/cucumber-html-reports
[Container] 2020/03/20 07:02:47 Assembling file list
[Container] 2020/03/20 07:02:47 Expanding target/cucumber-html-reports
[Container] 2020/03/20 07:02:47 Skipping invalid file path target/cucumber-html-reports
[Container] 2020/03/20 07:02:47 Phase complete: UPLOAD_ARTIFACTS State: FAILED
[Container] 2020/03/20 07:02:47 Phase context status code: CLIENT_ERROR Message: no matching base directory path found for target/cucumber-html-reports
...