File tree Expand file tree Collapse file tree 10 files changed +40
-15
lines changed
Expand file tree Collapse file tree 10 files changed +40
-15
lines changed Original file line number Diff line number Diff line change 77import org .junit .Test ;
88import org .openqa .selenium .By ;
99import org .openqa .selenium .WebDriver ;
10+ import org .openqa .selenium .WebElement ;
1011import org .openqa .selenium .chrome .ChromeDriver ;
1112import org .openqa .selenium .support .ui .Select ;
1213
@@ -44,7 +45,8 @@ public void test() {
4445 String url = "file:///" + html .getAbsolutePath ();
4546 driver .get (url );
4647
47- Select headCount = new Select (driver .findElement (By .id ("head_count" )));
48- headCount .selectByValue ("5" );
48+ WebElement headCount = driver .findElement (By .id ("head_count" ));
49+ Select select = new Select (headCount );
50+ select .selectByValue ("5" );
4951 }
5052}
Original file line number Diff line number Diff line change @@ -73,15 +73,15 @@ public void test() {
7373 Thread .sleep (1000 ); // デモ用。目で見て分かりやすいように、各操作の間にSleepを入れる
7474 WebElement userName = driver .findElement (By .id ("user_name" ));
7575 userName .sendKeys ("テストユーザー" );
76- Thread .sleep (1000 );
76+ Thread .sleep (1000 ); // デモ用
7777 WebElement password = driver .findElement (By .id ("password" ));
7878 password .sendKeys ("pass" );
79- Thread .sleep (1000 );
79+ Thread .sleep (1000 ); // デモ用
8080 WebElement login = driver .findElement (By .id ("login" ));
8181 login .click ();
82- Thread .sleep (1000 );
82+ Thread .sleep (1000 ); // デモ用
8383 driver .switchTo ().alert ().accept ();
84- Thread .sleep (1000 );
84+ Thread .sleep (1000 ); // デモ用
8585 } catch (InterruptedException e ) {
8686 throw new RuntimeException (e );
8787 }
Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ public void test() {
4242 String url = "file:///" + html .getAbsolutePath ();
4343 driver .get (url );
4444
45- // TODO このSleep処理を削除して 、代わりにOKボタンをクリックする処理を記述してください
45+ // TODO 以下を削除して 、代わりにOKボタンをクリックする処理を記述してください
4646 try {
4747 Thread .sleep (8000 );
4848 } catch (InterruptedException e ) {
4949 throw new RuntimeException (e );
5050 }
51+ // TODO ここまで削除してください
5152 }
5253}
Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ public void test() {
4242 String url = "file:///" + html .getAbsolutePath ();
4343 driver .get (url );
4444
45- // TODO このSleep処理を削除して 、代わりに文字列を入力する処理を記述してください
45+ // TODO 以下を削除して 、代わりに文字列を入力する処理を記述してください
4646 try {
4747 Thread .sleep (8000 );
4848 } catch (InterruptedException e ) {
4949 throw new RuntimeException (e );
5050 }
51+ // TODO ここまで削除してください
5152 }
5253}
Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ public void test() {
4242 String url = "file:///" + html .getAbsolutePath ();
4343 driver .get (url );
4444
45- // TODO このSleep処理を削除して 、代わりにラジオボタンを選択する処理を記述してください
45+ // TODO 以下を削除して 、代わりにラジオボタンを選択する処理を記述してください
4646 try {
4747 Thread .sleep (8000 );
4848 } catch (InterruptedException e ) {
4949 throw new RuntimeException (e );
5050 }
51+ // TODO ここまで削除してください
5152 }
5253}
Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ public void test() {
4242 String url = "file:///" + html .getAbsolutePath ();
4343 driver .get (url );
4444
45- // TODO このSleep処理を削除して 、代わりにチェックボックスを選択する処理を記述ください
45+ // TODO 以下を削除して 、代わりにチェックボックスを選択する処理を記述ください
4646 try {
4747 Thread .sleep (8000 );
4848 } catch (InterruptedException e ) {
4949 throw new RuntimeException (e );
5050 }
51+ // TODO ここまで削除してください
5152 }
5253}
Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ public void test() {
4242 String url = "file:///" + html .getAbsolutePath ();
4343 driver .get (url );
4444
45- // TODO このSleep処理を削除して、代わりにプルダウンを選択する処理を記述してください
45+ // TODO 以下を削除して、代わりにチェックボックスを選択する処理を記述ください
4646 try {
4747 Thread .sleep (8000 );
4848 } catch (InterruptedException e ) {
4949 throw new RuntimeException (e );
5050 }
51+ // TODO ここまで削除してください
5152 }
5253}
Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ public void test() {
4242 String url = "file:///" + html .getAbsolutePath ();
4343 driver .get (url );
4444
45- // TODO このSleep処理を削除して 、代わりにプルダウンを選択する処理を記述してください
45+ // TODO 以下を削除して 、代わりにプルダウンを選択する処理を記述してください
4646 try {
4747 Thread .sleep (8000 );
4848 } catch (InterruptedException e ) {
4949 throw new RuntimeException (e );
5050 }
51+ // TODO ここまで削除してください
5152 }
5253}
Original file line number Diff line number Diff line change @@ -47,13 +47,14 @@ public void test() {
4747 String url = "file:///" + html .getAbsolutePath ();
4848 driver .get (url );
4949
50- // TODO このSleep処理は削除してください
50+ // TODO 以下は削除してください
5151 try {
5252 Thread .sleep (8000 );
5353 } catch (InterruptedException e ) {
5454 throw new RuntimeException (e );
5555 }
56-
56+ // TODO ここまで削除してください
57+
5758 // 1ページ目入力画面
5859 driver .findElement (By .id ("reserve_year" )).clear ();
5960 driver .findElement (By .id ("reserve_year" )).sendKeys ("2013" );
Original file line number Diff line number Diff line change @@ -39,6 +39,22 @@ public void tearDown() {
3939
4040 @ Test
4141 public void test () {
42- // TODO 1ページ目の初期値チェック処理を記述してください
42+ File html = new File ("reserveApp/index.html" );
43+ String url = "file:///" + html .getAbsolutePath ();
44+ driver .get (url );
45+
46+ /* TODO このコメントアウトを解除してください
47+ ReserveInputPage inputPage = new ReserveInputPage(driver);
48+ Calendar now = Calendar.getInstance();
49+ assertThat(inputPage.getReserveYear(),
50+ is(Integer.toString(now.get(Calendar.YEAR))));
51+ assertThat(inputPage.getReserveMonth(),
52+ is(Integer.toString(now.get(Calendar.MONTH) + 1)));
53+ assertThat(inputPage.getReserveDay(),
54+ is(Integer.toString(now.get(Calendar.DATE))));
55+ assertThat(inputPage.getReserveTerm(), is("1"));
56+ TODO ここまでを解除してください */
57+
58+ // TODO 残りの初期値チェック処理を記述してください
4359 }
4460}
You can’t perform that action at this time.
0 commit comments