This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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>UnitTest2</groupId> | |
<artifactId>UnitTest2</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<build> | |
<sourceDirectory>src</sourceDirectory> | |
<testSourceDirectory>test</testSourceDirectory> | |
<plugins> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.qualister.triangulo; | |
import static org.junit.Assert.*; | |
import org.junit.Test; | |
public class TrianguloBasicoUnitTest { | |
@Test | |
public void testeTrianguloEquilatero() throws TrianguloNaoPreenchidoException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.qualister.triangulo; | |
import org.junit.Rule; | |
import org.junit.Test; | |
import org.junit.rules.ExpectedException; | |
public class TrianguloExceptionUnitTest { | |
public @Rule ExpectedException expected = ExpectedException.none(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.qualister.triangulo; | |
import static org.junit.Assert.*; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.junit.runners.Parameterized; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.qualister.triangulo; | |
public class Triangulo implements ITriangulo { | |
public static String calcular(Integer lado1, Integer lado2, Integer lado3) throws TrianguloNaoPreenchidoException { | |
String retorno = null; | |
if (lado1 == null || lado2 == null || lado3 == null) { | |
throw new TrianguloNaoPreenchidoException(); | |
} else if (lado1 <= 0 || lado2 <= 0 || lado3 <= 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testeHardCoded() { | |
WebDriver driver = new FirefoxDriver(); | |
driver.get("http://eliasnogueira.com/arquivos_blog/post_parametros/"); | |
driver.findElement(By.id("nome")).sendKeys("Elias"); | |
driver.findElement(By.id("cidade")).sendKeys("Porto Alegre"); | |
new Select(driver.findElement(By.name("faixa"))).selectByVisibleText("Entre 26 e 60 anos"); | |
driver.findElement(By.cssSelector(".btn.btn-primary.nextBtn.btn-lg.pull-right")).click(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String lerPropriedade(String nomePropriedade) { | |
String valorPropriedade = null; | |
try { | |
Properties properties = new Properties(); | |
properties.load(new FileInputStream("src/test/resources/config.properties")); | |
valorPropriedade = properties.getProperty(nomePropriedade); | |
} catch (Exception e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testeProprerties() { | |
WebDriver driver = new FirefoxDriver(); | |
driver.get(Utils.lerPropriedade("url.inicial")); | |
driver.findElement(By.id("nome")).sendKeys("Elias"); | |
driver.findElement(By.id("cidade")).sendKeys("Porto Alegre"); | |
new Select(driver.findElement(By.name("faixa"))).selectByVisibleText("Entre 26 e 60 anos"); | |
driver.findElement(By.cssSelector(".btn.btn-primary.nextBtn.btn-lg.pull-right")).click(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LinksAutomacao { | |
// Atributo que guarda a url que sera acessada | |
private final static String URL = "http://www.qualister.com.br/cursos"; | |
@Test | |
public void test() { | |
WebDriver driver = new FirefoxDriver(); | |
driver.get(URL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LanguageTesting { | |
@Rule | |
public TestName name = new TestName(); | |
private AndroidDriver<MobileElement> driver; | |
private DesiredCapabilities dc; | |
File app = new File("apps/Internacionalization.apk"); | |
@After |