Skip to content

Instantly share code, notes, and snippets.

Avatar

Vanilton Pinheiro Vanilton18

View GitHub Profile
View TestSendFileToDeviceAppium.java
import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.Test;
import org.openqa.selenium.remote.DesiredCapabilities;
@Vanilton18
Vanilton18 / pomSikuliMaven.xml
Last active Feb 24, 2016
pomSikuliMaven.xml
View pomSikuliMaven.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.caboquinhotest</groupId>
<artifactId>teste-sikuli-maven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Teste Sikuli Maven</name>
<description>Um projeto de teste utilizando artefato maven sikuli</description>
<properties>
<junit.version>4.12</junit.version>
View jsonExampleJsonPathExtractor.json
[
{
"id": 1,
"titulo": "Os vingadores",
"ano": 2015,
"genero": "Ação",
"diretor": {
"id": 1,
"nome": "Steven",
"sobrenome": "Spilberg"
View HelloWorldSikuliXIDE.java
package net.vanilton.test;
import java.io.IOException;
import javax.swing.JOptionPane;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Screen;
public class HelloWorldSikuliXIDE {
static Screen screen = new Screen();
View Interacoes.java
package net.vanilton.test;
import java.io.IOException;
import org.sikuli.basics.Settings;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Screen;
public class Interacoes {
static Screen screen = new Screen();
View InteracoesInputPaste.java
package net.vanilton.test;
import java.io.IOException;
import org.sikuli.basics.Settings;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Screen;
public class InteracoesInputPaste {
static Screen screen = new Screen();
View PadronizandoMetodosPageObject.java
private String pathPictures = "src//test//resources//pictures//";
public void clicarNoMenu(String nomeMenu) throws FindFailed {
screen.wait(pathPictures + "menu//" + nomeMenu + ".png");
screen.click(pathPictures + "menu//" + nomeMenu + ".png");
}
public void clicarNoSubMenu(String nomeSubMenu) throws FindFailed {
screen.wait(pathPictures + "submenu//" + nomeSubMenu + ".png");
screen.click(pathPictures + "submenu//" + nomeSubMenu + ".png");
View AppExampleTestPage.java
package net.vanilton.PageObjectsTest;
import java.io.IOException;
import org.junit.BeforeClass;
import org.junit.Test;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Screen;
import net.vanilton.PageObjects.PaginaInputPaste;
View SimilaridadesUsadas.java
Pattern green = new Pattern("pictures\\green_on.png");
green.similar((float) 0.9);
Pattern red = new Pattern("pictures\\red_on.png");
red.similar((float) 0.9);
Pattern yellow = new Pattern("pictures\\yellow_on.png");
yellow.similar((float) 0.9);
Pattern blue = new Pattern("pictures\\blue_on.png");
blue.similar((float) 0.9);
View CapturaScreenshotRobot.java
Robot robot = new Robot();
BufferedImage theImage = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
ImageIO.write(theImage, "png", new File("C:\\myPic"+Integer.toString(turn)+".png"));
You can’t perform that action at this time.