<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>3 WebDriver on 编程那些事儿</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/develop/tests/webdriver/</link><description>Recent content in 3 WebDriver on 编程那些事儿</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Fri, 25 Sep 2026 23:46:06 +0800</lastBuildDate><atom:link href="https://before80.github.io/prgms/Rust/tauriBasic/start/develop/tests/webdriver/index.xml" rel="self" type="application/rss+xml"/><item><title>1 Selenium</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/develop/tests/webdriver/example/1-selenium/</link><pubDate>Fri, 25 Sep 2026 21:31:08 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/tauriBasic/start/develop/tests/webdriver/example/1-selenium/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://tauri.app/develop/tests/webdriver/example/selenium/"&gt;https://tauri.app/develop/tests/webdriver/example/selenium/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="alert alert-primary" role="alert"&gt;&lt;div class="h4 alert-heading" role="heading"&gt;注意&lt;/div&gt;
&lt;p&gt;请务必先阅读&lt;a href="../../2-manualsetup/"&gt;前置条件说明&lt;/a&gt;，才能跟随本指南操作。&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;这个 WebDriver 测试示例将使用 &lt;a href="https://selenium.dev/"&gt;Selenium&lt;/a&gt; 和一个流行的 Node.js 测试套件。我们假设你已经安装了
Node.js，以及 &lt;code&gt;npm&lt;/code&gt; 或 &lt;code&gt;yarn&lt;/code&gt;，尽管&lt;a href="https://github.com/tauri-apps/webdriver-example"&gt;完成的示例项目&lt;/a&gt;使用的是 &lt;code&gt;pnpm&lt;/code&gt;。&lt;/p&gt;
&lt;h2 id="为测试创建目录"&gt;为测试创建目录&lt;/h2&gt;
&lt;p&gt;让我们在项目中为编写这些测试开辟空间。这个示例项目我们会用一个嵌套目录，因为后面还会介绍其它框架，但通常你只需要用其中一个。用 &lt;code&gt;mkdir -p e2e-tests&lt;/code&gt; 创建我们将使用的目录。本指南余下部分假定你位于
&lt;code&gt;e2e-tests&lt;/code&gt; 目录中。&lt;/p&gt;</description></item><item><title>1 WebDriver 概述</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/develop/tests/webdriver/1-overview/</link><pubDate>Fri, 25 Sep 2026 21:31:08 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/tauriBasic/start/develop/tests/webdriver/1-overview/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://tauri.app/develop/tests/webdriver/"&gt;https://tauri.app/develop/tests/webdriver/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://www.w3.org/TR/webdriver/"&gt;WebDriver&lt;/a&gt; 是一个与 Web 文档交互的标准化接口，主要用于自动化测试。与 Tauri 配合使用的推荐方式是 &lt;a href="https://webdriver.io/"&gt;WebdriverIO&lt;/a&gt; 和 &lt;a href="https://webdriver.io/docs/desktop-testing/tauri"&gt;&lt;code&gt;@wdio/tauri-service&lt;/code&gt;&lt;/a&gt;，它可在 &lt;strong&gt;Windows、Linux 和 macOS&lt;/strong&gt; 上工作。它由 WebdriverIO 项目维护，通过 &lt;code&gt;browser.tauri.execute()&lt;/code&gt; 提供 Tauri API 访问、命令（IPC）模拟、前端与后端日志捕获以及 multiremote 支持。&lt;/p&gt;</description></item><item><title>2 WebdriverIO</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/develop/tests/webdriver/example/2-webdriverio/</link><pubDate>Fri, 25 Sep 2026 21:31:08 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/tauriBasic/start/develop/tests/webdriver/example/2-webdriverio/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://tauri.app/develop/tests/webdriver/example/webdriverio/"&gt;https://tauri.app/develop/tests/webdriver/example/webdriverio/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="alert alert-primary" role="alert"&gt;&lt;div class="h4 alert-heading" role="heading"&gt;注意&lt;/div&gt;
&lt;p&gt;请务必先阅读&lt;a href="../../2-manualsetup/"&gt;前置条件说明&lt;/a&gt;，才能跟随本指南操作。&lt;/p&gt;
&lt;/div&gt;
&lt;div class="alert alert-primary" role="alert"&gt;&lt;div class="h4 alert-heading" role="heading"&gt;正在使用 WebdriverIO 的 Tauri 服务？&lt;/div&gt;
&lt;p&gt;本指南手工把 &lt;a href="https://webdriver.io/"&gt;WebdriverIO&lt;/a&gt; 接到 &lt;a href="https://crates.io/crates/tauri-driver"&gt;&lt;code&gt;tauri-driver&lt;/code&gt;&lt;/a&gt; 上，以便你看清各部分如何配合。大多数项目应当改用
&lt;a href="https://webdriver.io/docs/desktop-testing/tauri"&gt;&lt;code&gt;@wdio/tauri-service&lt;/code&gt;&lt;/a&gt;，它把这一切自动化并支持 macOS——参见
&lt;a href="../../1-overview/"&gt;WebDriver 概述&lt;/a&gt;。&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;这个 WebDriver 测试示例将使用 &lt;a href="https://webdriver.io/"&gt;WebdriverIO&lt;/a&gt; 及其测试套件。我们假设你已经安装了 Node.js，以及 &lt;code&gt;npm&lt;/code&gt; 或 &lt;code&gt;yarn&lt;/code&gt;，尽管&lt;a href="https://github.com/tauri-apps/webdriver-example"&gt;完成的示例项目&lt;/a&gt;使用的是 &lt;code&gt;pnpm&lt;/code&gt;。&lt;/p&gt;</description></item><item><title>2 手动配置</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/develop/tests/webdriver/2-manualsetup/</link><pubDate>Fri, 25 Sep 2026 21:31:08 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/tauriBasic/start/develop/tests/webdriver/2-manualsetup/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://tauri.app/develop/tests/webdriver/manual-setup/"&gt;https://tauri.app/develop/tests/webdriver/manual-setup/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;本页介绍如何直接驱动 &lt;a href="https://crates.io/crates/tauri-driver"&gt;&lt;code&gt;tauri-driver&lt;/code&gt;&lt;/a&gt;，而不使用 &lt;a href="https://webdriver.io/docs/desktop-testing/tauri"&gt;&lt;code&gt;@wdio/tauri-service&lt;/code&gt;&lt;/a&gt;。如果你不使用 Node.js、更偏好 &lt;a href="../example/1-selenium/"&gt;Selenium&lt;/a&gt;，或者要把 WebDriver 集成进自定义测试框架，请选用这条路线。对大多数项目来说，使用该服务是更简单的路径——它把下面的一切都自动化了，并且还支持 macOS。要开始使用它，请参阅 &lt;a href="../1-overview/"&gt;WebDriver 概述&lt;/a&gt;。&lt;/p&gt;</description></item><item><title>3 持续集成</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/develop/tests/webdriver/3-ci/</link><pubDate>Fri, 25 Sep 2026 21:31:08 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/tauriBasic/start/develop/tests/webdriver/3-ci/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://tauri.app/develop/tests/webdriver/ci/"&gt;https://tauri.app/develop/tests/webdriver/ci/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;你可以在 CI 上使用 &lt;a href="https://crates.io/crates/tauri-driver"&gt;&lt;code&gt;tauri-driver&lt;/code&gt;&lt;/a&gt; 运行 &lt;a href="https://www.w3.org/TR/webdriver/"&gt;WebDriver&lt;/a&gt; 测试。下面的示例使用我们&lt;a href="../example/2-webdriverio/"&gt;之前一起构建的&lt;/a&gt; &lt;a href="https://webdriver.io/"&gt;WebdriverIO&lt;/a&gt; 示例，以及 GitHub Actions。&lt;/p&gt;
&lt;p&gt;WebDriver 测试在 Linux 上通过创建虚拟显示来执行。
某些 CI 系统（例如 GitHub Actions）也支持在 Windows 上运行 WebDriver 测试。&lt;/p&gt;</description></item></channel></rss>