У нас проблема с a11y при использовании @ angular-devkit / build-angular версии 0.10.6.Локально работает a11y, но не удается в нашей сборке Jenkins.Он работает нормально, когда мы понижаемся до 0.8.0, но мы должны использовать более позднюю версию, потому что она исправляет проблему с PWA.
Наша 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"
}
}
ивыдержка из журнала сборки выглядит следующим образом:
+ npm run test:a11y
> some-project@0.0.0 test:a11y /var/lib/jenkins/jobs/Compute/jobs/some-project-frontend/branches/bug-DWP-520.00rn7g/workspace
> start-server-and-test start:jenkins-test-server $JENKINS_PORT a11y
starting server using command "npm run start:jenkins-test-server"
and when url "http://localhost:4000" is responding
running tests using command "a11y"
> some-project@0.0.0 start:jenkins-test-server /var/lib/jenkins/jobs/Compute/jobs/some-project/branches/bug-DWP-520.00rn7g/workspace
> ng serve --port $JENKINS_PORT
** Angular Live Development Server is listening on localhost:4000, open your browser on http://localhost:4000/ **
Date: 2018-11-23T12:08:18.519Z
Hash: 84a75b28068bff1b0d74
Time: 20265ms
chunk {main} main.js, main.js.map (main) 280 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 427 kB [initial] [rendered]
chunk {product-product-module} product-product-module.js, product-product-module.js.map (product-product-module) 56.5 kB [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 9.05 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 191 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 5.52 MB [initial] [rendered]
�[34mℹ�[39m �[90m「wdm」�[39m: Compiled successfully.
Мы используем версию 5.1.0 pa11y.