@Test void multipleStepsRemoved() { List<Step> baseSteps = getSteps(PAGE_NAME_1); List<Step> comparisonSteps = getSteps(PAGE_NAME_1, PAGE_NAME_1, PAGE_NAME_2); initMocks(baseSteps, comparisonSteps, 0.0); ScenarioDiffInfo scenarioDiffInfo = stepComparator.compare(USE_CASE_NAME, SCENARIO_NAME); double expectedChangeRate = 200.0 / 3.0; assertEquals(expectedChangeRate, scenarioDiffInfo.getChangeRate(), 0.0); assertEquals(0, scenarioDiffInfo.getAdded()); assertEquals(0, scenarioDiffInfo.getChanged()); assertEquals(2, scenarioDiffInfo.getRemoved()); assertTrue(scenarioDiffInfo.getAddedElements().isEmpty()); assertEquals(PAGE_NAME_1, scenarioDiffInfo.getRemovedElements().get(0).getStepLink().getPageName()); assertEquals(PAGE_NAME_2, scenarioDiffInfo.getRemovedElements().get(1).getStepLink().getPageName()); }
public ScenarioDiffInfo compare(final String baseUseCaseName, final String baseScenarioName) { this.baseUseCaseName = baseUseCaseName; this.baseScenarioName = baseScenarioName; final List<Step> baseSteps = loadSteps(parameters.getBaseBranchName(), parameters.getBaseBuildName()); this.comparisonSteps = loadSteps(parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName()); final List<StepLink> baseStepLinks = stepAndPagesAggregator.calculateStepLinks(baseSteps, baseUseCaseName, baseScenarioName); final List<StepLink> comparisonStepLinks = stepAndPagesAggregator.calculateStepLinks(comparisonSteps, baseUseCaseName, baseScenarioName); final ScenarioDiffInfo scenarioDiffInfo = new ScenarioDiffInfo(baseScenarioName); calculateDiffInfo(baseStepLinks, comparisonStepLinks, scenarioDiffInfo); LOGGER.info(getLogMessage(scenarioDiffInfo, "Scenario " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName + "/" + baseScenarioName)); return scenarioDiffInfo; }
StepComparator extends AbstractStructureComparator<StepLink, Integer, StepInfo> { public ScenarioDiffInfo compare(final String baseUseCaseName, final String baseScenarioName) { this.baseUseCaseName = baseUseCaseName; this.baseScenarioName = baseScenarioName; final List<Step> baseSteps = loadSteps(parameters.getBaseBranchName(), parameters.getBaseBuildName()); this.comparisonSteps = loadSteps(parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName()); final List<StepLink> baseStepLinks = stepAndPagesAggregator.calculateStepLinks(baseSteps, baseUseCaseName, baseScenarioName); final List<StepLink> comparisonStepLinks = stepAndPagesAggregator.calculateStepLinks(comparisonSteps, baseUseCaseName, baseScenarioName); final ScenarioDiffInfo scenarioDiffInfo = new ScenarioDiffInfo(baseScenarioName); calculateDiffInfo(baseStepLinks, comparisonStepLinks, scenarioDiffInfo); LOGGER.info(getLogMessage(scenarioDiffInfo, "Scenario " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName + "/" + baseScenarioName)); return scenarioDiffInfo; } }
StepComparator extends AbstractStructureComparator<StepLink, Integer, StepInfo> { public ScenarioDiffInfo compare(final String baseUseCaseName, final String baseScenarioName) { this.baseUseCaseName = baseUseCaseName; this.baseScenarioName = baseScenarioName; final List<Step> baseSteps = loadSteps(parameters.getBaseBranchName(), parameters.getBaseBuildName()); this.comparisonSteps = loadSteps(parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName()); final List<StepLink> baseStepLinks = stepAndPagesAggregator.calculateStepLinks(baseSteps, baseUseCaseName, baseScenarioName); final List<StepLink> comparisonStepLinks = stepAndPagesAggregator.calculateStepLinks(comparisonSteps, baseUseCaseName, baseScenarioName); final ScenarioDiffInfo scenarioDiffInfo = new ScenarioDiffInfo(baseScenarioName); calculateDiffInfo(baseStepLinks, comparisonStepLinks, scenarioDiffInfo); LOGGER.info(getLogMessage(scenarioDiffInfo, "Scenario " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName + "/" + baseScenarioName)); return scenarioDiffInfo; } StepComparator(ComparisonParameters parameters, ScreenshotComparator screenshotComparator); }
StepComparator extends AbstractStructureComparator<StepLink, Integer, StepInfo> { public ScenarioDiffInfo compare(final String baseUseCaseName, final String baseScenarioName) { this.baseUseCaseName = baseUseCaseName; this.baseScenarioName = baseScenarioName; final List<Step> baseSteps = loadSteps(parameters.getBaseBranchName(), parameters.getBaseBuildName()); this.comparisonSteps = loadSteps(parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName()); final List<StepLink> baseStepLinks = stepAndPagesAggregator.calculateStepLinks(baseSteps, baseUseCaseName, baseScenarioName); final List<StepLink> comparisonStepLinks = stepAndPagesAggregator.calculateStepLinks(comparisonSteps, baseUseCaseName, baseScenarioName); final ScenarioDiffInfo scenarioDiffInfo = new ScenarioDiffInfo(baseScenarioName); calculateDiffInfo(baseStepLinks, comparisonStepLinks, scenarioDiffInfo); LOGGER.info(getLogMessage(scenarioDiffInfo, "Scenario " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName + "/" + baseScenarioName)); return scenarioDiffInfo; } StepComparator(ComparisonParameters parameters, ScreenshotComparator screenshotComparator); ScenarioDiffInfo compare(final String baseUseCaseName, final String baseScenarioName); }
StepComparator extends AbstractStructureComparator<StepLink, Integer, StepInfo> { public ScenarioDiffInfo compare(final String baseUseCaseName, final String baseScenarioName) { this.baseUseCaseName = baseUseCaseName; this.baseScenarioName = baseScenarioName; final List<Step> baseSteps = loadSteps(parameters.getBaseBranchName(), parameters.getBaseBuildName()); this.comparisonSteps = loadSteps(parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName()); final List<StepLink> baseStepLinks = stepAndPagesAggregator.calculateStepLinks(baseSteps, baseUseCaseName, baseScenarioName); final List<StepLink> comparisonStepLinks = stepAndPagesAggregator.calculateStepLinks(comparisonSteps, baseUseCaseName, baseScenarioName); final ScenarioDiffInfo scenarioDiffInfo = new ScenarioDiffInfo(baseScenarioName); calculateDiffInfo(baseStepLinks, comparisonStepLinks, scenarioDiffInfo); LOGGER.info(getLogMessage(scenarioDiffInfo, "Scenario " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName + "/" + baseScenarioName)); return scenarioDiffInfo; } StepComparator(ComparisonParameters parameters, ScreenshotComparator screenshotComparator); ScenarioDiffInfo compare(final String baseUseCaseName, final String baseScenarioName);  }