【发布时间】:2021-08-31 02:14:21
【问题描述】:
我有一些 SpecFlow 测试提供如下测试输出:
Given my location is set to secret
-> done: Location.GivenMyLocationIsSetTo("secret") (0.0s)
And the date today is 03 Jun 2017 15:00
-> done: Date.GiveThatTheEffectiveDateIs(2017-06-03 3:00:0...) (0.0s)
And I have selected a client with the following properties
--- table step argument ---
| property | value |
| SomeAttr | someval |
| SomeAttr2 | someval2 |
-> done: Client.GivenIHaveSelectedAClientWithTheFollowingProperties(<table>) (0.0s)
And I select a currency of CAD
-> done: Currency.WhenISetCurrency("CAD") (0.0s)
Then I see the following messages
--- table step argument ---
| classification | message |
| Class1 | Hello world |
-> done: Message.ThenISeeTheFollowingMessages(<table>) (2.9s)
我注意到,对于我的 所有 测试,最后一步是需要所有时间的步骤(即上面的 2.9 秒 - 见底线 - 所有之前的步骤加起来为零)。
我有成千上万个测试用例,它们需要很多小时才能运行,这已成为一个问题。
- 这是正常现象还是意料之中?
- 此持续时间指标是否包括测试工具本身的拆解(或者它纯粹是待测代码)?
- 关于如何分析持续时间并进一步分解它有什么提示吗?
注意:
- 我没有使用 Selenium
- 整个测试需要 2.9 秒 - 其中 100% 似乎在最后一步
【问题讨论】:
-
您是否使用 Selenium 来自动化浏览器?能否为最后一步的步骤定义添加代码?
-
对于这个特定的测试,测试花费的总时间是多少?这应该可以帮助您回答测试的拆卸是否包含在最后一步中。