mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
Integrate into CI build, switch to .NET Core
This commit is contained in:
parent
5b21fa59a4
commit
a2132d6c6a
10 changed files with 81 additions and 253 deletions
|
@ -33,6 +33,10 @@ jobs:
|
|||
platform: ARM64
|
||||
condition: not(eq(variables['Build.Reason'], 'PullRequest'))
|
||||
|
||||
- template: ./templates/run-ui-tests.yaml
|
||||
parameters:
|
||||
platform: x64
|
||||
|
||||
- template: ./templates/run-unit-tests.yaml
|
||||
parameters:
|
||||
platform: x64
|
||||
|
|
|
@ -30,7 +30,7 @@ steps:
|
|||
inputs:
|
||||
solution: src/Calculator.sln
|
||||
vsVersion: 15.0
|
||||
msbuildArgs: /bl:$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator.binlog /p:OutDir=$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\ /p:GenerateProjectSpecificOutputFolder=true /p:AppVersion=$(Build.BuildNumber) ${{ parameters.extraMsBuildArgs }}
|
||||
msbuildArgs: /bl:$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator.binlog /p:OutDir=$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\ /p:GenerateProjectSpecificOutputFolder=true /p:AppVersion=$(Build.BuildNumber) /t:Publish /p:PublishDir=$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\publish\ ${{ parameters.extraMsBuildArgs }}
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
clean: true
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
# The Build.Configuration must be set to 'Release' for UI tests to work.
|
||||
|
||||
#parameters:
|
||||
# platform: ''
|
||||
|
||||
variables:
|
||||
# Parameters.configuration: ${{ parameters.platform }}
|
||||
Parameters.configuration: x86
|
||||
Build.Configuration: Release
|
||||
Calc.ArtifactsName: drop
|
||||
Calc.BuildVersion: 0.0.0.0
|
||||
|
||||
jobs:
|
||||
|
||||
- job: UITests
|
||||
displayName: Test Automation
|
||||
condition: succeeded()
|
||||
pool:
|
||||
name: Hosted Windows 2019 with VS2019
|
||||
demands: DotNetFramework
|
||||
|
||||
steps:
|
||||
- task: PowerShell@1
|
||||
displayName: 'Set Resolution'
|
||||
inputs:
|
||||
scriptType: inlineScript
|
||||
arguments: '-NonInteractive -Force:$true -Verb RunAs'
|
||||
inlineScript: 'Set-DisplayResolution -Width 1920 -Height 1080 -Force'
|
||||
continueOnError: true
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: 'Download Build Artifacts'
|
||||
inputs:
|
||||
buildType: specific
|
||||
project: '96681257-9d83-44bf-a018-305e019cc129'
|
||||
pipeline: 18
|
||||
artifactName: $(Calc.ArtifactsName)
|
||||
downloadPath: '$(build.ArtifactStagingDirectory)\AppxPackages'
|
||||
|
||||
- task: PowerShell@1
|
||||
displayName: 'Install Cert (release)'
|
||||
inputs:
|
||||
scriptType: inlineScript
|
||||
arguments: '-NonInteractive -Verb RunAs'
|
||||
inlineScript: |
|
||||
$file = ( Get-ChildItem -Path $(Build.ArtifactStagingDirectory)\AppxPackages\$(Calc.ArtifactsName)\Calculator_$(Calc.BuildVersion)_Test\Calculator_$(Calc.BuildVersion)_x86.cer )
|
||||
$file | Import-Certificate -CertStoreLocation cert:\LocalMachine\Root
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- task: PowerShell@1
|
||||
displayName: 'Normal Add-AppDevPackage.ps1 (release)'
|
||||
inputs:
|
||||
scriptName: '$(Build.ArtifactStagingDirectory)\AppxPackages\$(Calc.ArtifactsName)\Calculator_$(Calc.BuildVersion)_Test\Add-AppDevPackage.ps1'
|
||||
arguments: '-NonInteractive -Force:$true -Verb RunAs'
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- task: PowerShell@1
|
||||
displayName: 'Start WinAppDriver'
|
||||
inputs:
|
||||
scriptType: inlineScript
|
||||
inlineScript: 'Start-Process -FilePath "C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe" -Verb RunAs '
|
||||
|
||||
- task: VSTest@2
|
||||
displayName: 'VsTest - Execute WinAppDriver Tests'
|
||||
inputs:
|
||||
testAssemblyVer2: |
|
||||
$(Build.ArtifactStagingDirectory)\AppxPackages\$(Calc.ArtifactsName)\src\CalculatorWADTests\bin\$(Build.Configuration)\CalculatorTest.dll
|
||||
!**\obj\**
|
||||
vsTestVersion: 16.0
|
||||
runSettingsFile: src/CalculatorWADTests/TestSettings1.runsettings
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(Build.Configuration)'
|
||||
continueOnError: true
|
52
build/pipelines/templates/run-ui-tests.yaml
Normal file
52
build/pipelines/templates/run-ui-tests.yaml
Normal file
|
@ -0,0 +1,52 @@
|
|||
# This template contains jobs to run UI tests using WinAppDriver.
|
||||
|
||||
parameters:
|
||||
platform: ''
|
||||
|
||||
jobs:
|
||||
- job: UITests${{ parameters.platform }}
|
||||
displayName: UITests ${{ parameters.platform }}
|
||||
dependsOn: Build${{ parameters.platform }}
|
||||
condition: succeeded()
|
||||
pool:
|
||||
vmImage: windows-2019
|
||||
variables:
|
||||
skipComponentGovernanceDetection: true
|
||||
steps:
|
||||
- checkout: none
|
||||
|
||||
- powershell: Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
||||
displayName: Set resolution to 1920x1080
|
||||
continueOnError: true
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download AppxBundle and CalculatorUITests
|
||||
inputs:
|
||||
artifactName: drop
|
||||
itemPattern: |
|
||||
drop/Release/${{ parameters.platform }}/Calculator/AppPackages/**
|
||||
drop/Release/${{ parameters.platform }}/publish/**
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Install certificate
|
||||
inputs:
|
||||
filePath: $(Build.ArtifactStagingDirectory)/drop/Release/${{ parameters.platform }}/Calculator/AppPackages/Calculator_$(Build.BuildNumber)_Test/Add-AppDevPackage.ps1
|
||||
arguments: -CertificatePath $(Build.ArtifactStagingDirectory)/drop/Release/${{ parameters.platform }}/Calculator/AppPackages/Calculator_$(Build.BuildNumber)_Test/Calculator_$(Build.BuildNumber)_${{ parameters.platform }}.cer -Force
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Install app
|
||||
inputs:
|
||||
filePath: $(Build.ArtifactStagingDirectory)/drop/Release/${{ parameters.platform }}/Calculator/AppPackages/Calculator_$(Build.BuildNumber)_Test/Add-AppDevPackage.ps1
|
||||
arguments: -Force
|
||||
|
||||
- powershell: Start-Process -FilePath "C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe" -Verb RunAs
|
||||
displayName: Start WinAppDriver
|
||||
|
||||
- task: VSTest@2
|
||||
displayName: Run CalculatorUITests
|
||||
inputs:
|
||||
testAssemblyVer2: $(Build.ArtifactStagingDirectory)/drop/Release/${{ parameters.platform }}/publish/CalculatorUITests.dll
|
||||
vsTestVersion: 16.0
|
||||
runSettingsFile: $(Build.ArtifactStagingDirectory)/drop/Release/${{ parameters.platform }}/publish/CalculatorUITests.runsettings
|
||||
platform: ${{ parameters.platform }}
|
||||
configuration: Release
|
|
@ -20,19 +20,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CalculatorUITests", "Calcul
|
|||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|ARM64 = Debug|ARM64
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|ARM = Release|ARM
|
||||
Release|ARM64 = Release|ARM64
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
|
@ -45,7 +42,6 @@ Global
|
|||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|x86.Build.0 = Debug|Win32
|
||||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|x86.Deploy.0 = Debug|Win32
|
||||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|ARM.Build.0 = Release|ARM
|
||||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|ARM.Deploy.0 = Release|ARM
|
||||
|
@ -58,7 +54,6 @@ Global
|
|||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|x86.ActiveCfg = Release|Win32
|
||||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|x86.Build.0 = Release|Win32
|
||||
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|x86.Deploy.0 = Release|Win32
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
|
@ -67,7 +62,6 @@ Global
|
|||
{311E866D-8B93-4609-A691-265941FEE101}.Debug|x64.Build.0 = Debug|x64
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Debug|x86.Build.0 = Debug|Win32
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Release|ARM.Build.0 = Release|ARM
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
|
@ -76,7 +70,6 @@ Global
|
|||
{311E866D-8B93-4609-A691-265941FEE101}.Release|x64.Build.0 = Release|x64
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Release|x86.ActiveCfg = Release|Win32
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Release|x86.Build.0 = Release|Win32
|
||||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
|
@ -85,7 +78,6 @@ Global
|
|||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|x64.Build.0 = Debug|x64
|
||||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|x86.Build.0 = Debug|Win32
|
||||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|ARM.Build.0 = Release|ARM
|
||||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
|
@ -94,7 +86,6 @@ Global
|
|||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|x64.Build.0 = Release|x64
|
||||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|x86.ActiveCfg = Release|Win32
|
||||
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|x86.Build.0 = Release|Win32
|
||||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Debug|x64.ActiveCfg = Debug|x64
|
||||
|
@ -103,7 +94,6 @@ Global
|
|||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Debug|x86.Build.0 = Debug|Win32
|
||||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Debug|x86.Deploy.0 = Debug|Win32
|
||||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Release|x64.ActiveCfg = Release|x64
|
||||
|
@ -112,8 +102,6 @@ Global
|
|||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Release|x86.ActiveCfg = Release|Win32
|
||||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Release|x86.Build.0 = Release|Win32
|
||||
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Release|x86.Deploy.0 = Release|Win32
|
||||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Debug|ARM64.ActiveCfg = Debug|Any CPU
|
||||
|
@ -122,8 +110,6 @@ Global
|
|||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}.Release|ARM64.ActiveCfg = Release|Any CPU
|
||||
|
|
|
@ -2,10 +2,9 @@
|
|||
// Licensed under the MIT License.
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using OpenQA.Selenium.Appium;
|
||||
using OpenQA.Selenium.Appium.Windows;
|
||||
using OpenQA.Selenium.Remote;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace CalculatorUITests
|
||||
{
|
||||
|
@ -23,10 +22,10 @@ namespace CalculatorUITests
|
|||
{
|
||||
// Create a new session to bring up an instance of the Calculator application
|
||||
// Note: Multiple calculator windows (instances) share the same process Id
|
||||
DesiredCapabilities appCapabilities = new DesiredCapabilities();
|
||||
appCapabilities.SetCapability("app", CalculatorAppId);
|
||||
appCapabilities.SetCapability("deviceName", "WindowsPC");
|
||||
session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appCapabilities);
|
||||
var options = new AppiumOptions();
|
||||
options.AddAdditionalCapability("app", CalculatorAppId);
|
||||
options.AddAdditionalCapability("deviceName", "WindowsPC");
|
||||
session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), options);
|
||||
session.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(180);
|
||||
Assert.IsNotNull(session);
|
||||
}
|
||||
|
|
|
@ -1,96 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props" Condition="Exists('packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props')" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{B2C5ADFF-D6B5-48C1-BB8C-571BFD583D7F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CalculatorUITests</RootNamespace>
|
||||
<AssemblyName>CalculatorUITests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||
<IsCodedUITest>False</IsCodedUITest>
|
||||
<TestProjectType>UnitTest</TestProjectType>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
|
||||
<PackageReference Include="Appium.WebDriver" Version="4.0.0.6-beta" />
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
</ItemGroup>
|
||||
</When>
|
||||
<Otherwise />
|
||||
</Choose>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="ScenarioStandard.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="CalculatorSession.cs" />
|
||||
<None Update="CalculatorUITests.runsettings">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.WinAppDriver.Appium.WebDriver">
|
||||
<Version>1.0.1-Preview</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestAdapter">
|
||||
<Version>2.0.0-beta2</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestFramework">
|
||||
<Version>2.0.0-beta2</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</When>
|
||||
</Choose>
|
||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,24 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RunSettings>
|
||||
<!-- Configurations that affect the Test Framework -->
|
||||
<!-- Configurations for data collectors -->
|
||||
|
||||
|
||||
<DataCollectionRunSettings>
|
||||
<DataCollectors>
|
||||
<DataCollector uri="datacollector://microsoft/VideoRecorder/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorder.VideoRecorderDataCollector, Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorder, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Screen and Voice Recorder">
|
||||
<!--Video data collector was introduced in Visual Studio 2017 version 15.5 -->
|
||||
</DataCollector>
|
||||
|
||||
</DataCollectors>
|
||||
</DataCollectionRunSettings>
|
||||
|
||||
|
||||
<!-- Adapter Specific sections -->
|
||||
|
||||
<!-- MSTest adapter -->
|
||||
<MSTest>
|
||||
<ForcedLegacyMode>false</ForcedLegacyMode>
|
||||
</MSTest>
|
||||
|
||||
</RunSettings>
|
|
@ -1,52 +0,0 @@
|
|||
//******************************************************************************
|
||||
//
|
||||
// Copyright (c) 2016 Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// This code is licensed under the MIT License (MIT).
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
//
|
||||
//******************************************************************************
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("CalculatorTest")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CalculatorTest")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016 Microsoft Corporation")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("b2c5adff-d6b5-48c1-bb8c-571bfd583d7f")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -17,7 +17,7 @@ namespace CalculatorUITests
|
|||
[TestMethod]
|
||||
public void Addition()
|
||||
{
|
||||
// Find the buttons by their names and click them in sequence to peform 1 + 7 = 8
|
||||
// Find the buttons by their names and click them in sequence to perform 1 + 7 = 8
|
||||
session.FindElementByName("One").Click();
|
||||
session.FindElementByName("Plus").Click();
|
||||
session.FindElementByName("Seven").Click();
|
||||
|
@ -73,7 +73,7 @@ namespace CalculatorUITests
|
|||
catch
|
||||
{
|
||||
header = session.FindElementByAccessibilityId("ContentPresenter");
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure that calculator is in standard mode
|
||||
if (!header.Text.Equals("Standard", StringComparison.OrdinalIgnoreCase))
|
||||
|
@ -85,6 +85,7 @@ namespace CalculatorUITests
|
|||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
Assert.IsTrue(header.Text.Equals("Standard", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
// Locate the calculatorResult element
|
||||
calculatorResult = session.FindElementByAccessibilityId("CalculatorResults");
|
||||
Assert.IsNotNull(calculatorResult);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue