* Add tests for property presest value * save method' * update accepntance test * ad timeout to preset value test * Updated yaml file to copy all .cs files but still keep folder structure * remove timeout from preset value test * adding time wait to tests * adding more timeout * Adding slow test * update test * Format code * Format code and add more afterEach step to clean language * Remove test.slow() as it is unnecessary --------- Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk> Co-authored-by: Nhu Dinh <hnd@umbraco.dk> Co-authored-by: Nhu Dinh <150406148+nhudinh0309@users.noreply.github.com>
81 lines
3.2 KiB
YAML
81 lines
3.2 KiB
YAML
parameters:
|
|
- name: testFolder
|
|
type: string
|
|
default: ''
|
|
|
|
- name: buildConfiguration
|
|
type: string
|
|
default: ''
|
|
|
|
- name: additionalEnvironmentVariables
|
|
type: string
|
|
default: 'false'
|
|
|
|
steps:
|
|
- pwsh: |
|
|
dotnet restore UmbracoProject
|
|
cp $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest.UmbracoProject/*.cs UmbracoProject
|
|
displayName: Restore project
|
|
workingDirectory: $(Agent.BuildDirectory)/app
|
|
|
|
# Update application to use necessary app settings
|
|
- pwsh: |
|
|
$sourcePath = "$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/tests/${{ parameters.testFolder }}/AdditionalSetup"
|
|
$destinationPath = "UmbracoProject"
|
|
$jsonFiles = Get-ChildItem -Path $sourcePath -Filter "*.json"
|
|
if ($jsonFiles) {
|
|
$jsonFiles | ForEach-Object {
|
|
Write-Host "Copying: $($_.FullName)"
|
|
Copy-Item -Path $_.FullName -Destination $destinationPath -Force
|
|
}
|
|
} else {
|
|
Write-Host "No JSON files found."
|
|
}
|
|
displayName: Update application to use necessary app settings
|
|
workingDirectory: $(Agent.BuildDirectory)/app
|
|
|
|
# Update application to use necessary App_Plugins
|
|
- pwsh: |
|
|
$sourcePath = "$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/tests/${{ parameters.testFolder }}/AdditionalSetup"
|
|
$destinationPath = "UmbracoProject"
|
|
$appPluginsFolders = Get-ChildItem -Path $sourcePath -Directory -Filter "App_Plugins"
|
|
if ($appPluginsFolders) {
|
|
foreach ($folder in $appPluginsFolders) {
|
|
Write-Host "Copying folder: $($folder.FullName)"
|
|
Copy-Item -Path $folder.FullName -Destination $destinationPath -Recurse -Force
|
|
}
|
|
} else {
|
|
Write-Host "No App_Plugins found."
|
|
}
|
|
displayName: Update application to use necessary app plugins
|
|
workingDirectory: $(Agent.BuildDirectory)/app
|
|
|
|
# Update application to use necessary classes
|
|
- pwsh: |
|
|
$sourcePath = "$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/tests/${{ parameters.testFolder }}/AdditionalSetup"
|
|
$destinationPath = "UmbracoProject"
|
|
$csharpFiles = Get-ChildItem -Path $sourcePath -Filter "*.cs" -Recurse
|
|
if ($csharpFiles) {
|
|
$csharpFiles | ForEach-Object {
|
|
$relativePath = $_.FullName.Substring($sourcePath.Length + 1)
|
|
$targetPath = Join-Path -Path $destinationPath -ChildPath $relativePath
|
|
$targetDir = Split-Path -Path $targetPath -Parent
|
|
if (-not (Test-Path -Path $targetDir)) {
|
|
New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
|
|
}
|
|
Write-Host "Copying: $($_.FullName) -> $targetPath"
|
|
Copy-Item -Path $_.FullName -Destination $targetPath -Force
|
|
}
|
|
} else {
|
|
Write-Host "No C# files found."
|
|
}
|
|
displayName: Update application to use necessary classes
|
|
workingDirectory: $(Agent.BuildDirectory)/app
|
|
|
|
- pwsh: |
|
|
dotnet build UmbracoProject --configuration ${{ parameters.buildConfiguration }} --no-restore
|
|
dotnet dev-certs https
|
|
displayName: Build application
|
|
workingDirectory: $(Agent.BuildDirectory)/app
|
|
condition: and(succeeded(), eq(variables['additionalEnvironmentVariables'], 'false'))
|