mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
ci: refactor browser tests (#1804)
This commit is contained in:
parent
b89458611b
commit
a7d881019b
@ -11,7 +11,7 @@ insert_final_newline = true
|
|||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
[{azure-pipelines.yml,package.json}]
|
[{azure-pipelines.yml,package.json, ci/*.yml}]
|
||||||
# The indent size used in the `package.json` file cannot be changed
|
# The indent size used in the `package.json` file cannot be changed
|
||||||
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
|
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
@ -73,358 +73,68 @@ jobs:
|
|||||||
inputs:
|
inputs:
|
||||||
PathtoPublish: 'www/public'
|
PathtoPublish: 'www/public'
|
||||||
artifactName: docs
|
artifactName: docs
|
||||||
- job: Browser_Tests_Linux_Firefox_Stable
|
|
||||||
displayName: Linux Firefox Stable
|
- template: ci/browser-tests.yml
|
||||||
pool:
|
parameters:
|
||||||
vmImage: 'Ubuntu-16.04'
|
name: Browser_Tests_Linux_Firefox_Stable
|
||||||
variables:
|
displayName: Linux Firefox Stable
|
||||||
TARGET_BROWSER: Firefox_Stable
|
vmImage: 'ubuntu-16.04'
|
||||||
dependsOn: Build
|
targetBrowser: Firefox_Stable
|
||||||
condition: succeeded()
|
xvfb: true
|
||||||
steps:
|
|
||||||
- task: NodeTool@0
|
- template: ci/browser-tests.yml
|
||||||
inputs:
|
parameters:
|
||||||
versionSpec: '10.x'
|
name: Browser_Tests_Linux_Chrome_Stable
|
||||||
displayName: 'Install Node.js'
|
displayName: Linux Chrome Stable
|
||||||
- task: Npm@0
|
vmImage: 'ubuntu-16.04'
|
||||||
inputs:
|
targetBrowser: Chrome_Stable
|
||||||
command: install
|
xvfb: true
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download library'
|
- template: ci/browser-tests.yml
|
||||||
inputs:
|
parameters:
|
||||||
artifactName: dist
|
name: Browser_Tests_OSX_Safari_IOS_9
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
displayName: iOS Simulator Safari 9
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download testrunner'
|
|
||||||
inputs:
|
|
||||||
artifactName: build
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- script: Xvfb :99 &
|
|
||||||
displayName: 'Start Xvfb'
|
|
||||||
- script: DISPLAY=:99 npm run karma
|
|
||||||
displayName: 'Run Firefox tests - Firefox Stable'
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
testRunner: JUnit
|
|
||||||
testResultsFiles: 'tmp/junit/*.xml'
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
displayName: Upload Screenshots
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
PathtoPublish: 'tmp/reftests'
|
|
||||||
artifactName: ReftestResults
|
|
||||||
- job: Browser_Tests_Linux_Chrome_Stable
|
|
||||||
displayName: Linux Chrome Stable
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
variables:
|
|
||||||
TARGET_BROWSER: Chrome_Stable
|
|
||||||
dependsOn: Build
|
|
||||||
condition: succeeded()
|
|
||||||
steps:
|
|
||||||
- task: NodeTool@0
|
|
||||||
inputs:
|
|
||||||
versionSpec: '10.x'
|
|
||||||
displayName: 'Install Node.js'
|
|
||||||
- task: Npm@0
|
|
||||||
inputs:
|
|
||||||
command: install
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download library'
|
|
||||||
inputs:
|
|
||||||
artifactName: dist
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download testrunner'
|
|
||||||
inputs:
|
|
||||||
artifactName: build
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- script: Xvfb :99 &
|
|
||||||
displayName: 'Start Xvfb'
|
|
||||||
- script: DISPLAY=:99 npm run karma
|
|
||||||
displayName: 'Run Chrome tests - Chrome Stable'
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
testRunner: JUnit
|
|
||||||
testResultsFiles: 'tmp/junit/*.xml'
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
displayName: Upload Screenshots
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
PathtoPublish: 'tmp/reftests'
|
|
||||||
artifactName: ReftestResults
|
|
||||||
- job: Browser_Tests_OSX_Safari_IOS_9
|
|
||||||
displayName: iOS Simulator Safari 9
|
|
||||||
pool:
|
|
||||||
vmImage: 'macOS-10.13'
|
vmImage: 'macOS-10.13'
|
||||||
variables:
|
targetBrowser: Safari_IOS_9
|
||||||
TARGET_BROWSER: Safari_IOS_9
|
|
||||||
dependsOn: Build
|
- template: ci/browser-tests.yml
|
||||||
condition: succeeded()
|
parameters:
|
||||||
steps:
|
name: Browser_Tests_OSX_Safari_IOS_10
|
||||||
- task: NodeTool@0
|
displayName: iOS Simulator Safari 10
|
||||||
inputs:
|
|
||||||
versionSpec: '10.x'
|
|
||||||
displayName: 'Install Node.js'
|
|
||||||
- task: Npm@0
|
|
||||||
inputs:
|
|
||||||
command: install
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download library'
|
|
||||||
inputs:
|
|
||||||
artifactName: dist
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download testrunner'
|
|
||||||
inputs:
|
|
||||||
artifactName: build
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- script: npm run karma
|
|
||||||
displayName: 'Run Safari tests - Safari IOS'
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
testRunner: JUnit
|
|
||||||
testResultsFiles: 'tmp/junit/*.xml'
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
displayName: Upload Screenshots
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
PathtoPublish: 'tmp/reftests'
|
|
||||||
artifactName: ReftestResults
|
|
||||||
- job: Browser_Tests_OSX_Safari_IOS_10
|
|
||||||
displayName: iOS Simulator Safari 10
|
|
||||||
pool:
|
|
||||||
vmImage: 'macOS-10.13'
|
vmImage: 'macOS-10.13'
|
||||||
variables:
|
targetBrowser: Safari_IOS_10
|
||||||
TARGET_BROWSER: Safari_IOS_10
|
|
||||||
dependsOn: Build
|
- template: ci/browser-tests.yml
|
||||||
condition: succeeded()
|
parameters:
|
||||||
steps:
|
name: Browser_Tests_OSX_Safari_IOS_11
|
||||||
- task: NodeTool@0
|
displayName: iOS Simulator Safari 11
|
||||||
inputs:
|
|
||||||
versionSpec: '10.x'
|
|
||||||
displayName: 'Install Node.js'
|
|
||||||
- task: Npm@0
|
|
||||||
inputs:
|
|
||||||
command: install
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download library'
|
|
||||||
inputs:
|
|
||||||
artifactName: dist
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download testrunner'
|
|
||||||
inputs:
|
|
||||||
artifactName: build
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- script: npm run karma
|
|
||||||
displayName: 'Run Safari tests - Safari IOS'
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
testRunner: JUnit
|
|
||||||
testResultsFiles: 'tmp/junit/*.xml'
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
displayName: Upload Screenshots
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
PathtoPublish: 'tmp/reftests'
|
|
||||||
artifactName: ReftestResults
|
|
||||||
- job: Browser_Tests_OSX_Safari_IOS_11
|
|
||||||
displayName: iOS Simulator Safari 11
|
|
||||||
pool:
|
|
||||||
vmImage: 'macOS-10.13'
|
vmImage: 'macOS-10.13'
|
||||||
variables:
|
targetBrowser: Safari_IOS_11
|
||||||
TARGET_BROWSER: Safari_IOS_11
|
|
||||||
dependsOn: Build
|
- template: ci/browser-tests.yml
|
||||||
condition: succeeded()
|
parameters:
|
||||||
steps:
|
name: Browser_Tests_OSX_Safari_Stable
|
||||||
- task: NodeTool@0
|
displayName: OSX Safari Stable
|
||||||
inputs:
|
|
||||||
versionSpec: '10.x'
|
|
||||||
displayName: 'Install Node.js'
|
|
||||||
- task: Npm@0
|
|
||||||
inputs:
|
|
||||||
command: install
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download library'
|
|
||||||
inputs:
|
|
||||||
artifactName: dist
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download testrunner'
|
|
||||||
inputs:
|
|
||||||
artifactName: build
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- script: npm run karma
|
|
||||||
displayName: 'Run Safari tests - Safari IOS'
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
testRunner: JUnit
|
|
||||||
testResultsFiles: 'tmp/junit/*.xml'
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
displayName: Upload Screenshots
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
PathtoPublish: 'tmp/reftests'
|
|
||||||
artifactName: ReftestResults
|
|
||||||
- job: Browser_Tests_OSX_Safari_Stable
|
|
||||||
displayName: OSX Safari Stable
|
|
||||||
pool:
|
|
||||||
vmImage: 'macOS-10.13'
|
vmImage: 'macOS-10.13'
|
||||||
variables:
|
targetBrowser: Safari_Stable
|
||||||
TARGET_BROWSER: Safari_Stable
|
|
||||||
dependsOn: Build
|
- template: ci/browser-tests.yml
|
||||||
condition: succeeded()
|
parameters:
|
||||||
steps:
|
name: Browser_Tests_Windows_IE9
|
||||||
- task: NodeTool@0
|
displayName: Windows Internet Explorer 9 (Emulated)
|
||||||
inputs:
|
|
||||||
versionSpec: '10.x'
|
|
||||||
displayName: 'Install Node.js'
|
|
||||||
- task: Npm@0
|
|
||||||
inputs:
|
|
||||||
command: install
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download library'
|
|
||||||
inputs:
|
|
||||||
artifactName: dist
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download testrunner'
|
|
||||||
inputs:
|
|
||||||
artifactName: build
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- script: npm run karma
|
|
||||||
displayName: 'Run Safari tests - Safari Stable'
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
testRunner: JUnit
|
|
||||||
testResultsFiles: 'tmp/junit/*.xml'
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
displayName: Upload Screenshots
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
PathtoPublish: 'tmp/reftests'
|
|
||||||
artifactName: ReftestResults
|
|
||||||
- job: Browser_Tests_Windows_IE9
|
|
||||||
displayName: Windows Internet Explorer 9 (Emulated)
|
|
||||||
pool:
|
|
||||||
vmImage: 'vs2017-win2016'
|
vmImage: 'vs2017-win2016'
|
||||||
variables:
|
targetBrowser: IE_9
|
||||||
TARGET_BROWSER: IE_9
|
|
||||||
dependsOn: Build
|
- template: ci/browser-tests.yml
|
||||||
condition: succeeded()
|
parameters:
|
||||||
steps:
|
name: Browser_Tests_Windows_IE10
|
||||||
- task: NodeTool@0
|
displayName: Windows Internet Explorer 10 (Emulated)
|
||||||
inputs:
|
|
||||||
versionSpec: '10.x'
|
|
||||||
displayName: 'Install Node.js'
|
|
||||||
- task: Npm@0
|
|
||||||
inputs:
|
|
||||||
command: install
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download library'
|
|
||||||
inputs:
|
|
||||||
artifactName: dist
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download testrunner'
|
|
||||||
inputs:
|
|
||||||
artifactName: build
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- script: npm run karma
|
|
||||||
displayName: 'Run Internet Explorer tests - IE 9'
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
testRunner: JUnit
|
|
||||||
testResultsFiles: 'tmp/junit/*.xml'
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
displayName: Upload Screenshots
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
PathtoPublish: 'tmp/reftests'
|
|
||||||
artifactName: ReftestResults
|
|
||||||
- job: Browser_Tests_Windows_IE10
|
|
||||||
displayName: Windows Internet Explorer 10 (Emulated)
|
|
||||||
pool:
|
|
||||||
vmImage: 'vs2017-win2016'
|
vmImage: 'vs2017-win2016'
|
||||||
variables:
|
targetBrowser: IE_10
|
||||||
TARGET_BROWSER: IE_10
|
|
||||||
dependsOn: Build
|
- template: ci/browser-tests.yml
|
||||||
condition: succeeded()
|
parameters:
|
||||||
steps:
|
name: Browser_Tests_Windows_IE11
|
||||||
- task: NodeTool@0
|
displayName: Windows Internet Explorer 11
|
||||||
inputs:
|
|
||||||
versionSpec: '10.x'
|
|
||||||
displayName: 'Install Node.js'
|
|
||||||
- task: Npm@0
|
|
||||||
inputs:
|
|
||||||
command: install
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download library'
|
|
||||||
inputs:
|
|
||||||
artifactName: dist
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download testrunner'
|
|
||||||
inputs:
|
|
||||||
artifactName: build
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- script: npm run karma
|
|
||||||
displayName: 'Run Internet Explorer tests - IE 10'
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
testRunner: JUnit
|
|
||||||
testResultsFiles: 'tmp/junit/*.xml'
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
displayName: Upload Screenshots
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
PathtoPublish: 'tmp/reftests'
|
|
||||||
artifactName: ReftestResults
|
|
||||||
- job: Browser_Tests_Windows_IE11
|
|
||||||
displayName: Windows Internet Explorer 11
|
|
||||||
pool:
|
|
||||||
vmImage: 'vs2017-win2016'
|
vmImage: 'vs2017-win2016'
|
||||||
variables:
|
targetBrowser: IE_11
|
||||||
TARGET_BROWSER: IE_11
|
|
||||||
dependsOn: Build
|
|
||||||
condition: succeeded()
|
|
||||||
steps:
|
|
||||||
- task: NodeTool@0
|
|
||||||
inputs:
|
|
||||||
versionSpec: '10.x'
|
|
||||||
displayName: 'Install Node.js'
|
|
||||||
- task: Npm@0
|
|
||||||
inputs:
|
|
||||||
command: install
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download library'
|
|
||||||
inputs:
|
|
||||||
artifactName: dist
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: 'Download testrunner'
|
|
||||||
inputs:
|
|
||||||
artifactName: build
|
|
||||||
downloadPath: $(System.DefaultWorkingDirectory)
|
|
||||||
- script: npm run karma
|
|
||||||
displayName: 'Run Internet Explorer tests - IE 11'
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
testRunner: JUnit
|
|
||||||
testResultsFiles: 'tmp/junit/*.xml'
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
displayName: Upload Screenshots
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
PathtoPublish: 'tmp/reftests'
|
|
||||||
artifactName: ReftestResults
|
|
||||||
|
52
ci/browser-tests.yml
Normal file
52
ci/browser-tests.yml
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
parameters:
|
||||||
|
name: ''
|
||||||
|
vmImage: ''
|
||||||
|
targetBrowser: ''
|
||||||
|
xvfb: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- job: ${{ parameters.name }}
|
||||||
|
displayName: ${{ parameters.displayName }}
|
||||||
|
pool:
|
||||||
|
vmImage: ${{ parameters.vmImage }}
|
||||||
|
variables:
|
||||||
|
TARGET_BROWSER: ${{ parameters.targetBrowser }}
|
||||||
|
dependsOn: Build
|
||||||
|
condition: succeeded()
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: '10.x'
|
||||||
|
displayName: 'Install Node.js'
|
||||||
|
- task: Npm@0
|
||||||
|
inputs:
|
||||||
|
command: install
|
||||||
|
- task: DownloadBuildArtifacts@0
|
||||||
|
displayName: 'Download library'
|
||||||
|
inputs:
|
||||||
|
artifactName: dist
|
||||||
|
downloadPath: $(System.DefaultWorkingDirectory)
|
||||||
|
- task: DownloadBuildArtifacts@0
|
||||||
|
displayName: 'Download testrunner'
|
||||||
|
inputs:
|
||||||
|
artifactName: build
|
||||||
|
downloadPath: $(System.DefaultWorkingDirectory)
|
||||||
|
- ${{ if not(eq(parameters.xvfb, 'true')) }}:
|
||||||
|
- script: npm run karma
|
||||||
|
displayName: 'Run browser tests'
|
||||||
|
- ${{ if eq(parameters.xvfb, 'true') }}:
|
||||||
|
- script: Xvfb :99 &
|
||||||
|
displayName: 'Start Xvfb'
|
||||||
|
- script: DISPLAY=:99 npm run karma
|
||||||
|
displayName: 'Run browser tests'
|
||||||
|
- task: PublishTestResults@2
|
||||||
|
condition: succeededOrFailed()
|
||||||
|
inputs:
|
||||||
|
testRunner: JUnit
|
||||||
|
testResultsFiles: 'tmp/junit/*.xml'
|
||||||
|
- task: PublishBuildArtifacts@1
|
||||||
|
displayName: Upload Screenshots
|
||||||
|
condition: succeededOrFailed()
|
||||||
|
inputs:
|
||||||
|
PathtoPublish: 'tmp/reftests'
|
||||||
|
artifactName: ReftestResults
|
Loading…
Reference in New Issue
Block a user