Warm tip: This article is reproduced from serverfault.com, please click

Running integration testing for Flutter on Azure Devops pipeline for UI automation testing

发布于 2020-11-25 14:23:09

I would like to run automated UI testing using flutter driver on Azure Devops Pipelines and I'm using Flutter Tasks by Alois Daniel. There is no flutter driver support currenly on the azure flutter tasks plugin. We are looking for tasks where it would start up the simulators for Android and iOS while running flutter driver tests. We are running a vm-image for macos-latest in azure devops pipeline yml file.

Questioner
Lobo
Viewed
0
Lobo 2020-11-28 23:13:15

To achieve what i wanted to do, i instead created a file with the below code and added script capability pushed it to the project

# 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

call this in your azure-pipeline yml as a bash script via drag and drop from the side-panel of your dev ops. Run it and you will see it work. Some limitations are when it comes to system dialog boxes on the android/ios emulators which requires user permission, you can follow it here. For iOS there is a tool called AppleSimulatorUtils

enter image description here