カテゴリー・パッケージ・リポジトリを検索

パッケージ詳細v3.2.0

webdriver

Dart用のWebDriverバインディングを提供します。WebDriver JSONインターフェースおよびW3C仕様をサポートしています。WebDriverリモートサーバーの使用が必要です。

30日間ダウンロード
1140万
いいね数
67
Pub ポイント
130

パッケージをインストール

flutter pub add webdriver

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

webdriver パッケージは、Dart 用の WebDriver バインディングを提供し、WebDriver JSON インターフェースおよび W3C 標準を通じてブラウザの自動テストを可能にします。動作には別途の WebDriver リモートサーバーが必要であり、Dart アプリケーションがブラウザをプログラム的に制御できるようにします。このパッケージは、異なるブラウザやプラットフォーム上で実際のユーザー操作をシミュレートするエンドツーエンドテストを書くのに最適です。現代的なウェブテストワークフローをサポートしており、test や integration_test などのテストフレームワークと良好に統合されます。

用途

  • 自動ブラウザテスト
  • Webアプリケーションのエンドツーエンドテスト
  • クロスブラウザ互換性テスト
  • 実際のブラウザを使用した統合テスト
  • CI/CDパイプラインにおけるテスト自動化

主な機能

  • WebDriver JSON および W3C 標準をサポートしています
  • 外部のWebDriverサーバーが必要です
  • Dartを介してブラウザの自動化を可能にします
  • リアルなユーザーインタラクションのシミュレーションを促進する
  • Dart テスティングフレームワークと統合されます

適している対象

  • Web テストを行う Dart 開発者
  • CI/CD パイプラインを使用するチーム
  • ブラウザワークフローの自動化を行うテストエンジニア
  • クロスブラウザ検証を必要とするプロジェクト
  • W3C WebDriver 標準に従う開発者

注意事項

  • 実行中のWebDriverサーバー(例:Selenium Server)が必要です
  • セットアップなしではヘッドレス専用のシナリオには適していません
  • ブラウザの自動化に限定され、モバイルまたはネイティブUIテストには対応していません
  • 外部サーバーの安定性に依存
  • セキュアな環境用に追加の構成が必要になる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

CI pub package package publisher

Provides WebDriver bindings for Dart. These use the WebDriver JSON interface, and as such, require the use of the WebDriver remote server.

Using package:webdriver

In your Dart code, you can use:

import 'package:webdriver/io.dart';

WebDriver driver = createDriver(...);

This will use by default the asynchronous, JSON wire spec implementation. You now can also use a synchronous version of WebDriver:

import 'package:webdriver/sync_io.dart';

final driver = createDriver(...);

This version of WebDriver supports both the JSON wire spec and W3C spec, allowing use with modern versions of Firefox. This defaults to the JSON wire spec, but can also be configured to use the W3C spec or even to try and automatically infer the spec during session creation:

final w3cDriver = createDriver(spec: WebDriverSpec.W3c);  // Use W3C spec.

final anyDriver = createDriver(spec: WebDriverSpec.Auto); // Infer spec.

Testing

Unfortunately using bazel with Dart libraries and Dart WebDriver is not yet supported. We hope to add this at some point, but for now pub still works.

As a consequence, running tests is a bit more complicated than we'd like:

  1. Launch a WebDriver binar(ies).

    First, bring up chromedriver / geckodriver. Other conforming WebDriver binaries should work as well, but we test against these:

    chromedriver --port=4444 --url-base=wd/hub --verbose
    geckodriver --port=4445
    

    ChromeDriver is used to test our JSON wire spec implementation, and geckodriver is used to test our W3C spec implementation.

    Synchronous tests are labeled as Chrome/Firefox. All async tests run exclusively against Chrome (as async, like ChromeDriver supports only the old JSON wire spec).

  2. Run a test. All files suffixed with _test.dart are tests.

    dart test test/path/to/the_test.dart -r expanded -p vm
    

    Or to run all tests:

    dart test -r expanded -p vm
    

    You should probably go get a coffee or something, this is gonna take a while.

カテゴリー

依存関係

依存関係一覧 5 件

ソースリポジトリ

このパッケージを使用しているプロジェクト