如何使用黄瓜+量角器顺序运行多个特征文件 [英] How to run multiple feature files in sequence using Cucumber + protractor

查看:225
本文介绍了如何使用黄瓜+量角器顺序运行多个特征文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想按所需顺序或顺序运行功能文件,例如:

I want to run feature files in a desired order or sequence, for example:

 tags:"`@ProtractorScenario` or @CucumberScenario" 

但是首先要执行黄瓜方案.有人可以指导我吗?

But cucumber scenario is getting executed first. Can someone guide me on this?

注意:黄瓜正在根据文件夹中功能文件的字母顺序执行脚本

Note: Cucumber is executing scenario based on alphabetical order of feature file in folder

此外,如果特征文件超过50个,定义黄瓜特征文件排序的最佳方法是什么?

Also, in cases with more than 50+ feature files, what would be the best way to define sequencing of cucumber feature files?

推荐答案

为了拥有可靠的测试,您的测试应该独立并且不依赖于它们的运行顺序.原因是您的测试不应依赖在系统处于特定状态时,这将导致测试不稳定.您的每个测试都应设置预期状态(并拆除!),以便它们可以独立运行.

In order to have reliable tests, your tests should be independent and not rely on the order they are run in. The reason being that your test shouldn't depend on the system being in a certain state, as this will lead to flaky tests. Each of your tests should set up the expected state (and teardown!), so they can be run independently.

这篇关于如何使用黄瓜+量角器顺序运行多个特征文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆