[英]Angular/ Protractor E2E Test fails when run in Azure DevOps Pipeline. Passes locally
I am trying to run e2e tests on my angular application.我正在尝试在我的角度应用程序上运行 e2e 测试。 My tests pass locally when I run
ng e2e
but not in my pipeline.当我运行
ng e2e
但不在我的管道中时,我的测试在本地通过。 I'm going to share my protractor.conf, the pipeline tasks and the output I get from the task that fails below.我将分享我的 protractor.conf、管道任务和我从下面失败的任务中获得的输出。
Some more background:更多背景:
protractor.conf.js量角器.conf.js
const { SpecReporter } = require('jasmine-spec-reporter');
process.env.CHROME_BIN = process.env.CHROME_BIN || require("puppeteer").executablePath();
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
chromeOptions: {
args: ["--headless", "--disable-gpu", "--window-size=1200,900"],
binary: process.env.CHROME_BIN
},
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 120000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
Please help me get these tests to pass in azure请帮助我让这些测试顺利通过
Thanks!谢谢!
EDIT: I have that 'Update Webdriver' task because I read I should do it somewhere, it doesn't actually change the outcome if it is there or not编辑:我有那个“更新 Webdriver”任务,因为我读到我应该在某个地方做它,它实际上并没有改变结果,无论它是否存在
Have you tried to increase your allScriptsTimeout ?您是否尝试过增加allScriptsTimeout ?
The timeout in milliseconds for each script run on the browser.
在浏览器上运行的每个脚本的超时时间(以毫秒为单位)。 This should be longer than the maximum time your application needs to stabilize between tasks.
这应该比您的应用程序在任务之间稳定所需的最长时间要长。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.