Exemplo n.º 1
0
  @AfterSuite(alwaysRun = true)
  public void tearDown() throws Exception {
    if (testSuite != null) {
      LOGGER.info("========== TEAR-DOWN SAKULI TEST SUITE '{}' ==========", testSuite.getId());
      testSuite.setStopDate(DateTime.now().toDate());
      TeardownServiceHelper.invokeTeardownServices();
    }
    if (executorService != null) {
      executorService.shutdownNow();
    }

    if (StringUtils.isNotEmpty(browserProcessName) && !browserProcessName.equals("null")) {
      LOGGER.info("kill browser process '{}'", browserProcessName);
      ProcessHelper.killAll(browserProcessName);
    }
  }
Exemplo n.º 2
0
  @BeforeClass(alwaysRun = true)
  public void initTC() throws Exception {
    if (testSuite == null) {
      initTestSuiteParameter();
    }
    LOGGER.info("............................INITIALIZE TEST-CASE with {}", initParameter);
    String testCaseName = this.getClass().getSimpleName();
    initParameter = getTestCaseInitParameter();
    if (initParameter == null) {
      throw new SakuliException("init parameter have to be set!");
    }
    testSuite = BeanLoader.loadBean(TestSuite.class);

    // start sahi controlled browser if needed
    initSahiBrowser();

    testSuite.addTestCase(new TestCaseBuilder(testCaseName, initParameter.getTestCaseId()).build());
    testCaseAction = BeanLoader.loadTestCaseAction();

    // add the the testcase folder as image folder
    if (Files.exists(getTestCaseFolder())) {
      initParameter.addImagePath(getTestCaseFolder().toString());
    }
    initTestCaseAction(initParameter);
    LOGGER.info(
        "............................START TEST-CASE '{}' - {}",
        initParameter.getTestCaseId(),
        testCaseName);
    counter = 0;
    startTimeCase = DateTime.now();
  }