【入門】Geb+SpockではじめるWebテスト~Maven編~ / How to run test by Maven command using Geb+Spock?
【入門】Geb+SpockではじめるWebテスト~Maven編~ / How to run test by Maven command using Geb+Spock?
著者:ふじさわゆうき
この記事は、以下の記事の続きです。
初めて訪問した方は以下の記事を参照してください。
目次 / Table of Contents
- 前回までのあらすじ / Overview of up to the previous article
- 今回の目的 / The goal of this article
- Mavenのメリット / Maven benefits
- Mavenインストール / Maven installation
- Mavenコマンドによるテスト実行 / The test run by Maven command
- まとめ / Summary
1. 前回までのあらすじ
- Gebとは何かの説明 / The description of what is Geb
- Gebのメリット説明 / Description of Geb benefits
- 「Eclipse + maven + Geb + Spock」での開発環境構築説明 / Development environment construction described with using "Geb + Spock"
- サンプルプログラム実装 / Sample program implementation
- google検索⇒検索結果⇒WIKIという流れのWebテスト実施 / Web test explanation that "google search ⇒ results ⇒WIKI"
- 「Geb + Spock」による上記Webテストの実施 / Implementation of the above Web test using the "Geb + Spock"
- クロスブラウザの説明 / Description of cross-browser
- スクリーンショット出力方法の説明 / Description of the screen shot output method
2. 今回の目的 / The goal of this article
- Mavenで「Geb + Spock」のWebテストを実行できるようにすること / To run web test of "Geb + Spock" Using Maven
- Jenkinsとの連携に必須 / Required in collaboration with Jenkins
3. Mavenのメリット/ Maven benefits
以下のサイト等参照してください / Please refer to the following site, etc.
4. Mavenインストール / Maven installation
- Mavenをダウンロードする / Download Maven
- Maven – Download Apache Maven
- "apache-maven-3.3.3-bin.zip"をダウンロード / Download "apache-maven-3.3.3-bin.zip"
- "C:\apache-maven-3.3.3"に解凍する / Unzip "apache-maven-3.3.3-bin.zip" and move to "apache-maven-3.3.3"
- 環境変数の設定 / Setting Environment Variables
- システムのプロパティ > 詳細設定 > 環境変数 > Path > 編集
- "C:\apache-maven-3.3.3\bin"を追記する / Append "C:\apache-maven-3.3.3\bin"
- システムのプロパティ > 詳細設定 > 環境変数 > Path > 編集
- mvnコマンド実行 / mvn command execution
- コマンドプロンプトを起動する / Start windows command prompt
- "mvn -v"と実行する / Run "mvn -v"
- Mavenのバージョン等が表示されたらインストール完了 / Installation is complete if Maven version confirmation
5. MavenコマンドによるWebテスト実行 / The test run by Maven command
- コマンドプロンプトを起動する / Start windows command prompt
- GoogleWikipediaTestに移動する / Moved to GoogleWikipediaTest
- cd [Eclipse Workspace Path]\GoogleWikipediaTest
- (例) cd c:\gebworkspace\GoogleWikipediaTest
- cd [Eclipse Workspace Path]\GoogleWikipediaTest
- mavenコマンドの実行 / Execution of Maven command
- mvn test
- テストが起動したらOK / It is OK, if the test starts
8. まとめ / Summary
- Mavenをダウンロードする / Download Maven
- GoogleWikipediaTestのディレクトリで"mvn test"コマンドを実行する / Run "mvn test" command in the GoogleWikipediaTest of directory
- テストが実行される / / It is OK, if the test starts