我正在努力让parallel_tests使用我的黄瓜功能,因为它允许我更快地运行我的测试。
https://github.com/grosser/parallel_tests/wiki
问题是,当我以这种方式运行我的功能时,我得到了一堆未定义的步骤。 我在这里看到这个问题被提到是一个封闭的问题:
https://github.com/grosser/parallel_tests/issues/22
有了phuong-nguyen,他建议在我的bundle exec命令中添加features / step_definitions功能/支持。 我试过这个方法,如何在我的bundle exec命令中包含这两个目录?
这是我到目前为止所尝试的:
$ bundle exec rake --require features/step_definitions --require features/support parallel:features $ bundle exec features/step_definitions features/support rake parallel:features $ bundle exec rake parallel:features features/step_definitions features/support更新:
将parallel_tests更新为0.6.1后,以下命令仍然存在相同的问题:
$ bundle exec rake parallel:features features/step_definitions features/support一些功能通过而其他功能仍然无法找到步骤
I'm trying to get parallel_tests working with my cucumber features as it allows me to run my tests much faster.
https://github.com/grosser/parallel_tests/wiki
Problem is that when I run my features this way I get a heap of undefined steps. I've seen this problem mentioned as a closed issue here:
https://github.com/grosser/parallel_tests/issues/22
With phuong-nguyen he suggests adding features/step_definitions features/support to my bundle exec command. I've tried this every which way, how do I include these two directories in my bundle exec command?
Here is what I've tried so far:
$ bundle exec rake --require features/step_definitions --require features/support parallel:features $ bundle exec features/step_definitions features/support rake parallel:features $ bundle exec rake parallel:features features/step_definitions features/supportUpdate:
After updating parallel_tests to 0.6.1 the following command still has the same issue:
$ bundle exec rake parallel:features features/step_definitions features/supportSome features pass whilst others still cannot find the steps
最满意答案
我发现如果我将'-r features'添加到我的cucumber.yml std_opts行,那么我现在可以再次并行运行所有的黄瓜测试。
这是我的完整cucumber.yml文件:
<% rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip --tags ~@slow --tags ~@broken -r features" %> default: <%= std_opts %> features all: --format progress --tags ~@broken features slow: --format pretty --strict --tags @slow features broken: --format pretty --strict --tags @broken features wip: --tags @wip:3 --wip features rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip report: --format html --out=features.html report_pdf: --format pdf --out=features.pdf new: --tags @new new_report: --format html --out=features_new.html --tags @new new_report_pdf: --format pdf --out=features_new.pdf --tags @newI found that if I add '-r features' to my cucumber.yml std_opts line then I can now run all my cucumber tests parallel again.
Here is my full cucumber.yml file:
<% rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip --tags ~@slow --tags ~@broken -r features" %> default: <%= std_opts %> features all: --format progress --tags ~@broken features slow: --format pretty --strict --tags @slow features broken: --format pretty --strict --tags @broken features wip: --tags @wip:3 --wip features rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip report: --format html --out=features.html report_pdf: --format pdf --out=features.pdf new: --tags @new new_report: --format html --out=features_new.html --tags @new new_report_pdf: --format pdf --out=features_new.pdf --tags @new更多推荐
发布评论