Skip to content

Commit

Permalink
Fix testcafe tests (#8947)
Browse files Browse the repository at this point in the history
* Make angular works correct under 16 node

* Use chrome from puppeteer for testcafe tests

* Fix error
  • Loading branch information
dk981234 authored Oct 21, 2024
1 parent 91c35f4 commit bf8502b
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 63 deletions.
11 changes: 11 additions & 0 deletions .testcaferc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@


module.exports = {
"browsers": [`chrome:${require("puppeteer").executablePath()}:headless`],
"nativeAutomation": "true",
"concurrency": 4,
"quarantineMode": {
"successThreshold": 1,
"attemptLimit": 5
}
}
3 changes: 0 additions & 3 deletions .testcaferc.json

This file was deleted.

8 changes: 4 additions & 4 deletions accessibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: '14.x'
versionSpec: '16.x'
displayName: 'Install Node.js'

- task: CopyFiles@2
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: '14.x'
versionSpec: '16.x'
displayName: 'Install Node.js'

- task: CopyFiles@2
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: '14.x'
versionSpec: '16.x'
displayName: 'Install Node.js'

- task: CopyFiles@2
Expand Down Expand Up @@ -217,7 +217,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down
16 changes: 8 additions & 8 deletions build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down Expand Up @@ -228,7 +228,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down Expand Up @@ -348,7 +348,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down Expand Up @@ -450,7 +450,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down Expand Up @@ -552,7 +552,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down Expand Up @@ -788,7 +788,7 @@ jobs:

# - task: NodeTool@0
# inputs:
# versionSpec: "14.x"
# versionSpec: "16.x"
# displayName: "Install Node.js"

# - task: CopyFiles@2
Expand Down Expand Up @@ -884,7 +884,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down
8 changes: 4 additions & 4 deletions devops-accessibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: '14.x'
versionSpec: '16.x'
displayName: 'Install Node.js'

- task: CopyFiles@2
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: '14.x'
versionSpec: '16.x'
displayName: 'Install Node.js'

- task: CopyFiles@2
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: '14.x'
versionSpec: '16.x'
displayName: 'Install Node.js'

- task: CopyFiles@2
Expand Down Expand Up @@ -219,7 +219,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down
12 changes: 6 additions & 6 deletions devops-pull-requests-parallel-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down Expand Up @@ -313,7 +313,7 @@ jobs:

# - task: NodeTool@0
# inputs:
# versionSpec: "14.x"
# versionSpec: "16.x"
# displayName: "Install Node.js"

# - task: CopyFiles@2
Expand Down Expand Up @@ -360,7 +360,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down
12 changes: 6 additions & 6 deletions devops-visual-regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
versionSpec: '16.x'
displayName: 'Install Node.js'

- task: CopyFiles@2
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: '14.x'
versionSpec: '16.x'
displayName: 'Install Node.js'

- task: CopyFiles@2
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: '14.x'
versionSpec: '16.x'
displayName: 'Install Node.js'

- task: CopyFiles@2
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"
displayName: "Install Node.js"

- task: CopyFiles@2
Expand Down Expand Up @@ -388,7 +388,7 @@ jobs:

# - task: NodeTool@0
# inputs:
# versionSpec: '14.x'
# versionSpec: '16.x'
# displayName: 'Install Node.js'

# - task: CopyFiles@2
Expand Down Expand Up @@ -455,7 +455,7 @@ jobs:

- task: NodeTool@0
inputs:
versionSpec: '14.x'
versionSpec: '16.x'
displayName: 'Install Node.js'

- task: CopyFiles@2
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"testcafe_file": "concurrently \"http-server --silent\" \"testcafe chrome testCafe/survey/surveyWidth.ts --selector-timeout 1500 --reporter minimal\"",
"testcafe_ci": "testcafe -c 4 -q chrome:headless testCafe/ --app \"http-server --silent\" --reporter minimal",
"testcafe_sauce": "testcafe \"saucelabs:Chrome@56.0:Windows 10\" testCafe/",
"testcafe:ko": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=knockout",
"testcafe:ko": "http-server --silent & testcafe testCafe/ --reporter minimal --env=knockout",
"testcafe:jquery-ui": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome testCafe/ --app \"http-server --silent\" --env=jquery-ui",
"testcafe:jquery-ui:ci": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=jquery-ui",
"testcafe:jquery-ui:ci": "http-server --silent & testcafe testCafe/ --reporter minimal --env=jquery-ui",
"testcafe:survey-js-ui": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome testCafe/ --app \"http-server --silent\" --env=survey-js-ui",
"testcafe:survey-js-ui:ci": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=survey-js-ui",
"vrt:jquery-ui:ci": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=jquery-ui",
"vrt:survey-js-ui:ci": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=survey-js-ui",
"testcafe:react": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=react",
"testcafe:vue": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=vue",
"testcafe:survey-js-ui:ci": "http-server --silent & testcafe testCafe/ --reporter minimal --env=survey-js-ui",
"vrt:jquery-ui:ci": "testcafe ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=jquery-ui",
"vrt:survey-js-ui:ci": "testcafe ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=survey-js-ui",
"testcafe:react": "http-server --silent & testcafe testCafe/ --reporter minimal --env=react",
"testcafe:vue": "http-server --silent & testcafe testCafe/ --reporter minimal --env=vue",
"release": "commit-and-tag-version --message \"Release: %s [azurepipelines skip]\" ",
"build_core_dev": "webpack --config ./build-scripts/survey-core/webpack.config.js --env.buildType dev",
"build_core_prod": "webpack --config ./build-scripts/survey-core/webpack.config.js --env.buildType prod",
Expand Down Expand Up @@ -88,24 +88,24 @@
"vrt:ko": "testcafe chrome ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --reporter minimal --env=knockout --selector-timeout 1500",
"vrt:react": "testcafe chrome ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --reporter minimal --env=react --selector-timeout 1500",
"visual-regression-tests:ci": "testcafe chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal",
"visual-regression-tests:ci:knockout": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=knockout",
"visual-regression-tests:ci:angular": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server ./packages/survey-angular-ui/example/dist --proxy http://localhost:8080? -p 8080\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=angular",
"visual-regression-tests:ci:knockout": "testcafe ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=knockout",
"visual-regression-tests:ci:angular": "testcafe ./visualRegressionTests/ --app \"http-server ./packages/survey-angular-ui/example/dist --proxy http://localhost:8080? -p 8080\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=angular",
"visual-regression-tests:angular": "testcafe -c 4 -q chrome ./visualRegressionTests/ --app \"http-server ./packages/survey-angular-ui/example/dist --proxy http://localhost:8080? -p 8080\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=angular",
"visual-regression-tests:ci:react": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=react",
"visual-regression-tests:ci:vue": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue",
"visual-regression-tests:ci:react": "testcafe ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=react",
"visual-regression-tests:ci:vue": "testcafe ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue",
"visual-regression-tests:file": "testcafe chrome:headless --app \"http-server\" ./visualRegressionTests/tests/defaultV2/paneldynamic.ts --screenshots ./ --reporter minimal --selector-timeout 1500",
"visual-regression-tests:ci:vue3": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"npm run preview --prefix ./packages/survey-vue3-ui/example\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue3",
"visual-regression-tests:ci:vue3": "testcafe ./visualRegressionTests/ --app \"npm run preview --prefix ./packages/survey-vue3-ui/example\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue3",
"visual-regression-tests:vue3": "testcafe -c 4 -q chrome ./visualRegressionTests/ --app \"npm run preview --prefix ./packages/survey-vue3-ui/example\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue3",
"accessibility-tests": "testcafe chrome ./accessibilityTests/ --app \"http-server\" --screenshots ./ --reporter minimal --selector-timeout 1500",
"accessibility-tests:ci:knockout": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./accessibilityTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=knockout",
"accessibility-tests:ci:angular": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./accessibilityTests/ --app \"http-server ./packages/survey-angular-ui/example/dist --proxy http://localhost:8080? -p 8080\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=angular",
"accessibility-tests:ci:react": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./accessibilityTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=react",
"accessibility-tests:ci:vue": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./accessibilityTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue",
"accessibility-tests:ci:vue3": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./accessibilityTests/ --app \"npm run preview --prefix ./packages/survey-vue3-ui/example\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue3",
"testcafe:ci:vue3": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --app \"npm run preview --prefix ./packages/survey-vue3-ui/example\" --selector-timeout 1500 --reporter minimal --env=vue3",
"accessibility-tests:ci:knockout": "testcafe ./accessibilityTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=knockout",
"accessibility-tests:ci:angular": "testcafe ./accessibilityTests/ --app \"http-server ./packages/survey-angular-ui/example/dist --proxy http://localhost:8080? -p 8080\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=angular",
"accessibility-tests:ci:react": "testcafe ./accessibilityTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=react",
"accessibility-tests:ci:vue": "testcafe ./accessibilityTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue",
"accessibility-tests:ci:vue3": "testcafe ./accessibilityTests/ --app \"npm run preview --prefix ./packages/survey-vue3-ui/example\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue3",
"testcafe:ci:vue3": "testcafe testCafe/ --app \"npm run preview --prefix ./packages/survey-vue3-ui/example\" --selector-timeout 1500 --reporter minimal --env=vue3",
"testcafe:vue3": "testcafe chrome testCafe/ --app \"npm run preview --prefix ./packages/survey-vue3-ui/example \" --selector-timeout 1500 --reporter minimal --env=vue3",
"testcafe:angular": "testcafe chrome testCafe/ --app \"http-server ./packages/survey-angular-ui/example/dist --proxy http://localhost:8080? -p 8080\" --selector-timeout 1500 --reporter minimal --env=angular",
"testcafe:ci:angular": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --app \"http-server ./packages/survey-angular-ui/example/dist --proxy http://localhost:8080? -p 8080\" --selector-timeout 1500 --reporter minimal --env=angular",
"testcafe:ci:angular": "testcafe testCafe/ --app \"http-server ./packages/survey-angular-ui/example/dist --proxy http://localhost:8080? -p 8080\" --selector-timeout 1500 --reporter minimal --env=angular",
"prepare": "husky install",
"test:postcss": "postcss build/survey-core/defaultV2.css --silent -u postcss-calc -u autoprefixer -u postcss-fail-on-warn -o defaultV2.postcss.css && rimraf defaultV2.postcss.css"
},
Expand Down Expand Up @@ -175,7 +175,7 @@
"postcss-cli": "10.1.0",
"postcss-fail-on-warn": "0.2.1",
"preact": "^10.21.0",
"puppeteer": "^1.19.0",
"puppeteer": "23.5.3",
"qunit": "2.14.0",
"react": "17.0.1",
"react-dom": "17.0.1",
Expand Down Expand Up @@ -229,4 +229,4 @@
"signature_pad": "^4.1.5",
"vite": "^3.1.8"
}
}
}
7 changes: 2 additions & 5 deletions packages/survey-angular-ui/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
"name": "survey-angular-ui-example",
"version": "0.0.1",
"peerDependencies": {},
"devDependencies": {
"@types/node": "^16.11.10"
},
"devDependencies": {},
"dependencies": {
"@angular/router": "^12.0.0",
"bootstrap": "^3.3.7",
"survey-core": "../../../build/survey-core",
"surveyjs-widgets": "^1.9.40",
"tslib": "^2.3.0"
}
}
}
Loading

0 comments on commit bf8502b

Please sign in to comment.