Cucumber cuke4duke.Table.rows()和cuke4duke.Table.raw()之间有什么区别?

Cucumber cuke4duke.Table.rows()和cuke4duke.Table.raw()之间有什么区别?,cucumber,Cucumber,和的区别是什么 ? 我发现,当我只传递一行的表时,rows()返回一个大小为0的列表 黄瓜步骤 Then I see the following projects in the ProjectList | My Private Project | Then I see the following projects in the ProjectList | Regression Project 3 | | My Private Project | Java实现 @Then ("^I see t

和的区别是什么 ?

我发现,当我只传递一行的表时,rows()返回一个大小为0的列表

黄瓜步骤

Then I see the following projects in the ProjectList
| My Private Project |
Then I see the following projects in the ProjectList
| Regression Project 3 |
| My Private Project |
Java实现

@Then ("^I see the following projects in the ProjectList$")
public void iSeeTheFollowingProjectsInProjectList(cuke4duke.Table table) {
    table.rows().size(); // gives 0 
    table.raw().size(); // gives 1
@Then ("^I see the following projects in the ProjectList$")
public void iSeeTheFollowingProjectsInProjectList(cuke4duke.Table table) {
    // When I asked, I thought this was returning 2, but it's not, it's returning 1
    table.rows().size();
    table.raw().size(); // gives 2
但是下面的内容确实起到了预期的作用

黄瓜步骤

Then I see the following projects in the ProjectList
| My Private Project |
Then I see the following projects in the ProjectList
| Regression Project 3 |
| My Private Project |
Java实现

@Then ("^I see the following projects in the ProjectList$")
public void iSeeTheFollowingProjectsInProjectList(cuke4duke.Table table) {
    table.rows().size(); // gives 0 
    table.raw().size(); // gives 1
@Then ("^I see the following projects in the ProjectList$")
public void iSeeTheFollowingProjectsInProjectList(cuke4duke.Table table) {
    // When I asked, I thought this was returning 2, but it's not, it's returning 1
    table.rows().size();
    table.raw().size(); // gives 2

您的结果在Cucumber Ruby中无法复制。
对于第一个场景,
Table#rows()
返回0个结果,
Table#raw()
-1个结果
对于第二个场景,
Table#rows()
返回1个结果,
Table#raw()
-2个结果

Table#rows()
将第一行识别为表头

所以如果你的结果是真的(我还没有检查),那可能是Cuke4Duke中的一个bug


但是Cuke4Duke的所有工作都是如此,所以它不会被修复。

你说它不存在是什么意思?我能得到一个链接吗?@JuanMendes只要看看Cuke4Duke,谢谢你提供的关于Cuke4Duke的信息,我不知道这个问题意味着什么,因为他们说Java仍然受支持。无论如何,关于答案,可能是我报告的内容不准确,可能没有bug。你所说的很有道理,很可能就是正在发生的事情。周一上班时我会接受答案,到时候我可以验证。@JuanMendes“他们说Java仍然受支持”。他们不支持Cuke4Duke。他们只支持Cucumber-JVM。Cuke4Duke中没有bug,您完全正确,很抱歉问题中的误导信息