Run cypress with custom commands

This commit is contained in:
Bjarke Berg
2021-03-22 18:29:26 +01:00
parent eeb5c1db7c
commit b60fffe8e5

View File

@@ -165,16 +165,44 @@ stages:
- task: Npm@1
displayName: npm install (AcceptanceTest)
inputs:
workingDir: src\Umbraco.Tests.AcceptanceTest
verbose: false
# - powershell: Invoke-WebRequest https://localhost:44331 -SkipCertificateCheck -TimeoutSec 120
# displayName: Call website
- task: Npm@1
displayName: npm run test (AcceptanceTest)
workingDir:
- task: PowerShell@2
displayName: Run Cypress (Desktop)
inputs:
workingDir: src\Umbraco.Tests.AcceptanceTest
command: 'custom'
customCommand: 'run test'
targetType: 'inline'
errorActionPreference: 'continue'
workingDirectory: 'src\Umbraco.Tests.AcceptanceTest'
script: |
node_modules/.bin/cypress run --reporter junit --reporter-options "mochaFile=results/test-output-D-[hash].xml,toConsole=true" --config videoUploadOnPasses=false,viewportHeight=1600,viewportWidth=2560,screenshotsFolder=cypress/artifacts/desktop/screenshots,videosFolder=cypress/artifacts/desktop/videos
- task: PowerShell@2
displayName: Run Cypress (Tablet portrait)
inputs:
targetType: 'inline'
errorActionPreference: 'continue'
workingDirectory: 'src\Umbraco.Tests.AcceptanceTest'
script: |
node_modules/.bin/cypress run --reporter junit --reporter-options "mochaFile=results/test-output-T-[hash].xml,toConsole=true" --config videoUploadOnPasses=false,viewportHeight=1366,viewportWidth=1024,screenshotsFolder=cypress/artifacts/tablet/screenshots,videosFolder=cypress/artifacts/tablet/videos
- task: PowerShell@2
displayName: Run Cypress (Mobile protrait)
inputs:
targetType: 'inline'
errorActionPreference: 'continue'
workingDirectory: 'src\Umbraco.Tests.AcceptanceTest'
script: |
node_modules/.bin/cypress run --reporter junit --reporter-options "mochaFile=results/test-output-M-[hash].xml,toConsole=true" --config videoUploadOnPasses=false,viewportHeight=812,viewportWidth=375,screenshotsFolder=cypress/artifacts/mobile/screenshots,videosFolder=cypress/artifacts/mobile/videos
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'results/test-output-M-*.xml'
mergeTestResults: true
testRunTitle: "Test results Mobile"
# - task: Npm@1
# displayName: npm run test (AcceptanceTest)
# inputs:
# workingDir: src\Umbraco.Tests.AcceptanceTest
# command: 'custom'
# customCommand: 'run test'
- stage: Artifacts
dependsOn: []
jobs: