Skip to Content
JavaによるSelenium WebDriverのハンズオン
book

JavaによるSelenium WebDriverのハンズオン

by Boni Garcia
March 2025
Intermediate to advanced
422 pages
6h 59m
Japanese
O'Reilly Media, Inc.
Content preview from JavaによるSelenium WebDriverのハンズオン

付録C. リポジトリの設定例

examplesリポジトリは、本書で取り上げたすべての例と、MavenとGradleの完全なコンフィギュレーションを含んでいるため、の重要な要素である。さらに、このリポジトリはGitHubが提供する以下のようなサービスを利用している:

GitHubページ

サービス GitHubリポジトリから直接設定した公開Webサイトをホスティングできる。私は、Selenium WebDriverのテスト例でSUTとして使われるWebページを紹介するために、examplesリポジトリにリンクされたシンプルなWebサイトを使っているhttps://bonigarcia.dev/selenium-webdriver-java。見ての通り、CSSフレームワークとしてBootstrapを使ったさまざまなHTMLページが含まれている。

GitHubアクション

GitHubリポジトリ用のCI/CDビルドサーバ。私はこのサービスを使って、新しいコミットごとにリポジトリ全体をビルドしてテストしている。ワークフローの設定についての詳細は、このセクションの最後で説明する。

ディペンダボット

というボットが、プロジェクトの依存関係を自動的に更新する。このボットは、MavenとGradleの依存関係(詳細は次のサブセクションを参照)の新しいバージョンを検出すると、対応する更新でプルリクエストを作成する。

この付録の残りの部分では、サンプルリポジトリの設定の詳細を発見する。この設定には、Maven と Gradle の依存関係の宣言などが含まれ、Selenium WebDriver を使う標準的なプロジェクトには十分である。さらに、この付録の最後の部分では、ロギングライブラリ、Dependabot、GitHub Actions(CIアプローチに従ってプロジェクトをビルドしてテストする)の設定方法を説明する。

プロジェクトのレイアウト

図C-1は、リポジトリのレイアウト例の概略図( )である。

hosw ac01
図C-1. サンプルのリポジトリ(GitHubにホストされている)のレイアウト。

それぞれのサンプルを4つのフレーバー(JUnit 4、JUnit 5、JUnit 5plus Selenium-Jupiter、TestNG)で提供しているので、MavenとGradleの両方のコンフィギュレーションはマルチプロジェクトに基づいている。このようにして、examplesリポジトリには4つのモジュールがあり、テストフレームワークごとに1つずつある:selenium-webdriver-junit4 selenium-webdriver-junit5 selenium-webdriver-junit5-seljup selenium-webdriver-testngMavenでは、マルチプロジェクトのセットアップは、ルートフォルダにあるpom.xml にあり、Gradleでは、ファイル settings.gradleファイル内にある。

図 C-1 を見ればわかるように、各モジュールは同じ構造になっている。 テスト・ソース・コードはsrc/test/java フォルダーで発見できる。Java パッケージを使って、章ごとにサンプルを分けている(例:io.github.bonigarcia.webdriver.jupiter.ch02.helloworld ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

データサイエンスのための実践線形代数

データサイエンスのための実践線形代数

Mike X Cohen
サイトリライアビリティワークブック ―SREの実践方法

サイトリライアビリティワークブック ―SREの実践方法

Betsy Beyer, Niall Richard Murphy, David K. Rensin, Kent Kawahara, Stephen Thorne, 澤田 武男, 関根 達夫, 細川 一茂, 矢吹 大輔, 玉川 竜司
エンジニアが学ぶ会計システムの「知識」と「技術」

エンジニアが学ぶ会計システムの「知識」と「技術」

広川 敬祐, 五島 伸二, 小田 恭彦, 大塚 晃, 川勝 健司

Publisher Resources

ISBN: 9798341626287