在运行phantomjs时,如何通过编程从karma获取html

2024-05-15 15:55:12 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图从无人参与的python脚本运行ng测试,需要捕获html以便转发给it开发人员。有关守则如下:

ng test --single-run --progress=false --browsers=PhantomJS

PhantomJS似乎将其输出发送到localhost:9876。是否有任何方法将其重定向到文件和/或stdout?还是有更好的解决方案,我还没有想到


Tags: runtest脚本falselocalhost开发人员htmlit
1条回答
网友
1楼 · 发布于 2024-05-15 15:55:12

结果证明这很简单。我缺少的步骤是,我需要在karma.config文件中指定一个输出目录。该文件的相关部分现在如下所示:

htmlReporter: {
  outputDir: 'C:\\TMP',
  templatePath: null,
  focusOnFailures: true,
  namedFiles: false,
  pageTitle: null,
  urlFriendlyName: false,
  reportName: myReport

相关问题 更多 >