且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我可以使用Selenium IDE生成Cucumber / Capybara步骤吗?

更新时间:2022-02-24 17:57:01

我不认为可以将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.

我还没有使用过水豚,所以我不确定导出为该格式是否可行。

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