【问题标题】:Testacular: run tests with Chrome extensions disabledTestacular:在禁用 Chrome 扩展的情况下运行测试
【发布时间】:2013-02-05 09:49:42
【问题描述】:

在配置了 singleRun: true 的 Testacular 在 Google Chrome 中运行冒烟测试时,我发现像 LastPass 这样的一些扩展程序每次都会打开第一个运行窗口,并带有是/否提示。您必须单击 LastPass 提示才能完成测试套件。

【问题讨论】:

    标签: google-chrome command-line karma-runner


    【解决方案1】:

    您可以使用自定义浏览器脚本解决此问题。

    1. 在您的 Testacular conf 中,将 browsers = ['Chrome'] 更改为 [__dirname + '/chrome_without_extensions.sh'](我认为路径需要是绝对的)

    2. 在包含 testacular.conf.js 的文件夹中创建一个名为 chrome_without_extensions.sh 的新文件;

      #!/bin/bash
      
      exec "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
      --user-data-dir="/tmp/testacular" \
      --disable-extensions \
      --no-default-browser-check \
      --no-first-run \
      --disable-default-apps \
      --use-fake-device-for-media-stream \
      "$@"
      

    您可能需要chmod 775 chrome_without_extensions.sh 授予运行脚本的权限。

    现在,当您下次运行 Testacular 时 - 任何像 LastPass 这样的扩展程序都不应该打扰您。

    希望这对某人有所帮助。

    【讨论】:

      猜你喜欢
      • 2014-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-25
      • 1970-01-01
      • 1970-01-01
      • 2023-01-09
      • 2015-01-07
      相关资源
      最近更新 更多