使用@ angular-devkit / build-angular版本0.10.6时,a11y存在问题。 a11y在本地可以正常运行,但是在我们的Jenkins管道构建中失败。当我们降级到0.8.0时,它可以正常工作,但是我们必须使用更高版本,因为它可以解决PWA的问题。
我们的GetWindowThreadProcessId
如下所示:
package.json
和构建日志的摘录如下:
{
"name": "some-project",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"start:jenkins-test-server": "ng serve --port $JENKINS_PORT",
"a11y": "node a11y/pa11y.config.js",
"screenshot-comparison": "node screenshot-comparison/wraith-setup.js && wraith capture screenshot-comparison/wraith.config.yaml",
"build": "ng build",
"build:prod": "ng build --prod",
"bdd": "rimraf cucumber/build && tsc -p cucumber && protractor cucumber/build/protractor.conf.js",
"bdd-parallel": "rimraf cucumber/build && tsc -p cucumber && protractor cucumber/build/protractor.conf.parallel.js",
"bdd-parallel-retry-failures": "rimraf cucumber/build && tsc -p cucumber && protractor-flake --node_modules/.bin/protractor --parser cucumber --node-bin node --max-attempts=2 -- ./cucumber/build/protractor.conf.parallel.js",
"bdd-debug-vscode": "rimraf cucumber/build && tsc -p cucumber",
"bdd-debug-devtools": "node --inspect-brk ./node_modules/protractor/bin/protractor ./cucumber/build/protractor.conf.js",
"test": "ng test --browsers Chrome",
"test:headless": "ng test --browsers ChromeHeadlessNoSandbox --watch=false",
"test:bdd": "npm run webdriver && start-server-and-test start:jenkins-test-server $JENKINS_PORT bdd",
"test:bdd-local": "cross-env NO_PROXY=localhost,127.0.0.1 start-server-and-test start 4200 bdd",
"test:bdd-local-parallel": "cross-env NO_PROXY=localhost,127.0.0.1 start-server-and-test start 4200 bdd-parallel",
"test:bdd-local-debug": "cross-env NO_PROXY=localhost,127.0.0.1 start-server-and-test start 4200 bdd-debug-devtools",
"webdriver": "webdriver-manager update --versions.chrome=2.39 --gecko false --ignore_ssl --proxy http://10.16.0.22:443",
"webdriver-start": "webdriver-manager start",
"test:a11y": "start-server-and-test start:jenkins-test-server $JENKINS_PORT a11y",
"test:a11y-local": "start-server-and-test start 4200 a11y",
"test:screenshot-comparison": "start-server-and-test start:jenkins-test-server $JENKINS_PORT screenshot-comparison",
"test:screenshot-comparison-local": "cross-env NO_PROXY=localhost,127.0.0.1 start-server-and-test start 4200 screenshot-comparison",
"e2e": "ng e2e --webdriver-update=false --dev-server-target=",
"test:e2e": "npm run webdriver && start-server-and-test start:jenkins-test-server $JENKINS_PORT e2e",
"test:e2e-local": "cross-env NO_PROXY=localhost,127.0.0.1 start-server-and-test start 4200 e2e",
"lint": "npm run tslint && npm run htmlhint && npm run stylelint",
"tslint": "ng lint",
"htmlhint": "htmlhint --config .htmlhintrc \"src/app/**/*.html\"",
"stylelint": "stylelint \"src/**/*.scss\""
},
"private": true,
"dependencies": {
"@angular/animations": "^7.0.0",
"@angular/cdk": "^7.0.0",
"@angular/common": "^7.0.0",
"@angular/compiler": "^7.0.0",
"@angular/core": "^7.0.0",
"@angular/forms": "^7.0.0",
"@angular/http": "^7.0.0",
"@angular/platform-browser": "^7.0.0",
"@angular/platform-browser-dynamic": "^7.0.0",
"@angular/pwa": "^0.8.7",
"@angular/router": "^7.0.0",
"@angular/service-worker": "^7.0.0",
"@ngrx/effects": "^6.1.0",
"@ngrx/router-store": "^6.1.0",
"@ngrx/store": "^6.1.0",
"@ngrx/store-devtools": "^6.1.0",
"classlist.js": "^1.1.20150312",
"core-js": "^2.5.4",
"keyboard-focus": "^1.0.1",
"landg-dls": "git+ssh://git@10.136.69.221:7999/ft/landg-dls.git#v1.4.2",
"ngrx-store-freeze": "^0.2.4",
"protractor-flake": "^3.3.0",
"rxjs": "~6.3.3",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.10.6",
"@angular/cli": "~7.0.1",
"@angular/compiler-cli": "^7.0.0",
"@angular/language-service": "^7.0.3",
"@types/chai": "^4.1.7",
"@types/chai-as-promised": "^7.1.0",
"@types/cucumber": "^4.0.4",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^8.9.5",
"assert": "^1.4.1",
"casperjs": "^1.1.4",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"codelyzer": "~4.3.0",
"cross-env": "^5.2.0",
"cucumber": "^5.0.2",
"cucumber-html-report": "^0.6.5",
"cucumber-html-reporter": "^4.0.4",
"expect": "^23.6.0",
"fs-extra": "^7.0.0",
"htmlhint": "^0.10.1",
"jasmine-core": "~2.99.1",
"jasmine-marbles": "^0.4.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"mdn-polyfills": "^5.13.0",
"mergejson": "^1.1.0",
"ng2-cookies": "^1.0.12",
"node-sass": "^4.10.0",
"npm-audit-html": "^1.1.0",
"pa11y": "^5.1.0",
"path": "^0.12.7",
"protractor": "^5.4.1",
"protractor-cucumber-framework": "^6.1.1",
"protractor-multiple-cucumber-html-reporter-plugin": "^1.8.0",
"start-server-and-test": "^1.7.4",
"stylelint": "^9.5.0",
"stylelint-config-standard": "^18.2.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.3"
}
}
我们正在使用pa11y的5.1.0版本。