My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 18 attachment: TesteTumbler.java (1.7 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package core;

import org.junit.*;
import org.junit.runner.*;

import static tumbler.Tumbler.*;

import junit.framework.TestCase;

import tumbler.JUnit44TumblerRunner;
import tumbler.Scenario;
import tumbler.Story;

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;

@RunWith(JUnit44TumblerRunner.class)
@Story("Busca Web Palavras Chave")
public class TesteTumbler extends TestCase {

static Selenium selenium;

public TesteTumbler(){
Narrative("Dado que estou utilizando Selenium para fazer a��es automaticas pela web" +
"quando forem realizadas consultas sobre determinado assunto" +
"a consulta deve exibir palavras chave relacionadas ao assunto pesquisado");
}

@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com.br/");
selenium.start();
selenium.setSpeed("3000");
}

@Scenario("Cenario: Busca na Web Relacionando Palavras Chave")
public void shouldBuscaWebRelacionandoPalavrasChave() {
Given("Estou realizando uma busca na web.");
/*Estado*/
// selenium.open("/");

When("Realizar uma consulta sobre determinado assunto.");
/*Condicao*/
// selenium.type("q", "wikipedia boxe");
// selenium.click("btnG");

Then("Devo obter uma palavra chave na tela sobre o assunto.");
/*Comportamento*/
// selenium.click("//ol[@id='rso']/li[1]/div/span/h3/a");
// selenium.waitForPageToLoad("30000");
// Assert.assertTrue(selenium.isTextPresent("boxe"));
}

@After
public void tearDown() throws Exception {
selenium.stop();
}
}
Powered by Google Project Hosting