-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed292e8
commit 073790c
Showing
22 changed files
with
479 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,3 @@ jobs: | |
parameters: | ||
solution: PrismLibrary_Uno.sln | ||
solutionName: Prism.Uno | ||
|
||
# - template: ../steps/test-uno.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
jobs: | ||
|
||
- job: UnoUITest_Wasm | ||
displayName: Uno UITest WebAssembly | ||
|
||
container: unoplatform/wasm-build:2.0 | ||
|
||
pool: | ||
vmImage: $(LinuxImage) | ||
|
||
workspace: | ||
clean: all | ||
|
||
steps: | ||
|
||
- bash: | | ||
build/scripts/wasm-uitest-run.sh | ||
env: | ||
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)" | ||
BUILD_ARTIFACTSTAGINGDIRECTORY: "$(build.artifactstagingdirectory)" | ||
displayName: 'Run UI Tests' | ||
- task: PublishTestResults@2 | ||
condition: always() | ||
inputs: | ||
testRunTitle: 'WebAssembly Test Run' | ||
testResultsFormat: 'NUnit' | ||
testResultsFiles: '$(build.sourcesdirectory)/build/TestResult.xml' | ||
|
||
- task: PublishBuildArtifacts@1 | ||
condition: always() | ||
inputs: | ||
PathtoPublish: $(build.artifactstagingdirectory) | ||
ArtifactName: UnoUITests | ||
ArtifactType: Container | ||
|
||
|
||
- job: UnoUITest_Android | ||
displayName: Uno UITest Android | ||
|
||
pool: | ||
vmImage: $(MacImage) | ||
|
||
workspace: | ||
clean: all | ||
|
||
steps: | ||
|
||
- bash: | | ||
build/scripts/android-uitest-run.sh | ||
env: | ||
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)" | ||
BUILD_ARTIFACTSTAGINGDIRECTORY: "$(build.artifactstagingdirectory)" | ||
displayName: 'Run UI Tests' | ||
- task: PublishTestResults@2 | ||
condition: always() | ||
inputs: | ||
testRunTitle: 'Android Test Run' | ||
testResultsFormat: 'NUnit' | ||
testResultsFiles: '$(build.sourcesdirectory)/build/TestResult.xml' | ||
|
||
- task: PublishBuildArtifacts@1 | ||
condition: always() | ||
inputs: | ||
PathtoPublish: $(build.artifactstagingdirectory) | ||
ArtifactName: UnoUITests | ||
ArtifactType: Container | ||
|
||
|
||
- job: UnoUITest_iOS | ||
displayName: Uno UITest iOS | ||
|
||
pool: | ||
vmImage: $(MacImage) | ||
|
||
workspace: | ||
clean: all | ||
|
||
steps: | ||
|
||
- bash: | | ||
build/scripts/ios-uitest-run.sh | ||
env: | ||
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)" | ||
BUILD_ARTIFACTSTAGINGDIRECTORY: "$(build.artifactstagingdirectory)" | ||
displayName: 'Run UI Tests' | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testRunTitle: 'iOS Test Run' | ||
testResultsFormat: 'NUnit' | ||
testResultsFiles: '$(build.sourcesdirectory)/build/TestResult.xml' | ||
|
||
- task: PublishBuildArtifacts@1 | ||
condition: always() | ||
inputs: | ||
PathtoPublish: $(build.artifactstagingdirectory) | ||
ArtifactName: UnoUITests | ||
ArtifactType: Container | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# Install AVD files | ||
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-28;google_apis;x86' | ||
|
||
# Create emulator | ||
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n xamarin_android_emulator -k 'system-images;android-28;google_apis;x86' --force | ||
|
||
echo $ANDROID_HOME/emulator/emulator -list-avds | ||
|
||
echo "Starting emulator" | ||
|
||
# Start emulator in background | ||
nohup $ANDROID_HOME/emulator/emulator -avd xamarin_android_emulator -no-snapshot > /dev/null 2>&1 & | ||
|
||
# build the sample, while the emulator is starting | ||
msbuild /r /p:Configuration=Release $BUILD_SOURCESDIRECTORY/e2e/Uno/HelloUnoWorld.UITests/HelloUnoWorld.UITests.csproj | ||
msbuild /r /p:Configuration=Release $BUILD_SOURCESDIRECTORY/e2e/Uno/HelloUnoWorld.Droid/HelloUnoWorld.Droid.csproj | ||
|
||
# Wait for the emulator to finish booting | ||
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82' | ||
|
||
$ANDROID_HOME/platform-tools/adb devices | ||
|
||
echo "Emulator started" | ||
|
||
export UNO_UITEST_SCREENSHOT_PATH=$BUILD_ARTIFACTSTAGINGDIRECTORY/e2e/uno/wasm | ||
export UNO_UITEST_PLATFORM=Android | ||
export UNO_UITEST_ANDROIDAPK_PATH=$BUILD_SOURCESDIRECTORY/e2e/Uno/HelloUnoWorld.Droid/bin/Release/com.prismlibrary.helloworld-Signed.apk | ||
|
||
cd $BUILD_SOURCESDIRECTORY/build | ||
|
||
wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe | ||
mono nuget.exe install NUnit.ConsoleRunner -Version 3.10.0 | ||
|
||
mkdir -p $UNO_UITEST_SCREENSHOT_PATH | ||
|
||
mono $BUILD_SOURCESDIRECTORY/build/NUnit.ConsoleRunner.3.10.0/tools/nunit3-console.exe \ | ||
$BUILD_SOURCESDIRECTORY/e2e/Uno/HelloUnoWorld.UITests/bin/Release/net47/HelloUnoWorld.UITests.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
echo "Lising iOS simulators" | ||
xcrun simctl list devices --json | ||
|
||
/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator & | ||
|
||
cd $BUILD_SOURCESDIRECTORY | ||
msbuild /r /p:Configuration=Release $BUILD_SOURCESDIRECTORY/e2e/Uno/HelloUnoWorld.UITests/HelloUnoWorld.UITests.csproj | ||
msbuild /r /p:Configuration=Release "/p:Platform=iPhoneSimulator" $BUILD_SOURCESDIRECTORY/e2e/Uno/HelloUnoWorld.iOS/HelloUnoWorld.iOS.csproj | ||
|
||
cd $BUILD_SOURCESDIRECTORY/build | ||
|
||
wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe | ||
mono nuget.exe install NUnit.ConsoleRunner -Version 3.10.0 | ||
|
||
export UNO_UITEST_PLATFORM=iOS | ||
export UNO_UITEST_IOSBUNDLE_PATH=$BUILD_SOURCESDIRECTORY/e2e/Uno/HelloUnoWorld.iOS/bin/iPhoneSimulator/Release/HelloUnoWorld.app | ||
export UNO_UITEST_SCREENSHOT_PATH=$BUILD_ARTIFACTSTAGINGDIRECTORY/e2e/uno/wasm | ||
|
||
mkdir -p $UNO_UITEST_SCREENSHOT_PATH | ||
|
||
mono $BUILD_SOURCESDIRECTORY/build/NUnit.ConsoleRunner.3.10.0/tools/nunit3-console.exe \ | ||
--inprocess \ | ||
--agents=1 \ | ||
--workers=1 \ | ||
$BUILD_SOURCESDIRECTORY/e2e/Uno/HelloUnoWorld.UITests/bin/Release/net47/HelloUnoWorld.UITests.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
|
||
cd $BUILD_SOURCESDIRECTORY | ||
|
||
msbuild /r /p:Configuration=Release $BUILD_SOURCESDIRECTORY/e2e/Uno/HelloUnoWorld.UITests/HelloUnoWorld.UITests.csproj | ||
msbuild /r /p:Configuration=Release $BUILD_SOURCESDIRECTORY/e2e/Uno/HelloUnoWorld.Wasm/HelloUnoWorld.Wasm.csproj | ||
|
||
cd $BUILD_SOURCESDIRECTORY/build | ||
|
||
npm i chromedriver@74.0.0 | ||
npm i puppeteer@1.13.0 | ||
|
||
wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe | ||
mono nuget.exe install NUnit.ConsoleRunner -Version 3.10.0 | ||
|
||
export UNO_UITEST_TARGETURI=http://localhost:8000 | ||
export UNO_UITEST_DRIVERPATH_CHROME=$BUILD_SOURCESDIRECTORY/build/node_modules/chromedriver/lib/chromedriver | ||
export UNO_UITEST_CHROME_BINARY_PATH=$BUILD_SOURCESDIRECTORY/build/node_modules/puppeteer/.local-chromium/linux-637110/chrome-linux/chrome | ||
export UNO_UITEST_SCREENSHOT_PATH=$BUILD_ARTIFACTSTAGINGDIRECTORY/e2e/uno/wasm | ||
export UNO_UITEST_PLATFORM=Browser | ||
export UNO_UITEST_CHROME_CONTAINER_MODE=true | ||
|
||
mkdir -p $UNO_UITEST_SCREENSHOT_PATH | ||
|
||
# The python server serves the current working directory, and may be changed by the nunit runner | ||
bash -c "cd $BUILD_SOURCESDIRECTORY/e2e/Uno/HelloUnoWorld.Wasm/bin/Release/netstandard2.0/dist/; python server.py &" | ||
|
||
mono $BUILD_SOURCESDIRECTORY/build/NUnit.ConsoleRunner.3.10.0/tools/nunit3-console.exe \ | ||
--trace=Verbose \ | ||
--inprocess \ | ||
--agents=1 \ | ||
--workers=1 \ | ||
$BUILD_SOURCESDIRECTORY/e2e/Uno/HelloUnoWorld.UITests/bin/Release/net47/HelloUnoWorld.UITests.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
<UserControl x:Class="HelloUnoWorld.Views.ViewA" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:HelloUnoWorld.Views" | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" d:DesignWidth="800"> | ||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
<TextBlock Text="View A" FontSize="72" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" /> | ||
</Grid> | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" | ||
d:DesignWidth="800"> | ||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
<TextBlock x:Name="viewAText" | ||
Text="View A" | ||
FontSize="72" | ||
FontWeight="Bold" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center" /> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Uno.UITest.Helpers.Queries; | ||
|
||
namespace Sample.UITests | ||
{ | ||
public class Constants | ||
{ | ||
public readonly static string WebAssemblyDefaultUri = "http://localhost:62905/"; | ||
public readonly static string iOSAppName = "com.prismlibrary.helloworld"; | ||
public readonly static string AndroidAppName = "com.prismlibrary.helloworld"; | ||
public readonly static string iOSDeviceNameOrId = "iPad Pro (12.9-inch) (3rd generation)"; | ||
|
||
public readonly static Platform CurrentPlatform = Platform.Browser; | ||
} | ||
} |
Oops, something went wrong.