All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.ddemin.envrouter.cucumber2.testng.AbstractCucumberFeatureTest Maven / Gradle / Ivy

Go to download

This library helps to route yours parallel tests to different environments and allows to use personal environment settings for each parallel test (java thread)

The newest version!
package com.github.ddemin.envrouter.cucumber2.testng;

import com.github.ddemin.envrouter.base.EnvironmentLock;
import com.github.ddemin.envrouter.cucumber2.FeatureWrapper;
import com.github.ddemin.envrouter.cucumber2.FeaturesUtils;
import cucumber.api.testng.CucumberFeatureWrapper;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public abstract class AbstractCucumberFeatureTest extends AbstractCucumberTest {

  protected abstract void processFailedLocking(EnvironmentLock lock);

  @Override
  List wrapEntities() {
    return FeaturesUtils.wrapFeatures(
        Arrays.stream(tlCukeRunner.get().provideFeatures())
            .flatMap(
                objs -> Arrays.stream(objs)
                    .map(obj -> ((CucumberFeatureWrapper) obj).getCucumberFeature())
            )
            .distinct()
            .collect(Collectors.toList())
    );
  }

  @Override
  void runCucumberEntity(FeatureWrapper cucumberEntityWrapper) {
    tlCukeRunner.get().runCucumber(cucumberEntityWrapper.getEntity());
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy