我想在Azure Devops Pipelines上使用Flutter Driver运行自动化UI测试,我正在使用Alois Daniel的Flutter Tasks.。当前Azure Flutter Tasks插件没有Flutter Driver支持,我们正在寻找任务,在运行Flutter Driver测试时启动Android和iOS模拟器。我们在Azure Devops Pipeline yml文件中运行macos-latest的虚拟机映像。
我想在Azure Devops Pipelines上使用Flutter Driver运行自动化UI测试,我正在使用Alois Daniel的Flutter Tasks.。当前Azure Flutter Tasks插件没有Flutter Driver支持,我们正在寻找任务,在运行Flutter Driver测试时启动Android和iOS模拟器。我们在Azure Devops Pipeline yml文件中运行macos-latest的虚拟机映像。
# 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的工具。
没有内置扩展可以实现您所需的功能。
作为替代方案,您可以创建自己的扩展程序,建议您查看以下文章: