运行 Azure Devops 管道上的 Flutter 集成测试,用于 UI 自动化测试
Running integration testing for Flutter on Azure Devops pipeline for UI automation testing
我想 运行 在 Azure Devops Pipelines 上使用 flutter 驱动程序进行自动化 UI 测试,我正在使用 Flutter Tasks by Alois Daniel。 azure flutter 任务插件目前不支持 flutter 驱动程序。我们正在寻找可以启动 Android 和 iOS 模拟器的任务,同时 运行ning flutter 驱动程序测试。我们正在 运行在 azure devops 管道 yml 文件中为 macos-latest 创建一个 vm-image。
没有这样的内置扩展来实现您的需要。
作为替代方案,您可以创建自己的扩展程序,建议您查看以下文章:
为了实现我想做的事情,我用下面的代码创建了一个文件,并添加了脚本功能,将其推送到项目中
# DO NOT RUN ON YOUR LOCAL MACHINE
echo "install xcode in command line"
xcode-select --install
echo "install home brew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "install flutter using brew"
brew install --cask flutter
echo "starting up apple emulator"
flutter emulators --launch <apple_ios_simulator/android emulator>
echo "awaiting for emualator to load"
sleep 5
echo "starting integration tests"
flutter drive --target=test_driver/<yourtestfile>.dart
通过从开发操作的侧面板拖放,在您的 azure-pipeline yml 中将其作为 bash 脚本调用。 运行 它,你会看到它的工作。
一些限制是当涉及到 android/ios 模拟器上的系统对话框时需要用户权限,你可以按照它 here。
对于 iOS,有一个名为 AppleSimulatorUtils
的工具
我想 运行 在 Azure Devops Pipelines 上使用 flutter 驱动程序进行自动化 UI 测试,我正在使用 Flutter Tasks by Alois Daniel。 azure flutter 任务插件目前不支持 flutter 驱动程序。我们正在寻找可以启动 Android 和 iOS 模拟器的任务,同时 运行ning flutter 驱动程序测试。我们正在 运行在 azure devops 管道 yml 文件中为 macos-latest 创建一个 vm-image。
没有这样的内置扩展来实现您的需要。
作为替代方案,您可以创建自己的扩展程序,建议您查看以下文章:
为了实现我想做的事情,我用下面的代码创建了一个文件,并添加了脚本功能,将其推送到项目中
# DO NOT RUN ON YOUR LOCAL MACHINE
echo "install xcode in command line"
xcode-select --install
echo "install home brew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "install flutter using brew"
brew install --cask flutter
echo "starting up apple emulator"
flutter emulators --launch <apple_ios_simulator/android emulator>
echo "awaiting for emualator to load"
sleep 5
echo "starting integration tests"
flutter drive --target=test_driver/<yourtestfile>.dart
通过从开发操作的侧面板拖放,在您的 azure-pipeline yml 中将其作为 bash 脚本调用。 运行 它,你会看到它的工作。 一些限制是当涉及到 android/ios 模拟器上的系统对话框时需要用户权限,你可以按照它 here。 对于 iOS,有一个名为 AppleSimulatorUtils
的工具