public void remove() { throw new EyesException("Remove is forbidden using the iterator!"); } };
"API key is missing! Please set it using setApiKey()"; logger.log(errMsg); throw new EyesException(errMsg); String errMsg = "A test is already running"; logger.log(errMsg); throw new EyesException(errMsg); logger.log(String.format("%s", e.getMessage())); logger.getLogHandler().close(); throw e;
/** * If a test is running, aborts it. Otherwise, does nothing. */ public void abortIfNotClosed() { try { if (isDisabled) { logger.verbose("Ignored"); return; } isOpen = false; lastScreenshot = null; clearUserInputs(); if (null == runningSession) { logger.verbose("Closed"); return; } logger.verbose("Aborting server session..."); try { // When aborting we do not save the test. serverConnector.stopSession(runningSession, true, false); logger.log("--- Test aborted."); } catch (EyesException ex) { logger.log( "Failed to abort server session: " + ex.getMessage()); } } finally { runningSession = null; logger.getLogHandler().close(); } }
"API key is missing! Please set it using setApiKey()"; logger.log(errMsg); throw new EyesException(errMsg); String errMsg = "A test is already running"; logger.log(errMsg); throw new EyesException(errMsg); logger.log(String.format("%s", e.getMessage())); logger.getLogHandler().close(); throw e;
/** * If a test is running, aborts it. Otherwise, does nothing. */ public void abortIfNotClosed() { try { if (isDisabled) { logger.verbose("Ignored"); return; } isOpen = false; lastScreenshot = null; clearUserInputs(); if (null == runningSession) { logger.verbose("Closed"); return; } logger.verbose("Aborting server session..."); try { // When aborting we do not save the test. serverConnector.stopSession(runningSession, true, false); logger.log("--- Test aborted."); } catch (EyesException ex) { logger.log( "Failed to abort server session: " + ex.getMessage()); } } finally { runningSession = null; logger.getLogHandler().close(); } }
/** * Sets the proxy settings to be used by the rest client. * @param proxySettings The proxy settings to be used by the rest client. * If {@code null} then no proxy is set. */ @SuppressWarnings("UnusedDeclaration") public void setProxyBase(ProxySettings proxySettings) { throw new EyesException( "Proxy not implemented in this version!"); // this.proxySettings = proxySettings; // // restClient = buildRestClient(timeout, proxySettings); // endPoint = restClient.resource(serverUrl); }
"API key is missing! Please set it using setApiKey()"; logger.log(errMsg); throw new EyesException(errMsg); String errMsg = "A test is already running"; logger.log(errMsg); throw new EyesException(errMsg); logger.log(String.format("%s", e.getMessage())); logger.getLogHandler().close(); throw e;
/** * If a test is running, aborts it. Otherwise, does nothing. */ public void abortIfNotClosed() { try { if (isDisabled) { logger.verbose("Ignored"); return; } isOpen = false; lastScreenshot = null; clearUserInputs(); if (null == runningSession) { logger.verbose("Closed"); return; } logger.verbose("Aborting server session..."); try { // When aborting we do not save the test. serverConnector.stopSession(runningSession, true, false); logger.log("--- Test aborted."); } catch (EyesException ex) { logger.log( "Failed to abort server session: " + ex.getMessage()); } } finally { runningSession = null; logger.getLogHandler().close(); } }
public static URI getDefaultServerUrl() { try { return new URI("https://eyesapi.applitools.com"); } catch (URISyntaxException ex) { throw new EyesException(ex.getMessage(), ex); } }
public static URI getDefaultServerUrl() { try { return new URI("https://eyessdk.applitools.com"); } catch (URISyntaxException ex) { throw new EyesException(ex.getMessage(), ex); } }
public static URI getDefaultServerUrl() { try { return new URI("https://eyesapi.applitools.com"); } catch (URISyntaxException ex) { throw new EyesException(ex.getMessage(), ex); } }
public static URI getDefaultServerUrl() { try { return new URI("https://eyesapi.applitools.com"); } catch (URISyntaxException ex) { throw new EyesException(ex.getMessage(), ex); } }
public static URI getDefaultServerUrl() { try { return new URI("https://eyesapi.applitools.com"); } catch (URISyntaxException ex) { throw new EyesException(ex.getMessage(), ex); } }
/** * @return The batch start date and time in ISO 8601 format. */ @SuppressWarnings("UnusedDeclaration") @JsonSerialize(using = Iso8610CalendarSerializer.class) public Calendar getStartedAt() { try { return GeneralUtils.fromISO8601DateTime(startedAt); } catch (ParseException ex) { throw new EyesException("Failed to parse batch start time", ex); } }
@SuppressWarnings("UnusedDeclaration") /** * Creates a {@code BufferedImage} from an image file specified by {@code * path}. * * @param path The path to the image file. * @return A {@code BufferedImage} instance. * @throws com.applitools.eyes.EyesException If there was a problem * creating the {@code BufferedImage} instance. */ public static BufferedImage imageFromFile(String path) throws EyesException { BufferedImage result; try { result = ImageIO.read(new File(path)); } catch (IOException e) { throw new EyesException("Failed to to load the image bytes from " + path, e); } return result; }
/** * @return The batch start date and time in ISO 8601 format. */ @SuppressWarnings("UnusedDeclaration") @JsonSerialize(using = Iso8610CalendarSerializer.class) public Calendar getStartedAt() { try { return GeneralUtils.fromISO8601DateTime(startedAt); } catch (ParseException ex) { throw new EyesException("Failed to parse batch start time", ex); } }
private static Location parseLocationString(Object position) { String[] xy = position.toString().split(";"); if (xy.length != 2) { throw new EyesException("Could not get scroll position!"); } float x = Float.parseFloat(xy[0]); float y = Float.parseFloat(xy[1]); return new Location((int)Math.ceil(x), (int)Math.ceil(y)); }
/** * @return The batch start date and time in ISO 8601 format. */ @SuppressWarnings("UnusedDeclaration") @JsonSerialize(using = Iso8610CalendarSerializer.class) public Calendar getStartedAt() { try { return GeneralUtils.fromISO8601DateTime(startedAt); } catch (ParseException ex) { throw new EyesException("Failed to parse batch start time", ex); } }
/** * Save image to local file system * @param image The image to save. * @param filename The path to save image */ public static void saveImage(BufferedImage image, String filename) { try { logger.verbose("Saving file: " + filename); File file = new File(filename); ImageIO.write(image, "png", file); } catch (IOException e) { throw new EyesException("Failed to save image", e); } }
/** * Creates a BufferedImage instance from raw image bytes. * * @param imageBytes The raw bytes of the image. * @return A BufferedImage instance representing the image. * @throws com.applitools.eyes.EyesException If there was a problem * creating the {@code BufferedImage} instance. */ public static BufferedImage imageFromBytes(byte[] imageBytes) throws EyesException { BufferedImage image; try { ByteArrayInputStream screenshotStream = new ByteArrayInputStream(imageBytes); image = ImageIO.read(screenshotStream); screenshotStream.close(); } catch (IOException e) { throw new EyesException("Failed to create buffered image!", e); } return image; }