我試過了,現在它適用於我。我在_steps.rb文件
Then /^I see cell label "([^"]*)" row num (\d+) in section (\d+)$/ do |cellLabel, row, section|
###### diff cells with labels in table, vertically orderd ######
## E.g. Then I see cell label "abc" row num 1 in section 0
res = query("label marked:'#{cellLabel}' parent tableViewCell indexPath:#{row},#{section}").empty?
if (res)
screenshot_and_raise "There is no cell label with text #{cellLabel} in indexpath #{row},#{section}"
end
end
聲明一個步驟定義和部分使用它蠡特徵文件中像
- 然後我看到電池標籤「xxxx1111」行NUM 0 0
- 然後我看到細胞標記「xxxx2222」行號碼1中的段0
- 然後我看到細胞標記物「xxxx4444」行號碼2中的段0
- 然後我看到細胞標記物「xxxx3333」行號碼3在第0
希望這對別人有用:)