我可以使用 Selenium IDE 生成 Cucumber/Capybara 步骤吗? [英] Can I use Selenium IDE to generate Cucumber/Capybara steps?

查看:23
本文介绍了我可以使用 Selenium IDE 生成 Cucumber/Capybara 步骤吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 Selenium IDE (Firefox 插件) 和 Capybara (gem).我现在在我的 rails 应用程序中从 Cucumber/Capybara 步骤 (@javascript) 驱动 Selenium.

I've both installed Selenium IDE (Firefox addon) and Capybara (gem). I'm now driving Selenium from Cucumber/Capybara steps (@javascript) in my rails app.

问题是:

我可以将 Selenium IDE 步骤导出为 Cucumber/Capybara 步骤吗?

在 Selenium IDE 选项 > 格式中,我只能看到 Ruby (Test::Unit) 和 RSpec,但同时拥有 Capybara 格式会真棒.

In Selenium IDE Options > Format I can only see Ruby (Test::Unit) and RSpec, but having Capybara format as well would be awesome.

谢谢.

推荐答案

我不相信可以将 Selenium IDE 测试导出为 Cucumber 场景.老实说,我什至不相信构建这样的导出器有意义 - Selenium IDE 测试专注于测试的技术交互 - 单击此按钮,输入该字段,等待此页面加载.好的 Cucumber 测试专注于更高级别的用户操作 - 对于医疗保健系统,您的 Cucumber 测试可能包含当我承认一个名叫 Joe Blow 的新患者时",而不是当我点击新患者链接并且我输入第一个乔的名字,我输入了 Blow 的姓氏.您也许可以定义某种匹配器,以将这些技术交互组合中的某些组合识别为更高级别的抽象,但这将高度依赖于每个被测系统.

I don't believe it is possible to export Selenium IDE tests as Cucumber scenarios. Honestly, I'm not even convinced that it would make sense to build such an exporter - Selenium IDE tests are focused on the technical interactions of the test - click this button, type into that field, wait for this page to load. Good Cucumber tests are focused on higher-level user actions - for a healthcare system, your Cucumber tests might have "When I admit a new patient named Joe Blow" in them rather than "When I click the new patient link And I enter a first name of Joe and I enter a last name of Blow". You might be able to define some sort of matcher to recognize some of these combinations of technical interactions into the higher level abstractions, but it would be highly dependent on each system under test.

我还没有使用 Capybara,所以我不确定导出到该格式是否可行.

I haven't yet used Capybara, so I'm not sure whether an export to that format would be feasible.

这篇关于我可以使用 Selenium IDE 生成 Cucumber/Capybara 步骤吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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