Skip to content

Instantly share code, notes, and snippets.

@yusuiked
Created December 27, 2011 18:15
Show Gist options
  • Save yusuiked/1524668 to your computer and use it in GitHub Desktop.
Save yusuiked/1524668 to your computer and use it in GitHub Desktop.
package test;
import module.NewUIModule;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.telluriumsource.test.java.TelluriumJUnitTestCase;
import org.telluriumsource.test.java.TelluriumJavaTestCase;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
public class NewTestCase extends TelluriumJavaTestCase {
private static NewUIModule num;
@BeforeClass
public static void initUi() {
num = new NewUIModule();
// UI moduleを作成
num.defineUi();
// SeleniumServerの起動
connectSeleniumServer();
// Telluriumのengineを使う
useTelluriumEngine(true);
useTrace(true);
}
@Before
public void setUpForTest() {
// テスト画面にアクセス
connectUrl("http://code.google.com/p/aost/downloads/list");
}
// テストメソッド本体
@Test
public void testTelluriumProjectPage(){
// セレクトボックスの要素の内容確認
String[] allTypes = num.getAllDownloadTypes();
assertNotNull(allTypes);
// 選択した要素かどうか
assertTrue(allTypes[1].contains("All downloads"));
num.selectDownloadType(allTypes[1]);
// テキストボックスに入力
num.searchDownload("TrUMP");
}
@AfterClass
public static void tearDown(){
showTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment