Skip to content

Instantly share code, notes, and snippets.

Avatar

Vanilton Pinheiro Vanilton18

View GitHub Profile
View pomModuleClient.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>
<parent>
<groupId>net.vanilton</groupId>
<artifactId>project-test-multimodule-maven</artifactId>
<version>1.0</version>
</parent>
<artifactId>module-client-one</artifactId>
<dependencies>
View pomProjectTestMultimodule.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>net.vanilton</groupId>
<artifactId>project-test-multimodule-maven</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<properties>
<testng.version>6.9.10</testng.version>
<selenium.version>2.52.0</selenium.version>
View CliqueBotaoApagado.java
for (int i=0;i<turn;i++){
if (sequence.get(i) == "1"){
tela.click("pictures\\red_off");
}
View LocalizarImagemContidaOutraImagem.java
Finder f = new Finder("c:\\myPic"+Integer.toString(turn)+".png");
f.find(red);
if (f.hasNext()){
System.out.println("Encontrei o vermelho");
color = "1";
sequence.add(color);
}
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"));
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 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 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 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 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();
You can’t perform that action at this time.