분류, 패키지 및 저장소 검색

패키지 상세v3.2.0

webdriver

다트용 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와 같은 테스트 프레임워크와 잘 통합됩니다.

사용 사례

  • 자동 브라우저 테스트
  • 웹 애플리케이션의 엔드 투 엔드 테스트
  • 크로스 브라우저 호환성 테스트
  • 실제 브라우저를 사용한 통합 테스트
  • CI/CD 파이프라인에서의 테스트 자동화

주요 기능

  • WebDriver JSON 및 W3C 사양을 지원합니다
  • 외부 WebDriver 서버가 필요합니다
  • Dart를 통해 브라우저 자동화를 가능하게 합니다
  • 실제 사용자 상호작용 시뮬레이션을 촉진합니다
  • Dart 테스팅 프레임워크와 통합됩니다

적합한 대상

  • 웹 테스트를 수행하는 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 개

소스 저장소

이 패키지를 사용하는 프로젝트