1
所以,我實現了一個Cucumberjs數據表,但我不認爲我這樣做是正確的。這裏我有什麼Cucumberjs數據表 - 如何把它交給.RAW()
this.And(/^If I click the row "([^"]*)" then I should the following nested information$/, function (rowName, data) {
resultPage.clickRow(rowName);
data = dataTable.raw();
return console.log(data);
});
和我小黃瓜一步看起來像
Then If I click the row "Summary" then I should the following nested information
| Tax | 11.50
| Gratuity | 4.50
| Total | 26.59
現在我只是想獲得此表並打印出來,以確保它回來以正確的格式,但我得到一個詞法錯誤和測試甚至不會開始。你怎麼能在Javascript中實現這個?我似乎無法在網上找到任何有關cucumberjs的文檔或示例,但當然有幾個適用於java/cucumber。
另外,我明白lexing錯誤與它期望這是一個場景大綱以及我沒有在表之前指定示例有關。但是,這不應該是一個場景大綱。這應該是一個數據表..
你得到的錯誤是什麼? – Grasshopper
我的表開始行的Lexing錯誤 – Tree55Topz
我在表格中注意到的一件事是,您需要用分隔符(即'|')結束每行。不知道這是否是複製粘貼錯誤。 – Grasshopper