cucumber.api.java.After Java Examples

The following examples show how to use cucumber.api.java.After. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PackStepdefs.java    From servicecomb-pack with Apache License 2.0 6 votes vote down vote up
@After
public void cleanUp() {
  LOG.info("Cleaning up services");
  for (String address : addresses) {
    given()
        .when()
        .delete(System.getProperty(address) + "/bookings")
        .then()
        .statusCode(is(200));
  }

  given()
      .when()
      .delete(System.getProperty(ALPHA_REST_ADDRESS) + "/saga/events")
      .then()
      .statusCode(is(200));

  for (Submit bm : submits.values()) {
    try {
      bm.deleteAllRules();
    } catch (Exception e) {
      LOG.warn("Fail to delete the byteman rules " + e);
    }
  }
}
 
Example #2
Source File: PackStepdefs.java    From servicecomb-pack with Apache License 2.0 6 votes vote down vote up
@After
public void cleanUp() {
  LOG.info("Cleaning up services");
  for (String address : addresses) {
    given()
        .when()
        .delete(System.getProperty(address) + "/bookings")
        .then()
        .statusCode(is(200));
  }

  given()
      .when()
      .delete(System.getProperty(ALPHA_REST_ADDRESS) + "/saga/events")
      .then()
      .statusCode(is(200));

  for (Submit bm : submits.values()) {
    try {
      bm.deleteAllRules();
    } catch (Exception e) {
      LOG.warn("Fail to delete the byteman rules " + e);
    }
  }
}
 
Example #3
Source File: PackStepdefs.java    From servicecomb-pack with Apache License 2.0 6 votes vote down vote up
@After
public void cleanUp() {
  LOG.info("Cleaning up services");
  for (String address : addresses) {
    given()
        .when()
        .delete(System.getProperty(address) + "/bookings")
        .then()
        .statusCode(is(200));
  }

  given()
      .when()
      .delete(System.getProperty(ALPHA_REST_ADDRESS) + "/test/saga/akka/events")
      .then()
      .statusCode(is(200));

  for (Submit bm : submits.values()) {
    try {
      bm.deleteAllRules();
    } catch (Exception e) {
      LOG.warn("Fail to delete the byteman rules " + e);
    }
  }
}
 
Example #4
Source File: PackStepdefs.java    From servicecomb-pack with Apache License 2.0 6 votes vote down vote up
@After
public void cleanUp() {
  LOG.info("Cleaning up services");
  for (String address : addresses) {
    given()
        .when()
        .delete(System.getProperty(address) + "/bookings")
        .then()
        .statusCode(is(200));
  }

  given()
      .when()
      .delete(System.getProperty(ALPHA_REST_ADDRESS) + "/saga/events")
      .then()
      .statusCode(is(200));

  for (Submit bm : submits.values()) {
    try {
      bm.deleteAllRules();
    } catch (Exception e) {
      LOG.warn("Fail to delete the byteman rules " + e);
    }
  }
}
 
Example #5
Source File: FirstRunWizardTestSteps.java    From espresso-cucumber with Apache License 2.0 6 votes vote down vote up
@After
public void after() {
    takeScreenshotOnFail();
    if (mActivity != null) { // Close activity after each test scenario
        if (!mActivity.isFinishing()) {
            mActivity.finish();
        }
        try {
            if (mDoneSignal != null) {
                if (!mDoneSignal.await(10, TimeUnit.SECONDS)) {
                    if (Log.D) Log.d(TAG, "FirstRunWizard activity didn't finish properly in the given time");
                }
            }
        } catch (final InterruptedException ex) {
            if (Log.D) Log.d(TAG, "FirstRunWizard activity didn't finish properly in the given time");
        }
    }
    mDoneSignal = null;
}
 
Example #6
Source File: PackStepdefs.java    From servicecomb-pack with Apache License 2.0 6 votes vote down vote up
@After
public void cleanUp() {
  LOG.info("Cleaning up services");
  for (String address : addresses) {
    given()
        .when()
        .delete(System.getProperty(address) + "/bookings")
        .then()
        .statusCode(is(200));
  }

  given()
      .when()
      .delete(System.getProperty(ALPHA_REST_ADDRESS) + "/saga/events")
      .then()
      .statusCode(is(200));

  for (Submit bm : submits.values()) {
    try {
      bm.deleteAllRules();
    } catch (Exception e) {
      LOG.warn("Fail to delete the byteman rules " + e);
    }
  }
}
 
Example #7
Source File: PackStepdefs.java    From servicecomb-pack with Apache License 2.0 6 votes vote down vote up
@After
public void cleanUp() {
  LOG.info("Cleaning up services");
  for (String address : addresses) {
    given()
        .when()
        .delete(System.getProperty(address) + "/bookings")
        .then()
        .statusCode(is(200));
  }

  given()
      .when()
      .delete(alphaClusterAddress.getMasterAddress() + "/saga/events")
      .then()
      .statusCode(is(200));

  for (Submit bm : submits.values()) {
    try {
      bm.deleteAllRules();
    } catch (Exception e) {
      LOG.warn("Fail to delete the byteman rules " + e);
    }
  }
}
 
Example #8
Source File: StartingSteps.java    From Mobile-Test-Automation-with-Appium with MIT License 5 votes vote down vote up
@After
public void tearDown(Scenario scenario) {
    try {
        if (scenario.isFailed()) {
            final byte[] screenshot = appiumDriver
                    .getScreenshotAs(OutputType.BYTES);
            scenario.embed(screenshot, "image/png");
        }
        appiumDriver.quit();
        appiumService.stop();
    } catch (Exception e) {
        System.out.println("Exception while running Tear down :" + e.getMessage());
    }
}
 
Example #9
Source File: RabbitMQAwsS3Stepdefs.java    From james-project with Apache License 2.0 5 votes vote down vote up
@After
public void tearDown() {
    ignoreFailures(imapStepdefs::closeConnections,
            mainStepdefs::tearDown,
            () -> elasticSearch.getDockerEs().cleanUpData(),
            () -> temporaryFolder.delete());
}
 
Example #10
Source File: CassandraStepdefs.java    From james-project with Apache License 2.0 5 votes vote down vote up
@After
public void tearDown() {
    ignoreFailures(imapStepdefs::closeConnections,
            mainStepdefs::tearDown,
            () -> elasticSearch.getDockerEs().cleanUpData(),
            () -> temporaryFolder.delete());
}
 
Example #11
Source File: StepDefinitions.java    From CleanGUITestArchitecture with MIT License 5 votes vote down vote up
/**
 * All the clean up of application's data and state after each scenario must happen here
 * The last call of this method should always be the call to parent's tear down method
 */
@After
public void tearDown() throws Exception {
    LoginActivity.setIdlingNotificationListener(null);
    Espresso.unregisterIdlingResources(mCountingIdlingResourceListener.getCountingIdlingResource());
    ActivityFinisher.finishOpenActivities(); // Required for testing App with multiple activities
    letScreenOfTestDeviceTurnOff();
}
 
Example #12
Source File: HookSpec.java    From Decision with Apache License 2.0 5 votes vote down vote up
@After(order = 20, value = "@shell")
public void shellTeardown() throws IOException {
    commonspec.getLogger().info("Closing Stratio Decision shell prompt");
    if (commonspec.getShellIface() != null) {
        commonspec.getShellIface().sendLine("exit");
        commonspec.getShellIface().expect(eof());
        commonspec.getShellIface().close();
    }
}
 
Example #13
Source File: SampleListStepDefinitions.java    From material-activity-chooser with Apache License 2.0 5 votes vote down vote up
@After
public void after() {
    Espresso.unregisterIdlingResources(mBottomSheetIdlingResource);
    try {
        InstrumentationRegistry.getTargetContext().unregisterReceiver(mTestBroadcastReceiver);
    } catch (IllegalArgumentException ignored){}
}
 
Example #14
Source File: StepDefs.java    From galeb with Apache License 2.0 5 votes vote down vote up
@After
@Transactional
public void reset(){
    LOGGER.info("Resetting FLYWAY...");
    FLYWAY.clean();
    response = null;
    request = null;
}
 
Example #15
Source File: MdpHandlerHolder.java    From java-cme-mdp3-handler with GNU Lesser General Public License v3.0 5 votes vote down vote up
@After
public void release() {
    openHandlers.values().forEach(MdpChannel::close);
    openHandlers.clear();
    //System.runFinalization();
    System.gc();
}
 
Example #16
Source File: CommandLineSteps.java    From datamill with ISC License 5 votes vote down vote up
@After
public void cleanUp() throws IOException {
    File temporaryDirectory = (File) propertyStore.get(TEMPORARY_DIRECTORY);
    if (temporaryDirectory != null && temporaryDirectory.isDirectory()) {
        logger.debug("Cleaning up temporary directory {}", temporaryDirectory);
        delete(temporaryDirectory);
    }
}
 
Example #17
Source File: HookGSpec.java    From bdt with Apache License 2.0 5 votes vote down vote up
/**
 * Close selenium web driver.
 */
@After(order = ORDER_20, value = {"@mobile or @web"})
public void seleniumTeardown() {
    if (commonspec.getDriver() != null) {
        commonspec.getLogger().debug("Shutdown Selenium client");
        commonspec.getDriver().close();
        commonspec.getDriver().quit();
    }
}
 
Example #18
Source File: MdpSimulatorHooks.java    From java-cme-mdp3-handler with GNU Lesser General Public License v3.0 5 votes vote down vote up
@After("@mdpsim")
public void afterSimScenario(final Scenario scenario) {
    mdpFeedSimHelper.release();
    try {
        Thread.currentThread().sleep(TimeUnit.SECONDS.toMillis(1));
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
 
Example #19
Source File: HookGSpec.java    From bdt with Apache License 2.0 5 votes vote down vote up
@After
public void afterScenario(Scenario scenario) throws Throwable {
    if (scenario.getStatus() == Result.Type.UNDEFINED) {
        if (!commonspec.getExceptions().isEmpty()) {
            scenario.write(commonspec.getExceptions().get(commonspec.getExceptions().size() - 1).toString());
        }
    }
}
 
Example #20
Source File: ConsumerSteps.java    From redisq with MIT License 5 votes vote down vote up
@After
public void afterScenario() throws Throwable {
    if (consumersById.isEmpty()) {
        return;
    }

    for (List<MessageConsumer> consumers : consumersById.values()) {
        for (MessageConsumer consumer : consumers) {
            consumer.stopConsumer();
        }
    }

    consumersById.clear();
}
 
Example #21
Source File: CukesHttpHooks.java    From cukes with Apache License 2.0 4 votes vote down vote up
@After
public void afterScenario() {
    requestFacade.initNewSpecification();
}
 
Example #22
Source File: CassandraStepdefs.java    From james-project with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
    cassandra.close();
}
 
Example #23
Source File: ServerStatusSteps.java    From oxTrust with MIT License 4 votes vote down vote up
@After
public void clear(Scenario scenario) {
	homePage.takeScreenShot(scenario);
	stopRecorder();
	homePage.clear();
}
 
Example #24
Source File: JPAStepdefs.java    From james-project with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
    JPA_TEST_CLUSTER.clear(JPARecipientRewrite.JAMES_RECIPIENT_REWRITE);
}
 
Example #25
Source File: DeleteMetaDataAfter.java    From osiris with Apache License 2.0 4 votes vote down vote up
@After(value = "@deleteMetadata")		
public void deleteDataBaseMetaData(){
	mongoTemplate.dropCollection(collectionMetaData);
}
 
Example #26
Source File: CukesRabbitMQHooks.java    From cukes with Apache License 2.0 4 votes vote down vote up
@After
public void afterScenario() {
    connectionService.initConfiguration();
}
 
Example #27
Source File: CukesCoreHooks.java    From cukes with Apache License 2.0 4 votes vote down vote up
@After
public void afterScenario() {
    cucumberFacade.afterScenario();
}
 
Example #28
Source File: SignupActivitySteps.java    From CucumberEspressoDemo with MIT License 4 votes vote down vote up
@After("@signup-feature")
public void tearDown() {
    activityTestRule.finishActivity();
}
 
Example #29
Source File: DeleteFeatureAfter.java    From osiris with Apache License 2.0 4 votes vote down vote up
@After(value = "@deleteFeatures")		
public void deleteDataBaseFeature() throws FeatureNotExistException{
					
		for(int i=0; i<idsDelete.size();i++){	
			String idObject = idsDelete.get(i);
			String idApp = idsApp.get(i);
							
			featureManager.deleteFeature(idApp, idObject);
			
			//Assert.assertEquals("The response must be a  NO_CONTENT", Status.valueOf("NO_CONTENT").getStatusCode(),response.getStatus().getStatusCode());
									
		}
		
		idsDelete.clear();
		idsApp.clear();
						
}
 
Example #30
Source File: OpenIdConnectSteps.java    From oxTrust with MIT License 4 votes vote down vote up
@After
public void clear(Scenario scenario) {
	homePage.takeScreenShot(scenario);
	stopRecorder();
	homePage.clear();
}