Search in sources :

Example 1 with Before

use of cucumber.api.java.Before in project cucumber-jvm by cucumber.

the class CucumberActivitySteps method before.

@Before
public void before() {
    assertEquals(0, steps);
    Instrumentation instrumentation = getInstrumentation();
    assertNotNull(instrumentation);
    assertNotNull(getActivity());
    String testPackageName = instrumentation.getContext().getPackageName();
    String targetPackageName = instrumentation.getContext().getPackageName();
    assertEquals(testPackageName, targetPackageName);
}
Also used : Instrumentation(android.app.Instrumentation) Before(cucumber.api.java.Before)

Example 2 with Before

use of cucumber.api.java.Before in project cucumber-jvm by cucumber.

the class JavaHookTest method matches_matching_tags.

@Test
public void matches_matching_tags() {
    objectFactory.setInstance(new HasHooks());
    backend.buildWorld();
    backend.addHook(BEFORE.getAnnotation(Before.class), BEFORE);
    HookDefinition before = glue.getBeforeHooks().get(0);
    assertTrue(before.matches(asList(new Tag("@bar", 0), new Tag("@zap", 0))));
}
Also used : Before(cucumber.api.java.Before) Tag(gherkin.formatter.model.Tag) HookDefinition(cucumber.runtime.HookDefinition) Test(org.junit.Test)

Example 3 with Before

use of cucumber.api.java.Before in project activityinfo by bedatadriven.

the class JsonApiSteps method setUpClient.

@Before
public void setUpClient(Scenario scenario) {
    this.scenario = scenario;
    this.objectMapper = new ObjectMapper();
    this.jsonParser = new PsuedoJsonParser(objectMapper);
    this.currentAccount = accounts.any();
}
Also used : ObjectMapper(org.codehaus.jackson.map.ObjectMapper) Before(cucumber.api.java.Before)

Example 4 with Before

use of cucumber.api.java.Before in project selenium_java by sergueik.

the class AngularCalculator_Steps method setup.

@Before("@Angular")
public void setup() {
    driver = new ProtractorDriver();
    AngularCalculatorPage.setDriver(driver);
}
Also used : ProtractorDriver(com.mycompany.app.ProtractorDriver) Before(cucumber.api.java.Before)

Example 5 with Before

use of cucumber.api.java.Before in project alien4cloud by alien4cloud.

the class EditorStepDefs method init.

@Before
public void init() throws IOException {
    thrownException = null;
    GetMultipleDataResult<Application> apps = alienDAO.search(Application.class, "", null, 100);
    for (Application application : apps.getData()) {
        applicationService.delete(application.getId());
    }
    FacetedSearchResult<Topology> searchResult = catalogService.search(Topology.class, "", 100, null);
    Topology[] topologies = searchResult.getData();
    for (Topology topology : topologies) {
        try {
            csarService.forceDeleteCsar(topology.getId());
        } catch (NotFoundException e) {
            // Some previous tests may create topology without creating any archive, if so catch the exception
            alienDAO.delete(Topology.class, topology.getId());
        }
    }
    topologyIds.clear();
    editionContextManager.clearCache();
}
Also used : NotFoundException(alien4cloud.exception.NotFoundException) Topology(org.alien4cloud.tosca.model.templates.Topology) Application(alien4cloud.model.application.Application) Before(cucumber.api.java.Before)

Aggregations

Before (cucumber.api.java.Before)13 HookDefinition (cucumber.runtime.HookDefinition)3 Test (org.junit.Test)3 Tag (gherkin.formatter.model.Tag)2 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)2 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)2 NotFoundException (alien4cloud.exception.NotFoundException)1 AuthenticationStepDefinitions (alien4cloud.it.security.AuthenticationStepDefinitions)1 Application (alien4cloud.model.application.Application)1 Instrumentation (android.app.Instrumentation)1 NgWebDriver (com.jprotractor.NgWebDriver)1 RedisCaches (com.microsoft.azure.management.redis.RedisCaches)1 ProtractorDriver (com.mycompany.app.ProtractorDriver)1 IOException (java.io.IOException)1 UncheckedIOException (java.io.UncheckedIOException)1 URL (java.net.URL)1 Topology (org.alien4cloud.tosca.model.templates.Topology)1 BasicNameValuePair (org.apache.http.message.BasicNameValuePair)1 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)1 MBeanContainer (org.eclipse.jetty.jmx.MBeanContainer)1