测试两个 Cucumber 功能时,浏览器会话未清除
我的应用程序上有两个黄瓜功能,类似于:
Feature: Number 1
Background: User logs in on twitter
Steps
@log-out-remote-too
Scenario: User logs out from local-app
Steps
Feature: Number 2
Scenario: User is logged in and is welcomed
Sees "welcome" inside "something"
Sees more stuff
我正在使用 webdriver/selenium for firefox 和 css 选择器。永远是第二个功能!失败了,无论如何。 我尝试删除该钩子,这样它就不会转到 twitter.com 并注销。 我还尝试了一个钩子@re-login来登录我的本地应用程序。 我也尝试过通过水豚清除cookies。
如果有人能在这方面帮助我,我真的很感激。我拒绝在不遵循由外而内循环的情况下开发应用程序的想法,但没有那么多时间。
PD 我注意到第二个功能的存在(即使它没有场景)会使第一个功能失败。这对我来说很奇怪
I have two cucumber features on my app that resembles something like:
Feature: Number 1
Background: User logs in on twitter
Steps
@log-out-remote-too
Scenario: User logs out from local-app
Steps
Feature: Number 2
Scenario: User is logged in and is welcomed
Sees "welcome" inside "something"
Sees more stuff
I am using webdriver/selenium for firefox and the css selector. The second feature always! fails, no matter what.
I have tried removing the hook so it does not go to twitter.com and logs out.
I have tried also a hook @re-login for logging in on my local app.
I have also tried clearing the cookies through Capybara.
I would really thank if someone could help me on this. I am resisting the idea to develop my app without following the outside-in cycle but have not so much time.
PD I have noticed that the presence of the second feature (even if it has no scenarios on it) makes the first feature fail. This is weird to me
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我终于找到了解决这个问题的方法。
我编写了以下钩子:
我将其添加到需要“干净”运行的场景中
I finally found a workaround for this.
I wrote the following hook:
which I added to the scenarios which needed to run "cleanly"