簡體   English   中英

Rakefile的黃瓜測試報告

[英]Cucumber test report from Rakefile

我有一組Ruby / Cucumber測試。 在IDE中運行時,所有測試均成功運行。

當我使用此CLI命令執行測試時,將運行測試並生成測試報告。

$ cucumber --format progress --format html --out=features_report.html -r features --tags '@this or @that' features

我需要從Rakefile執行測試以並行運行測試。 我可以用rake local調用下面的Rakefile來運行它們


desc 'Run the functional test suite locally'
  task :local do

test_args = ["-n", '1', 
             "-o" "-t '@this or @that'",
             "--type", 
             "cucumber", 
             '--',
             '-f',
             'progress', 
             '--',
             'features',]

    ParallelTests::CLI.new.run(test_args)
  end

但是我不知道生成測試報告的其他選項/參數在哪里。

如果我按正常的CLI命令在Rakefile中將報告位分組

             'progress',
              '-f',
              'HTML', 
             '--out',
             'first.html',

我收到此錯誤:

Error creating formatter: HTML (LoadError)

或者,如果我執行"-o" "-t '@this or @that' --out first.html --format HTML",

我得到這個:

All but one formatter must use --out, only one can print to each stream (or STDOUT) (RuntimeError)

生成測試報告的參數在test_args中的什么位置,它們看起來像什么?

提前致謝。

您可以在cucumber.yml文件中創建profile文件,並在配置文件下傳遞參數,如下所示。

default:
  --no-source --no-color
  --format progress --format html --out=features_report.html

現在按原樣運行rake任務,cucumber將從cucumber.yml文件中選擇參數並生成報告。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM