Examples of ScreenShot


Examples of net.thucydides.core.model.Screenshot

    public Screenshot expandToHeight(final int targetHeight) throws IOException {
        File screenshotFile = new File(sourceDirectory, screenshot.getFilename());
        if (screenshotFile.exists()) {
            File resizedFile = resizedImage(screenshotFile, targetHeight);
            return new Screenshot(resizedFile.getName(),
                                  screenshot.getDescription(),
                                  screenshot.getWidth(),
                                  screenshot.getError());
        } else {
            return screenshot;
View Full Code Here

Examples of org.arquillian.extension.recorder.screenshooter.Screenshot

            FileUtils.copyFile(((TakesScreenshot) browser).getScreenshotAs(OutputType.FILE), screenshotToTake);
        } catch (Exception e) {
            throw new RuntimeException("Error during saving the screenshot!", e);
        }

        Screenshot screenshoot = new BrowserScreenshot();
        screenshoot.setResource(screenshotToTake);
        screenshoot.setResourceType(screenshotType);

        try {
            BufferedImage bimg = ImageIO.read(screenshotToTake);
            screenshoot.setWidth(bimg.getWidth());
            screenshoot.setHeight(bimg.getHeight());
        } catch (IOException e) {
            throw new RuntimeException("Unable to get width and height of taken image located at "
                + screenshoot.getResource().getAbsolutePath());
        }

        takenResourceRegister.addTaken(screenshoot);

        return screenshoot;
View Full Code Here

Examples of org.arquillian.extension.recorder.screenshooter.Screenshot

            File screenshotTarget = new File(
                    new File(takeScreenshotEvent.getMetaData().getTestClassName(), takeScreenshotEvent.getMetaData().getTestMethodName()),
                    takeScreenshotEvent.getFileName());

            Screenshot screenshot = screenshooter.get().takeScreenshot(screenshotTarget, screenshotType);
            takenScreenshotsRegister.get().addTaken(screenshot);

            takeScreenshotEvent.getMetaData().setHeight(screenshot.getHeight());
            takeScreenshotEvent.getMetaData().setWidth(screenshot.getWidth());
            screenshot.setResourceMetaData(takeScreenshotEvent.getMetaData());

            ScreenshotEntry propertyEntry = new ScreenshotEntry();
            propertyEntry.setPath(screenshot.getResource().getAbsolutePath());
            propertyEntry.setPhase(takeScreenshotEvent.getWhen());
            propertyEntry.setType(screenshot.getResourceType().toString());
            propertyEntry.setSize(Long.toString(screenshot.getResource().length()));
            propertyEntry.setWidth(screenshot.getWidth());
            propertyEntry.setHeight(screenshot.getHeight());

            takenScreenshotsRegister.get().addReported(screenshot);
            propertyReportEvent.fire(new PropertyReportEvent(propertyEntry));
    }
View Full Code Here

Examples of org.arquillian.extension.recorder.screenshooter.Screenshot

        File screenshotTarget = new File(
            new File(event.getMetaData().getTestClassName(), event.getMetaData().getTestMethodName()),
            event.getFileName());

        Screenshot screenshot = screenshooter.get().takeScreenshot(screenshotTarget, type);
        takenScreenshotsRegister.get().addTaken(screenshot);

        event.getMetaData().setHeight(screenshot.getHeight());
        event.getMetaData().setWidth(screenshot.getWidth());
        screenshot.setResourceMetaData(event.getMetaData());

        ScreenshotEntry propertyEntry = new ScreenshotEntry();
        propertyEntry.setPath(screenshot.getResource().getAbsolutePath());
        propertyEntry.setPhase(event.getWhen());
        propertyEntry.setType(screenshot.getResourceType().toString());
        propertyEntry.setSize(Long.toString(screenshot.getResource().length()));
        propertyEntry.setWidth(screenshot.getWidth());
        propertyEntry.setHeight(screenshot.getHeight());

        takenScreenshotsRegister.get().addReported(screenshot);
        propertyReportEvent.fire(new PropertyReportEvent(propertyEntry));
    }
View Full Code Here

Examples of org.arquillian.extension.recorder.screenshooter.api.Screenshot

    }

    @Override
    public boolean isTakingAction(Event event, TestResult result) {
        if (event instanceof After) {
            Screenshot screenshotAnnotation = ScreenshotAnnotationScanner.getScreenshotAnnotation(((After) event).getTestMethod());

            if (screenshotAnnotation != null) {
                if (screenshotAnnotation.takeAfterTest()) {
                    return true;
                }
                if (result.getStatus() == Status.FAILED && screenshotAnnotation.takeWhenTestFailed()) {
                    return true;
                }
            }
        }
View Full Code Here

Examples of org.arquillian.extension.recorder.screenshooter.api.Screenshot

    @Override
    public boolean isTakingAction(Event event) {

        if (event instanceof Before) {
            Screenshot screenshotAnnotation = ScreenshotAnnotationScanner.getScreenshotAnnotation(((Before) event).getTestMethod());

            if (screenshotAnnotation != null) {
                return screenshotAnnotation.takeBeforeTest();
            }
        }

        return false;
    }
View Full Code Here

Examples of ru.org.linux.gallery.Screenshot

      if (message.length() > MAX_MESSAGE_LENGTH) {
        errors.rejectValue("msg", null, "Слишком большое сообщение");
      }
    }

    Screenshot scrn = null;

    if (section!=null && groupPermissionService.isImagePostingAllowed(section, tmpl.getCurrentUser())) {
      scrn = processUpload(session, image, errors);

      if (section.isImagepost() && scrn == null && !errors.hasErrors()) {
        errors.reject(null, "Изображение отсутствует");
      }
    }

    Poll poll = null;
   
    if (section!=null && section.isPollPostAllowed()) {
      poll = preparePollPreview(form);
    }

    Topic previewMsg = null;

    if (group!=null) {
      previewMsg = new Topic(form, user, request.getRemoteAddr());

      Image imageObject = null;

      if (scrn!=null) {
        imageObject = new Image(
                0,
                0,
                "gallery/preview/" + scrn.getMainFile().getName(),
                "gallery/preview/" + scrn.getIconFile().getName()
        );
      }

      List<String> tagNames = TagName.parseAndSanitizeTags(form.getTags());
View Full Code Here

Examples of ru.org.linux.gallery.Screenshot

  ) throws IOException {
    if (session==null) {
      return null;
    }

    Screenshot screenShot = null;

    if (image != null && !image.isEmpty()) {
      File uploadedFile = new File(image);

      try {
        screenShot = Screenshot.createScreenshot(
                uploadedFile,
                errors,
                siteConfig.getHTMLPathPrefix() + "/gallery/preview"
        );

        if (screenShot != null) {
          logger.info("SCREEN: " + uploadedFile.getAbsolutePath() + "\nINFO: SCREEN: " + image);

          session.setAttribute("image", screenShot);
        }
      } catch (BadImageException e) {
        errors.reject(null, "Некорректное изображение: " + e.getMessage());
      }
    } else if (session.getAttribute("image") != null && !"".equals(session.getAttribute("image"))) {
      screenShot = (Screenshot) session.getAttribute("image");

      if (!screenShot.getMainFile().exists()) {
        screenShot = null;
      }
    }

    return screenShot;
View Full Code Here

Examples of ru.org.linux.gallery.Screenshot

    if (section.isImagepost() && scrn == null) {
      throw new ScriptErrorException("scrn==null!?");
    }

    if (scrn!=null) {
      Screenshot screenShot = scrn.moveTo(siteConfig.getHTMLPathPrefix() + "/gallery", Integer.toString(msgid));

      imageDao.saveImage(
              msgid,
              "gallery/" + screenShot.getMainFile().getName(),
              "gallery/" + screenShot.getIconFile().getName()
      );
    }

    if (section.isPollPostAllowed()) {
      pollDao.createPoll(Arrays.asList(form.getPoll()), form.isMultiSelect(), msgid);
View Full Code Here

Examples of zephyropen.util.google.ScreenShot

          ftpManager.upload(components[i]);

    if (constants.getBoolean(ZephyrOpen.recording))
      if (counter % MOD == 0)
        for (int i = 0; i < tabbedPane.getTabCount() - 1; i++)
          new ScreenShot(components[i]);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.