简体   繁体   English

运行单个 e2e 测试时,Protractor 正在运行所有 before()

[英]Protractor is running all the before() when running one single e2e test

I have a bunch of e2e Protractor tests (each one with its own before(), after(), Given(), When() and Then().我有一堆 e2e Protractor 测试(每个测试都有自己的 before()、after()、Given()、When() 和 Then()。

I've seen that before each single e2e test is executed, Protrator runs every Before() it sees, even the ones that doesn't belong to the test.我已经看到在执行每个单独的 e2e 测试之前,Protrator 运行它看到的每个 Before(),即使是那些不属于测试的。 Is that an expected behavior of Protractor?这是量角器的预期行为吗?

It is caused by some naming clash in the Scenario strings?它是由场景字符串中的一些命名冲突引起的吗?

This is not on Protractor, as it is on Cucumber.这不是在量角器上,而是在 Cucumber 上。

And yes:是的:

Before hooks will be run before the first step of each scenario. https://github.com/cucumber/cucumber/wiki/Hooks https://github.com/cucumber/cucumber/wiki/Hooks

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM