开发者

Using Cucumber with parallel_tests gives me a heap of undefined steps

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 开发者_如何学JAVAway 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/support

Update:

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/support

Some features pass whilst others still cannot find the steps


I 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 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜